From fadffd4db7d8f02e174a4ed6f6251f265f7729df Mon Sep 17 00:00:00 2001 From: Hagop Jamkojian Date: Wed, 4 Dec 2019 21:27:16 +0100 Subject: [PATCH] Fix refresh token test --- tests/integration/auth.test.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/integration/auth.test.js b/tests/integration/auth.test.js index 02b223a8..2fd25b1a 100644 --- a/tests/integration/auth.test.js +++ b/tests/integration/auth.test.js @@ -169,8 +169,8 @@ describe('Auth routes', () => { const dbRefreshTokenDoc = await Token.findOne({ token: res.body.refresh.token }); expect(dbRefreshTokenDoc).toMatchObject({ type: 'refresh', user: userOne._id, blacklisted: false }); - const oldDbRefreshTokenDoc = await Token.findOne({ token: refreshToken }); - expect(oldDbRefreshTokenDoc).toBeNull(); + const dbRefreshTokenCount = await Token.countDocuments(); + expect(dbRefreshTokenCount).toBe(1); }); test('should return 400 error if refresh token is missing from request body', async () => {