Default the room header to on (#12803)

* Default the room header to on

* Refactor code into helper method

Add a method to open/close the room info panel and use it everywhere.

* Fix broken tests, update snapshots and screenshots

* Update room header tests to make sense with the new header
This commit is contained in:
R Midhun Suresh 2024-07-23 16:26:25 +05:30 committed by GitHub
parent 25fcd6a65f
commit bb1b7f1fd0
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
59 changed files with 595 additions and 397 deletions

View file

@ -402,7 +402,7 @@ class Helpers {
* Close the threads panel.
*/
async closeThreadsPanel() {
await this.page.locator(".mx_LegacyRoomHeader").getByLabel("Threads").click();
await this.page.locator(".mx_RoomHeader").getByLabel("Threads").click();
await expect(this.page.locator(".mx_RightPanel")).not.toBeVisible();
}
@ -410,7 +410,7 @@ class Helpers {
* Return to the list of threads, given we are viewing a single thread.
*/
async backToThreadsList() {
await this.page.locator(".mx_LegacyRoomHeader").getByLabel("Threads").click();
await this.page.locator(".mx_RoomHeader").getByLabel("Threads").click();
}
/**
@ -530,12 +530,11 @@ class Helpers {
// whether it's open or not - wait here to give it a chance to settle.
await this.page.waitForTimeout(200);
const ariaCurrent = await this.page.getByTestId("threadsButton").getAttribute("aria-current");
if (ariaCurrent !== "true") {
await this.page.getByTestId("threadsButton").click();
}
const threadPanel = this.page.locator(".mx_ThreadPanel");
const isThreadPanelOpen = (await threadPanel.count()) !== 0;
if (!isThreadPanelOpen) {
await this.page.locator(".mx_RoomHeader").getByLabel("Threads").click();
}
await expect(threadPanel).toBeVisible();
await threadPanel.evaluate(($panel) => {
const $button = $panel.querySelector<HTMLElement>('[data-testid="base-card-back-button"]');