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:
Matthew Raymer
2025-08-12 09:57:52 +00:00
parent 4553b6b674
commit 76295f62b3
11 changed files with 1491 additions and 96 deletions

View File

@@ -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(),
};

View File

@@ -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();

View File

@@ -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(),
};

View File

@@ -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(),
};