Skip to content

Commit 9ff44db

Browse files
committed
Fix Saucelabs test for messaging
1 parent 705e9f9 commit 9ff44db

File tree

2 files changed

+5
-0
lines changed

2 files changed

+5
-0
lines changed

packages/messaging/src/controllers/sw-controller.test.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -277,6 +277,10 @@ describe('SwController', () => {
277277
});
278278

279279
it('warns if there are more action buttons than the browser limit', async () => {
280+
// This doesn't exist on Firefox.
281+
if (!Notification.maxActions) {
282+
return;
283+
}
280284
stub(Notification, 'maxActions').value(1);
281285

282286
const warnStub = stub(console, 'warn');

packages/messaging/src/controllers/sw-controller.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -339,6 +339,7 @@ function showNotification(details: NotificationDetails): Promise<void> {
339339
const title = details.title ?? '';
340340

341341
const { actions } = details;
342+
// Note: Firefox does not support the maxActions property.
342343
const { maxActions } = Notification;
343344
if (actions && maxActions && actions.length > maxActions) {
344345
console.warn(

0 commit comments

Comments
 (0)