Skip to content

Commit

Permalink
Add tests for suppression configs (#128)
Browse files Browse the repository at this point in the history
  • Loading branch information
byn9826 authored Aug 28, 2024
1 parent 640f58f commit fa5b5b3
Show file tree
Hide file tree
Showing 4 changed files with 612 additions and 105 deletions.
66 changes: 0 additions & 66 deletions server/src/middlewares/__tests__/auth.test.ts

This file was deleted.

33 changes: 33 additions & 0 deletions server/src/routes/__tests__/app.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,39 @@ describe(
mock(db),
)
expect(res1.status).toBe(401)

const res2 = await app.request(
BaseRoute,
{
headers: {
Authorization: `Bearer ${await getS2sToken(
db,
Scope.ReadApp,
)}`,
},
},
mock(db),
)
expect(res2.status).toBe(401)
},
)

test(
'should return 400 using wrong token',
async () => {
const res = await app.request(
BaseRoute,
{ headers: { Authorization: 'Bearer ' } },
mock(db),
)
expect(res.status).toBe(400)

const res1 = await app.request(
BaseRoute,
{ headers: { Authorization: 'abc' } },
mock(db),
)
expect(res1.status).toBe(400)
},
)
},
Expand Down
Loading

0 comments on commit fa5b5b3

Please sign in to comment.