diff --git a/docs/api/notification.md b/docs/api/notification.md index b571880713..61a0c3aabf 100644 --- a/docs/api/notification.md +++ b/docs/api/notification.md @@ -110,6 +110,44 @@ shown notification and create a new one with identical properties. Dismisses the notification. +### Instance Properties + +#### `notification.title` + +A `String` property representing the title of the notification. + +#### `notification.subtitle` + +A `String` property representing the subtitle of the notification. + +#### `notification.body` + +A `String` property representing the body of the notification. + +#### `notification.replyPlaceholder` + +A `String` property representing the reply placeholder of the notification. + +#### `notification.sound` + +A `String` property representing the sound of the notification. + +#### `notification.closeButtonText` + +A `String` property representing the close button text of the notification. + +#### `notification.silent` + +A `Boolean` property representing whether the notification is silent. + +#### `notification.hasReply` + +A `Boolean` property representing whether the notification has a reply action. + +#### `notification.actions` + +A [`NotificationAction[]`](structures/notification-action.md) property representing the actions of the notification. + ### Playing Sounds On macOS, you can specify the name of the sound you'd like to play when the diff --git a/spec/api-notification-spec.js b/spec-main/api-notification-spec.ts similarity index 86% rename from spec/api-notification-spec.js rename to spec-main/api-notification-spec.ts index 747040825c..3e872f8823 100644 --- a/spec/api-notification-spec.js +++ b/spec-main/api-notification-spec.ts @@ -1,10 +1,5 @@ -const chai = require('chai') -const dirtyChai = require('dirty-chai') - -const { expect } = chai -chai.use(dirtyChai) - -const { Notification } = require('electron').remote +import { expect } from 'chai' +import { Notification } from 'electron' describe('Notification module', () => { it('inits, gets and sets basic string properties correctly', () => { @@ -44,21 +39,25 @@ describe('Notification module', () => { it('inits, gets and sets basic boolean properties correctly', () => { const n = new Notification({ + title: 'title', + body: 'body', silent: true, hasReply: true }) - expect(n.silent).to.be.true() + expect(n.silent).to.be.true('silent') n.silent = false - expect(n.silent).to.be.false() + expect(n.silent).to.be.false('silent') - expect(n.hasReply).to.be.true() + expect(n.hasReply).to.be.true('has reply') n.hasReply = false - expect(n.hasReply).to.be.false() + expect(n.hasReply).to.be.false('has reply') }) it('inits, gets and sets actions correctly', () => { const n = new Notification({ + title: 'title', + body: 'body', actions: [ { type: 'button',