From bd2327a3ae22f51b0b60f03a29c102a34123e670 Mon Sep 17 00:00:00 2001 From: Hongbo Wu Date: Thu, 21 Jul 2022 21:01:00 +0800 Subject: [PATCH] test set auth token after login --- packages/api/test/routers/auth.test.ts | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/packages/api/test/routers/auth.test.ts b/packages/api/test/routers/auth.test.ts index bd82ed49d..9ddede738 100644 --- a/packages/api/test/routers/auth.test.ts +++ b/packages/api/test/routers/auth.test.ts @@ -173,6 +173,12 @@ describe('auth router', () => { const res = await loginRequest(email, password).expect(302) expect(res.header.location).to.endWith('/waitlist') }) + + it('set auth token in cookie', async () => { + const res = await loginRequest(email, password).expect(302) + expect(res.header['set-cookie']).to.be.an('array') + expect(res.header['set-cookie'][0]).to.contain('auth') + }) }) context('when user not exists', () => {