Skip to content

Commit

Permalink
test: add new case
Browse files Browse the repository at this point in the history
  • Loading branch information
dougfabris committed Dec 17, 2024
1 parent c45a8af commit 6369528
Show file tree
Hide file tree
Showing 7 changed files with 18 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ const RoomMessage = ({
ref={messageRef}
id={message._id}
role='listitem'
aria-roledescription={sequential ? t('sequential_message') : t('message')}
aria-roledescription={t('message')}
tabIndex={0}
aria-labelledby={`${message._id}-displayName ${message._id}-time ${message._id}-content ${message._id}-read-status`}
onClick={selecting ? toggleSelected : undefined}
Expand Down
13 changes: 12 additions & 1 deletion apps/meteor/tests/e2e/export-messages.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,6 @@ test.describe.serial('export-messages', () => {

test('should display an error when trying to send email without selecting any email', async () => {
await poHomeChannel.sidenav.openChat(targetChannel);
await poHomeChannel.content.sendMessage('hello world');
await poHomeChannel.tabs.kebab.click({ force: true });
await poHomeChannel.tabs.btnExportMessages.click();

Expand All @@ -58,4 +57,16 @@ test.describe.serial('export-messages', () => {

await expect(poUtils.getAlertByText(`You haven't selected any messages`)).toBeVisible();
});

test('should be able to send messages after closing export messages', async () => {
await poHomeChannel.sidenav.openChat(targetChannel);
await poHomeChannel.tabs.kebab.click({ force: true });
await poHomeChannel.tabs.btnExportMessages.click();

await poHomeChannel.content.getMessageByText('hello world').click();
await poHomeChannel.tabs.exportMessages.btnCancel.click();
await poHomeChannel.content.sendMessage('hello export');

await expect(poHomeChannel.content.getMessageByText('hello export')).toBeVisible();
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -388,7 +388,7 @@ export class HomeContent {
}

getSystemMessageByText(text: string): Locator {
return this.page.locator('[aria-roledescription="system message"]', { hasText: text });
return this.page.locator('[role="listitem"][aria-roledescription="system message"]', { hasText: text });
}

getMessageByText(text: string): Locator {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,8 @@ export class HomeFlextabExportMessages {
get btnSend() {
return this.page.locator('role=button[name="Send"]');
}

get btnCancel() {
return this.page.locator('role=button[name="Cancel"]');
}
}
1 change: 0 additions & 1 deletion packages/i18n/src/locales/en.i18n.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@
"__roomName__encryption_keys_need_to_be_updated": "{{roomName}} encryption keys need to be updated to give you access. Another room member needs to be online for this to happen.",
"removed__username__as__role_": "removed {{username}} as {{role}}",
"set__username__as__role_": "set {{username}} as {{role}}",
"sequential_message": "sequential message",
"This_room_encryption_has_been_enabled_by__username_": "This room's encryption has been enabled by {{username}}",
"This_room_encryption_has_been_disabled_by__username_": "This room's encryption has been disabled by {{username}}",
"Third_party_login": "Third-party login",
Expand Down
1 change: 0 additions & 1 deletion packages/i18n/src/locales/pl.i18n.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@
"__roomName__encryption_keys_need_to_be_updated": "{{roomName}} klucze szyfrowania muszą zostać zaktualizowane, aby umożliwić dostęp. Aby tak się stało, inny członek pokoju musi być online.",
"removed__username__as__role_": "usunięto {{username}} jako {{role}}",
"set__username__as__role_": "ustaw {{username}} jako {{role}}",
"sequential_message": "komunikat sekwencyjny",
"This_room_encryption_has_been_enabled_by__username_": "Użytkownik {{username}} włączył szyfrowanie w tym pokoju",
"This_room_encryption_has_been_disabled_by__username_": "Użytkownik {{username}} wyłączył szyfrowanie w tym pokoju",
"Third_party_login": "Logowanie przez stronę trzecią",
Expand Down
1 change: 0 additions & 1 deletion packages/i18n/src/locales/se.i18n.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@
"__roomName__encryption_keys_need_to_be_updated": "{{roomName}} encryption keys need to be updated to give you access. Another room member needs to be online for this to happen.",
"removed__username__as__role_": "removed {{username}} as {{role}}",
"set__username__as__role_": "set {{username}} as {{role}}",
"sequential_message": "sequential message",
"This_room_encryption_has_been_enabled_by__username_": "This room's encryption has been enabled by {{username}}",
"This_room_encryption_has_been_disabled_by__username_": "This room's encryption has been disabled by {{username}}",
"Third_party_login": "Third-party login",
Expand Down

0 comments on commit 6369528

Please sign in to comment.