feat: custom toast xml and failure reporting for notifications (#25401)
* allow custom toast xml and report failures * docs * tests * don't use namespaces * lint doesn't like trailing commas * addressing feedback
This commit is contained in:
parent
d2282ac51a
commit
b43859f098
9 changed files with 282 additions and 219 deletions
|
@ -108,6 +108,14 @@ describe('Notification module', () => {
|
|||
n.close();
|
||||
});
|
||||
|
||||
ifit(process.platform === 'win32')('inits, gets and sets custom xml', () => {
|
||||
const n = new Notification({
|
||||
toastXml: '<xml/>'
|
||||
});
|
||||
|
||||
expect(n.toastXml).to.equal('<xml/>');
|
||||
});
|
||||
|
||||
ifit(process.platform === 'darwin')('emits show and close events', async () => {
|
||||
const n = new Notification({
|
||||
title: 'test notification',
|
||||
|
@ -126,5 +134,16 @@ describe('Notification module', () => {
|
|||
}
|
||||
});
|
||||
|
||||
ifit(process.platform === 'win32')('emits failed event', async () => {
|
||||
const n = new Notification({
|
||||
toastXml: 'not xml'
|
||||
});
|
||||
{
|
||||
const e = emittedOnce(n, 'failed');
|
||||
n.show();
|
||||
await e;
|
||||
}
|
||||
});
|
||||
|
||||
// TODO(sethlu): Find way to test init with notification icon?
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue