Skip to content

Commit 755ab26

Browse files
committed
fix(notifications): adds type=button to logout, mocks matchMedia
1 parent d6e493c commit 755ab26

2 files changed

Lines changed: 3 additions & 0 deletions

File tree

src/app/components/layout/Header.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,7 @@ export default function Header() {
132132
</button>
133133

134134
<button
135+
type="button"
135136
onClick={handleLogout}
136137
class="text-sm text-gray-500 dark:text-gray-400 hover:text-gray-700 dark:hover:text-gray-200 shrink-0"
137138
aria-label="Sign out"

tests/components/shared/NotificationDrawer.test.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,12 @@ beforeEach(() => {
1414
clearNotifications();
1515
clearMutedSources();
1616
vi.useFakeTimers();
17+
vi.spyOn(window, "matchMedia").mockReturnValue({ matches: false } as MediaQueryList);
1718
});
1819

1920
afterEach(() => {
2021
vi.useRealTimers();
22+
vi.restoreAllMocks();
2123
});
2224

2325
function renderDrawer(open = true, onClose = vi.fn()) {

0 commit comments

Comments
 (0)