Skip to content

Commit

Permalink
Fix notification test types
Browse files Browse the repository at this point in the history
  • Loading branch information
openhands-agent committed Feb 10, 2025
1 parent 65bbc4b commit 96bdc5d
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions frontend/__tests__/services/notification.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,10 @@ interface NotificationConstructor {
}

describe('sendNotification', () => {
let mockNotification: Mock;
let mockNotification: Mock & {
permission: NotificationPermission;
requestPermission: () => Promise<NotificationPermission>;
};

beforeEach(() => {
// Mock localStorage
Expand All @@ -20,7 +23,10 @@ describe('sendNotification', () => {
mockNotification = vi.fn((title: string, options?: NotificationOptions) => ({
title,
...options,
}));
})) as Mock & {
permission: NotificationPermission;
requestPermission: () => Promise<NotificationPermission>;
};
Object.defineProperty(mockNotification, 'permission', {
get: () => 'granted',
configurable: true
Expand Down

0 comments on commit 96bdc5d

Please sign in to comment.