-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test(front): config vitest and add tests
- Loading branch information
1 parent
1449034
commit 36ff80f
Showing
9 changed files
with
104 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,6 +4,7 @@ module.exports = { | |
'vue-router', | ||
'@vueuse/core', | ||
'vitest', | ||
'pinia', | ||
{ | ||
axios: [['default', 'axios']] | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
// @ts-nocheck | ||
import router from '../../src/router/index' | ||
|
||
test('home route should be correctly defined', () => { | ||
const homeRoute = router.getRoutes().find(route => route.name === 'home') | ||
|
||
expect(homeRoute).toBeDefined() | ||
expect(homeRoute.path).toBe('/') | ||
expect(homeRoute.meta.requiresAuth).toBe(false) | ||
}) | ||
|
||
test('about route should be correctly defined', () => { | ||
const aboutRoute = router.getRoutes().find(route => route.name === 'about') | ||
|
||
expect(aboutRoute).toBeDefined() | ||
expect(aboutRoute.path).toBe('/about') | ||
expect(aboutRoute.meta.requiresAuth).toBe(true) | ||
}) | ||
|
||
test('login route should be correctly defined', () => { | ||
const loginRoute = router.getRoutes().find(route => route.name === 'login') | ||
|
||
expect(loginRoute).toBeDefined() | ||
expect(loginRoute.path).toBe('/login') | ||
expect(loginRoute.meta.requiresAuth).toBe(false) | ||
}) | ||
|
||
test('signup route should be correctly defined', () => { | ||
const signupRoute = router.getRoutes().find(route => route.name === 'recruiterSignup') | ||
|
||
expect(signupRoute).toBeDefined() | ||
expect(signupRoute.path).toBe('/signup') | ||
expect(signupRoute.meta.requiresAuth).toBe(false) | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
// @ts-nocheck | ||
describe('userTypeStore', () => { | ||
it('sets the user type', () => { | ||
const pinia = createPinia() | ||
const store = useUserTypeStore(pinia) | ||
|
||
expect(store.userType).toBe('') | ||
store.setUserType('admin') | ||
expect(store.userType).toBe('admin') | ||
}) | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters