Skip to content

Commit 940f6ff

Browse files
committed
Fix tests
1 parent 5f66433 commit 940f6ff

File tree

2 files changed

+8
-9
lines changed

2 files changed

+8
-9
lines changed

test/Menu.test.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,14 +24,14 @@ test('renders correctly', () => {
2424
<line x1="3" y1="18" x2="21" y2="18"></line>
2525
</svg>
2626
<div id="d">
27-
<a href="chrome-search://local-ntp/local-ntp.html">Open Default Tab</a>
28-
<a href="chrome://bookmarks/">Bookmarks Manager</a>
29-
<a href="chrome://downloads/">Downloads</a>
30-
<a href="chrome://history/">History</a>
27+
<a href="chrome://new-tab-page">Open Default Tab</a>
28+
<a href="chrome://bookmarks">Bookmarks Manager</a>
29+
<a href="chrome://downloads">Downloads</a>
30+
<a href="chrome://history">History</a>
3131
<a href="chrome://settings/passwords">Passwords</a>
3232
<hr>
3333
<a href="">New Tab Settings</a>
34-
<a href="https://github.com/MaxMilton/new-tab/issues">Submit Bug</a>
34+
<a href="https://github.com/maxmilton/new-tab/issues">Submit Bug</a>
3535
</div>
3636
</div>`,
3737
);

test/utils.ts

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -196,12 +196,11 @@ export function mocksSetup(): void {
196196
global.chrome = mockChrome;
197197

198198
global.DocumentFragment = window.DocumentFragment;
199+
global.localStorage = window.localStorage;
199200
}
200201

201202
export function mocksTeardown(): void {
202203
// @ts-expect-error - cleaning up
203-
global.chrome = undefined;
204-
205-
// @ts-expect-error - cleaning up
206-
global.DocumentFragment = undefined;
204+
// eslint-disable-next-line no-multi-assign
205+
global.chrome = global.DocumentFragment = global.localStorage = undefined;
207206
}

0 commit comments

Comments
 (0)