diff --git a/static/js/notifications.js b/static/js/notifications.js index 236048bf0f..61a9e2bcca 100644 --- a/static/js/notifications.js +++ b/static/js/notifications.js @@ -266,7 +266,8 @@ const NotificationManager = { // Only show once per day for each notification if (now - lastShown > 24 * 60 * 60 * 1000) { - if (Notification.permission === 'granted') { + // Show browser notification if supported and permission granted + if ('Notification' in window && Notification.permission === 'granted') { const notification = new Notification('Python Deadlines Reminder', { body: `${matchedThreshold} day${matchedThreshold > 1 ? 's' : ''} until ${conf.name} CFP closes!`, icon: '/static/img/python-deadlines-logo.png', @@ -288,6 +289,8 @@ const NotificationManager = { setTimeout(() => notification.close(), 10000); } + // Record notification attempt regardless of browser support + // This prevents duplicate notifications on browsers that don't support the API localStorage.setItem(notifyKey, now.toString()); } } diff --git a/tests/e2e/specs/search-functionality.spec.js b/tests/e2e/specs/search-functionality.spec.js index d73fb212be..3eca0a2938 100644 --- a/tests/e2e/specs/search-functionality.spec.js +++ b/tests/e2e/specs/search-functionality.spec.js @@ -367,7 +367,12 @@ test.describe('Search Functionality', () => { }); test.describe('Search Accessibility', () => { - test('should be keyboard navigable', async ({ page }) => { + test('should be keyboard navigable', async ({ page }, testInfo) => { + // Skip on mobile browsers - Tab key navigation doesn't work the same way on mobile + // Mobile browsers are designed for touch input, not keyboard navigation + const isMobile = testInfo.project.name.includes('mobile'); + test.skip(isMobile, 'Keyboard Tab navigation is not supported on mobile browsers'); + // Get the visible search input to ensure we're interacting with the right element const searchInput = await getVisibleSearchInput(page);