Skip to content

Commit

Permalink
update tests
Browse files Browse the repository at this point in the history
  • Loading branch information
tryb3l committed Jul 20, 2024
1 parent 5c21a68 commit 63c6211
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions test/auth/login.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,17 @@ t.test('successful login', async (t) => {
token: /(\w*\.){2}.*/,
})

// Verify Set-Cookie headers for token and sessionId
const setCookieHeaders = login.headers['set-cookie']
t.ok(
setCookieHeaders.some((header) => header.startsWith('token=')),
'Token cookie is set',
)
t.ok(
setCookieHeaders.some((header) => header.startsWith('sessionId=')),
'SessionId cookie is set',
)

t.test('access protected route', async (t) => {
const app = await buildApp(t, {
MONGO_URL: 'mongodb://localhost:27017/login-test-db',
Expand Down

0 comments on commit 63c6211

Please sign in to comment.