refactor(service-worker): Format comments and add additional test (#25860)

- Format JSDoc for notificationClicks
- Add comment on why handleClick does not use hasOwnProperty
- Add additional test that uses handleClick without action

PR Close #25860
This commit is contained in:
joostme
2018-10-03 16:02:14 +02:00
committed by Kara Erickson
parent 4a01ada291
commit aca8ea9c0b
3 changed files with 26 additions and 11 deletions

View File

@ -27,15 +27,14 @@ export class SwPush {
/**
* Emits the payloads of the received push notification messages as well as the action the user
* interacted with.
* If no action was used the action property will be an empty string `''`.
* interacted with. If no action was used the action property will be an empty string `''`.
*
* Note that the `notification` property is **not** a
* [Notification](https://developer.mozilla.org/en-US/docs/Web/API/Notification) object but rather
* a
* Note that the `notification` property is **not** a [Notification][Mozilla Notification] object
* but rather a
* [NotificationOptions](https://notifications.spec.whatwg.org/#dictdef-notificationoptions)
* object that also includes the `title` of the
* [Notification](https://developer.mozilla.org/en-US/docs/Web/API/Notification) object.
* object that also includes the `title` of the [Notification][Mozilla Notification] object.
*
* [Mozilla Notification]: https://developer.mozilla.org/en-US/docs/Web/API/Notification
*/
readonly notificationClicks: Observable < {
action: string;