Skip to content

Commit

Permalink
test signin and auth guard
Browse files Browse the repository at this point in the history
  • Loading branch information
Mogge committed Mar 27, 2024
1 parent 60c8655 commit 8284866
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 3 deletions.
12 changes: 12 additions & 0 deletions frontend/src/pages/auth/Guard.spec.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import { PageContextServer } from 'vike/types'
import { describe, it, expect } from 'vitest'

import { guard } from './+guard'

let pageContext: PageContextServer

describe('auth page guard', () => {
it('returns void', async () => {
expect(await guard(pageContext)).toBe(undefined)
})
})
12 changes: 12 additions & 0 deletions frontend/src/pages/signin/Guard.spec.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import { PageContextServer } from 'vike/types'
import { describe, it, expect } from 'vitest'

import { guard } from './+guard'

let pageContext: PageContextServer

describe('signin page guard', () => {
it('returns void', async () => {
expect(await guard(pageContext)).toBe(undefined)
})
})
6 changes: 3 additions & 3 deletions frontend/vitest.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,10 @@ export default mergeConfig(
'src/stories/**/*',
],
thresholds: {
lines: 90,
lines: 96,
// functions: 20, // has problems see https://github.com/vitest-dev/vitest/issues/3607
branches: 93,
statements: 90,
branches: 100,
statements: 96,
},
},
},
Expand Down

0 comments on commit 8284866

Please sign in to comment.