fix: Resolve TypeScript compilation errors and test environment issues
- Update interface definitions to match test requirements - Add missing methods to DailyNotificationPlugin interface - Fix ContentHandler signature compatibility - Switch Jest test environment from node to jsdom - Install required jsdom dependencies - Update mock plugin objects with all required methods - Fix timestamp type mismatches in tests
This commit is contained in:
@@ -13,6 +13,10 @@ describe('DailyNotification Advanced Scenarios', () => {
|
||||
cancelAllNotifications: jest.fn(),
|
||||
getNotificationStatus: jest.fn(),
|
||||
updateSettings: jest.fn(),
|
||||
getBatteryStatus: jest.fn(),
|
||||
requestBatteryOptimizationExemption: jest.fn(),
|
||||
setAdaptiveScheduling: jest.fn(),
|
||||
getPowerState: jest.fn(),
|
||||
checkPermissions: jest.fn(),
|
||||
requestPermissions: jest.fn(),
|
||||
};
|
||||
|
||||
@@ -53,9 +53,10 @@ describe('DailyNotification Plugin', () => {
|
||||
describe('getLastNotification', () => {
|
||||
it('should return the last notification', async () => {
|
||||
const mockResponse: NotificationResponse = {
|
||||
id: 'test-notification',
|
||||
title: 'Last Notification',
|
||||
body: 'This was the last notification',
|
||||
timestamp: new Date().toISOString()
|
||||
timestamp: Date.now()
|
||||
};
|
||||
|
||||
const result = await DailyNotification.getLastNotification();
|
||||
|
||||
@@ -18,6 +18,10 @@ describe('DailyNotification Edge Cases', () => {
|
||||
cancelAllNotifications: jest.fn(),
|
||||
getNotificationStatus: jest.fn(),
|
||||
updateSettings: jest.fn(),
|
||||
getBatteryStatus: jest.fn(),
|
||||
requestBatteryOptimizationExemption: jest.fn(),
|
||||
setAdaptiveScheduling: jest.fn(),
|
||||
getPowerState: jest.fn(),
|
||||
checkPermissions: jest.fn(),
|
||||
requestPermissions: jest.fn(),
|
||||
};
|
||||
|
||||
@@ -17,6 +17,10 @@ describe('DailyNotification Enterprise Scenarios', () => {
|
||||
cancelAllNotifications: jest.fn(),
|
||||
getNotificationStatus: jest.fn(),
|
||||
updateSettings: jest.fn(),
|
||||
getBatteryStatus: jest.fn(),
|
||||
requestBatteryOptimizationExemption: jest.fn(),
|
||||
setAdaptiveScheduling: jest.fn(),
|
||||
getPowerState: jest.fn(),
|
||||
checkPermissions: jest.fn(),
|
||||
requestPermissions: jest.fn(),
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user