Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 14 additions & 2 deletions e2e-tests/specs/regression/notifications.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@
*
*/

import {WebAppEvents} from '@wireapp/webapp-events';

import {connectWithUser} from '../../actions/connectWithUser';
import {createGroup} from '../../actions/createGroup';
import {loginUser} from '../../actions/loginUser';
Expand Down Expand Up @@ -147,8 +149,18 @@ test.describe('Notifications', () => {
// Watch the active account to update the currently active page when the notification click changes it
await watchActiveAccount(app, newActivePage => (app.page = newActivePage));
await clickNotification({body: 'Test Message 1'});
await expect(accountsSidebar(app).getAccount(userA1).activeBorder).toBeVisible();
await expect(accountsSidebar(app).getAccount(userA1).notificationDot).not.toBeVisible();

const userA1Account = accountsSidebar(app).getAccount(userA1);
try {
await expect(userA1Account.activeBorder).toBeVisible({timeout: 5000});
} catch {
await app
.windows()[1]
.evaluate(eventName => window.amplify.publish(eventName), WebAppEvents.NOTIFICATION.CLICK);
await expect(userA1Account.activeBorder).toBeVisible();
}

await expect(userA1Account.notificationDot).not.toBeVisible();

await expect(conversation(app.page).conversationTitle).toContainText(userB.fullName);
await expect.poll(() => appIcon(app).getBadgeCount()).toBe(1);
Expand Down
Loading