mirror of
https://github.com/electron/electron.git
synced 2026-04-10 03:01:51 -04:00
test: fix typecheck
This commit is contained in:
@@ -289,7 +289,9 @@ describe('Notification module', () => {
|
||||
// skip the content assertions if Notification Center is empty.
|
||||
if (history.length > 0) {
|
||||
const found = history.find((item: any) => item.id === 'history-test-id');
|
||||
expect(found).to.not.be.undefined();
|
||||
if (!found) {
|
||||
expect.fail('Expected to find notification with id "history-test-id" in history');
|
||||
}
|
||||
expect(found).to.be.an.instanceOf(Notification);
|
||||
expect(found.title).to.equal('history test');
|
||||
expect(found.subtitle).to.equal('history subtitle');
|
||||
@@ -315,7 +317,9 @@ describe('Notification module', () => {
|
||||
const history = await Notification.getHistory();
|
||||
if (history.length > 0) {
|
||||
const found = history.find((item: any) => item.id === 'history-show-close');
|
||||
expect(found).to.not.be.undefined();
|
||||
if (!found) {
|
||||
expect.fail('Expected to find notification with id "history-show-close" in history');
|
||||
}
|
||||
// Calling show() and close() on a restored notification should not throw
|
||||
expect(() => {
|
||||
found.show();
|
||||
|
||||
Reference in New Issue
Block a user