Skip to content

Commit

Permalink
test: adjust sidebar and e2e-encryption tests
Browse files Browse the repository at this point in the history
  • Loading branch information
juliajforesti committed Dec 10, 2024
1 parent d171b02 commit d4fb380
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 4 deletions.
8 changes: 5 additions & 3 deletions apps/meteor/tests/e2e/e2e-encryption.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -710,7 +710,7 @@ test.describe.serial('e2e-encryption', () => {
});
});

test('expect create a private channel, send unecrypted messages, encrypt the channel and delete the last message and check the last message in the sidebar', async ({
test.only('expect create a private channel, send unecrypted messages, encrypt the channel and delete the last message and check the last message in the sidebar', async ({
page,
}) => {
const channelName = faker.string.uuid();
Expand Down Expand Up @@ -754,7 +754,7 @@ test.describe.serial('e2e-encryption', () => {
// Check last message in the sidebar
const sidebarChannel = poHomeChannel.sidebar.getSidebarItemByName(channelName);
await expect(sidebarChannel).toBeVisible();
await expect(sidebarChannel.locator('span')).toContainText(encriptedMessage1);
await expect(sidebarChannel.filter({ hasText: encriptedMessage1 })).toBeVisible();
});

test('expect create a private encrypted channel and pin/star an encrypted message', async ({ page }) => {
Expand Down Expand Up @@ -1007,7 +1007,9 @@ test.describe.serial('e2ee room setup', () => {
await injectInitialData();
await restoreState(page, Users.admin);

await poHomeChannel.sidebar.openChat(channelName);
await poHomeChannel.sidebar.typeSearch(channelName);
await poHomeChannel.sidebar.getSearchRoomByName(channelName).click();
await poHomeChannel.content.waitForPageLoad();

await page.locator('role=button[name="Save E2EE password"]').click();
await page.locator('#modal-root >> button:has-text("I saved my password")').click();
Expand Down
5 changes: 5 additions & 0 deletions apps/meteor/tests/e2e/page-objects/fragments/home-content.ts
Original file line number Diff line number Diff line change
Expand Up @@ -410,4 +410,9 @@ export class HomeContent {

await expect(this.page.getByRole('main').getByRole('list', { name: 'Message list' })).not.toHaveAttribute('aria-busy', 'true');
}

async waitForPageLoad(): Promise<void> {
await this.page.waitForSelector('main');
await this.page.waitForSelector('main >> role=heading');
}
}
2 changes: 1 addition & 1 deletion apps/meteor/tests/e2e/sidebar.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@ test.describe.serial('sidebar', () => {
});

test('should navigate on sidebar toolbar using arrow keys', async ({ page }) => {
await poHomeDiscussion.content.waitForPageLoad();
await poHomeDiscussion.navbar.homeButton.focus();
await page.keyboard.press('ArrowRight');

await expect(poHomeDiscussion.navbar.directoryButton).toBeFocused();
});

Expand Down

0 comments on commit d4fb380

Please sign in to comment.