This commit is contained in:
parent
cf927114c2
commit
064ddd0a1e
@ -70,6 +70,29 @@ test ('reject invalid user', async (t) => {
|
|||||||
));
|
));
|
||||||
});
|
});
|
||||||
|
|
||||||
|
test ('reject and recover', async (t) => {
|
||||||
|
await t.throwsAsync (client.login (
|
||||||
|
'testuser',
|
||||||
|
'bar',
|
||||||
|
`http://localhost:${port}`
|
||||||
|
));
|
||||||
|
|
||||||
|
const session = await client.login (
|
||||||
|
'testuser',
|
||||||
|
'foo',
|
||||||
|
`http://localhost:${port}`
|
||||||
|
);
|
||||||
|
t.is (typeof session, 'string');
|
||||||
|
|
||||||
|
const resp = await fetch (
|
||||||
|
`http://localhost:${port}`,
|
||||||
|
{ headers: { session } }
|
||||||
|
);
|
||||||
|
|
||||||
|
t.is (resp.status, consts.http.status_ok);
|
||||||
|
t.is (await resp.text (), 'foo:69');
|
||||||
|
});
|
||||||
|
|
||||||
test ('reject invalid password', async (t) => {
|
test ('reject invalid password', async (t) => {
|
||||||
await t.throwsAsync (client.login (
|
await t.throwsAsync (client.login (
|
||||||
'testuser',
|
'testuser',
|
||||||
|
Loading…
x
Reference in New Issue
Block a user