testing possible bug
Some checks failed
continuous-integration/drone/push Build is failing

This commit is contained in:
Timo Hocker 2020-07-12 19:41:59 +02:00
parent cf927114c2
commit 064ddd0a1e

View File

@ -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) => {
await t.throwsAsync (client.login (
'testuser',