This commit is contained in:
		| @@ -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', | ||||
|   | ||||
		Reference in New Issue
	
	Block a user