Skip to content

Commit 8c6fef0

Browse files
chore: fix failing vitest tests
1 parent 01cfcd9 commit 8c6fef0

4 files changed

Lines changed: 2109 additions & 446 deletions

File tree

app/components/navbar.test.tsx

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,9 +58,17 @@ vi.mock('lucide-react', () => ({
5858

5959
describe('Navbar mobile menu', () => {
6060
beforeEach(() => {
61+
Object.defineProperty(window, 'localStorage', {
62+
value: {
63+
getItem: vi.fn(),
64+
setItem: vi.fn(),
65+
clear: vi.fn(),
66+
},
67+
writable: true,
68+
});
6169
window.innerWidth = 500;
6270
mockMatchMedia(false);
63-
window.localStorage.clear();
71+
window.localStorage?.clear();
6472
document.documentElement.className = '';
6573
});
6674

@@ -106,8 +114,16 @@ describe('Navbar mobile menu', () => {
106114

107115
describe('Navbar responsive breakpoints', () => {
108116
beforeEach(() => {
117+
Object.defineProperty(window, 'localStorage', {
118+
value: {
119+
getItem: vi.fn(),
120+
setItem: vi.fn(),
121+
clear: vi.fn(),
122+
},
123+
writable: true,
124+
});
109125
window.innerWidth = 500;
110-
window.localStorage.clear();
126+
window.localStorage?.clear();
111127
document.documentElement.className = '';
112128
});
113129

app/page.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ import { Footer } from '@/app/components/Footer';
1414

1515
import { FeatureCard, FeatureCardsSection } from '@/components/FeatureCards';
1616
import { DiscordButton } from '@/components/DiscordButton';
17-
import InteractiveViewer from '@/components/InteractiveViewer';
1817

1918
const Icons = {
2019
Github: () => (

0 commit comments

Comments
 (0)