From 79e783e3e036830d291f482c6f75d371524c7869 Mon Sep 17 00:00:00 2001 From: "[Ilker:{...}]" Date: Thu, 25 Sep 2025 06:23:10 -0400 Subject: [PATCH] test(taskbar): mock AuthContext in hydration test and add dev:all script --- .gitignore | 3 ++- output.txt | Bin 0 -> 1892 bytes package.json | 1 + tests/Taskbar.hydration.test.js | 10 ++++++++++ 4 files changed, 13 insertions(+), 1 deletion(-) create mode 100644 output.txt diff --git a/.gitignore b/.gitignore index de26bd8..3a4aae3 100644 --- a/.gitignore +++ b/.gitignore @@ -30,4 +30,5 @@ Thumbs.db ehthumbs.db Desktop.ini /coverage -package-lock.json \ No newline at end of file +package-lock.json +output.txt \ No newline at end of file diff --git a/output.txt b/output.txt new file mode 100644 index 0000000000000000000000000000000000000000..7f01e349e57460a2a5344f3badb6cb31c9e40294 GIT binary patch literal 1892 zcmbu9QEw7K6ov1ziT`23gS4S6Ev;2+G&M%!gTDC(7Fl2`P~1hWG5zc6cV>2BVV9Cf zCJc9H=AL`*%(?gPpP{8TVmRwE#(XWYW9!+1`HOvJ9$R9O-B@n7HfMM6!0uyv1jgKk z_}qDt3t?wNxeTgF`XtnLNRPL1Ui z-c!cfdtoz9E#WGEXHOW8EW&yQQ@!8rTuRRp@uom(%6kFx#H&RArN@LAIjZ@^N}3e^Dr3Ykkxn+f(v-Nco3zsn*BgXk``kD|HlXRdc8%M~?`~ zi+JN(-#w13?Q`$(A{i?^e(EA(q{`B3O|WPD-frx)(T}quJ7#`muf6@dQhoRAlnRr5 zY%h!5&>ebUJNs1dP*o_7vo|PI_GYx;^FREX@piKhb*w5$R$SC=nlfG2d^n%^zBDHT z)%|u~NWm=GB>s+5Zd!RjC>0cQabQPsgh7(XiO*cOw%kxj=!H4Aq;50doZ@V= Y`B3X0&feh>@^|(g-#h%a^%~Ur58TQZE&u=k literal 0 HcmV?d00001 diff --git a/package.json b/package.json index a2d90c1..f167d87 100644 --- a/package.json +++ b/package.json @@ -6,6 +6,7 @@ "dev": "next dev", "build": "next build", "start": "next start", + "dev:all": "npm test && npm run dev", "test": "jest", "prepare": "husky", "format": "prettier --write .", diff --git a/tests/Taskbar.hydration.test.js b/tests/Taskbar.hydration.test.js index 3b38dc4..f3b20a5 100644 --- a/tests/Taskbar.hydration.test.js +++ b/tests/Taskbar.hydration.test.js @@ -26,6 +26,16 @@ jest.mock('../src/context/ThemeContext', () => ({ }), })); +// Mock the AuthContext +jest.mock('../src/context/AuthContext', () => ({ + useAuth: () => ({ + user: null, + isAuthenticated: false, + isLoading: false, + error: null, + }), +})); + const Taskbar = require('../src/components/Taskbar').default; describe('Taskbar Hydration Error Fix', () => {