diff --git a/test/Authentication.test.ts b/test/Authentication.test.ts index 4f91abc..032e24a 100644 --- a/test/Authentication.test.ts +++ b/test/Authentication.test.ts @@ -197,18 +197,19 @@ describe('Register with email (magic_link)', () => { }); test('Cannot register without specifying username', async () => { - const res = await agent.get('/csrf').expect(200); + let res = await agent.get('/csrf').expect(200); const cookies = res.get('Set-Cookie'); const csrf = res.text; - await agent.post('/auth/register') + res = await agent.post('/auth/register') .set('Cookie', cookies) .send({ csrf: csrf, auth_method: 'magic_link', - identifier: 'glimmer@example.org', + identifier: 'no_user_name@example.org', }) .expect(400); + expect(res.body.messages?.name?.name).toStrictEqual('UndefinedValueValidationError'); expect(await popEmail()).toBeNull(); });