Skip to content

Commit 5ddae35

Browse files
authored
Merge pull request #21 from dailker/main
test(taskbar): mock AuthContext in hydration test and add dev:all script
2 parents 5e2526c + 79e783e commit 5ddae35

4 files changed

Lines changed: 13 additions & 1 deletion

File tree

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,4 +30,5 @@ Thumbs.db
3030
ehthumbs.db
3131
Desktop.ini
3232
/coverage
33-
package-lock.json
33+
package-lock.json
34+
output.txt

output.txt

1.85 KB
Binary file not shown.

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
"dev": "next dev",
77
"build": "next build",
88
"start": "next start",
9+
"dev:all": "npm test && npm run dev",
910
"test": "jest",
1011
"prepare": "husky",
1112
"format": "prettier --write .",

tests/Taskbar.hydration.test.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,16 @@ jest.mock('../src/context/ThemeContext', () => ({
2626
}),
2727
}));
2828

29+
// Mock the AuthContext
30+
jest.mock('../src/context/AuthContext', () => ({
31+
useAuth: () => ({
32+
user: null,
33+
isAuthenticated: false,
34+
isLoading: false,
35+
error: null,
36+
}),
37+
}));
38+
2939
const Taskbar = require('../src/components/Taskbar').default;
3040

3141
describe('Taskbar Hydration Error Fix', () => {

0 commit comments

Comments
 (0)