diff --git a/packages/service-worker/test/comm_spec.ts b/packages/service-worker/test/comm_spec.ts index 8f739923c4..323c7afae9 100644 --- a/packages/service-worker/test/comm_spec.ts +++ b/packages/service-worker/test/comm_spec.ts @@ -303,14 +303,15 @@ import {async_fit, async_it} from './async'; ]); }); }); + describe('messagesClicked', () => { it('receives notification clicked messages', () => { - const sendMessage = (type: string, message: string) => - mock.sendMessage({type, data: {message}}); + const sendMessage = (type: string, action: string) => + mock.sendMessage({type, data: {action}}); const receivedMessages: string[] = []; push.messagesClicked.subscribe( - (msg: {message: string}) => receivedMessages.push(msg.message)); + (msg: {action: string}) => receivedMessages.push(msg.action)); sendMessage('NOTIFICATION_CLICK', 'this was a click'); sendMessage('NOT_IFICATION_CLICK', 'this was not a click'); diff --git a/packages/service-worker/worker/testing/scope.ts b/packages/service-worker/worker/testing/scope.ts index 4ecf148a69..5262257800 100644 --- a/packages/service-worker/worker/testing/scope.ts +++ b/packages/service-worker/worker/testing/scope.ts @@ -351,7 +351,7 @@ class MockPushEvent extends MockExtendableEvent { } class MockNotificationEvent extends MockExtendableEvent { constructor(private _notification: any, readonly action?: string) { super(); } - readonly notification = {...this._notification, close: () => { return; }}; + readonly notification = {...this._notification, close: () => undefined}; } class MockInstallEvent extends MockExtendableEvent {}