refactor(service-worker): update tests based of review feedback (#25860)

- Rename invalid click event name
- Make test expects more explicit
- Remove NotificationClickEvent in favor of NotificationEvent

PR Close #25860
This commit is contained in:
Joost Zöllner
2018-09-21 11:09:44 +02:00
committed by Kara Erickson
parent c4ad83e7cd
commit f017b26e5d
4 changed files with 13 additions and 12 deletions

View File

@ -72,7 +72,7 @@ interface ActivateEvent extends ExtendableEvent {}
// Notification API
interface NotificationEvent {
interface NotificationEvent extends ExtendableEvent {
action: string;
notification: Notification;
}
@ -83,8 +83,6 @@ interface PushEvent extends ExtendableEvent {
data: PushMessageData;
}
interface NotificationClickEvent extends NotificationEvent, ExtendableEvent {}
interface PushMessageData {
arrayBuffer(): ArrayBuffer;
blob(): Blob;
@ -116,7 +114,7 @@ interface ServiceWorkerGlobalScope {
addEventListener(event: 'fetch', fn: (event?: FetchEvent) => any): void;
addEventListener(event: 'install', fn: (event?: ExtendableEvent) => any): void;
addEventListener(event: 'push', fn: (event?: PushEvent) => any): void;
addEventListener(event: 'notificationclick', fn: (event?: NotificationClickEvent) => any): void;
addEventListener(event: 'notificationclick', fn: (event?: NotificationEvent) => any): void;
addEventListener(event: 'sync', fn: (event?: SyncEvent) => any): void;
fetch(request: Request|string): Promise<Response>;