Skip to content
This repository was archived by the owner on Sep 11, 2024. It is now read-only.

Commit 2e30258

Browse files
committed
Update tests
Signed-off-by: Michael Telatynski <[email protected]>
1 parent 00e2a69 commit 2e30258

File tree

16 files changed

+96
-93
lines changed

16 files changed

+96
-93
lines changed

playwright/e2e/integration-manager/utils.ts

+2-4
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,6 @@ import type { Page } from "@playwright/test";
1818

1919
export async function openIntegrationManager(page: Page) {
2020
await page.getByRole("button", { name: "Room info" }).click();
21-
await page
22-
.locator(".mx_RoomSummaryCard_appsGroup")
23-
.getByRole("button", { name: "Add widgets, bridges & bots" })
24-
.click();
21+
await page.getByRole("tab", { name: "Extensions" }).click();
22+
await page.getByRole("button", { name: "Add extensions" }).click();
2523
}

playwright/e2e/polls/pollHistory.spec.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ test.describe("Poll history", () => {
6868

6969
async function openPollHistory(page: Page): Promise<void> {
7070
await page.getByRole("button", { name: "Room info" }).click();
71-
await page.locator(".mx_RoomSummaryCard").getByRole("menuitem", { name: "Poll history" }).click();
71+
await page.locator(".mx_RoomSummaryCard").getByRole("menuitem", { name: "Polls" }).click();
7272
}
7373

7474
test.use({

playwright/e2e/right-panel/right-panel.spec.ts

+2-1
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,8 @@ test.describe("RightPanel", () => {
7373
test("should handle clicking add widgets", async ({ page, app }) => {
7474
await viewRoomSummaryByName(page, app, ROOM_NAME);
7575

76-
await page.getByRole("button", { name: "Add widgets, bridges & bots" }).click();
76+
await page.getByRole("tab", { name: "Extensions" }).click();
77+
await page.getByRole("button", { name: "Add extensions" }).click();
7778
await expect(page.locator(".mx_IntegrationManager")).toBeVisible();
7879
});
7980

Loading
Loading
Loading
Loading

test/components/views/dialogs/RoomSettingsDialog-test.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,7 @@ describe("<RoomSettingsDialog />", () => {
183183
it("displays poll history when tab clicked", () => {
184184
const { container } = getComponent();
185185

186-
fireEvent.click(screen.getByText("Poll history"));
186+
fireEvent.click(screen.getByText("Polls"));
187187

188188
expect(container.querySelector(".mx_SettingsTab")).toMatchSnapshot();
189189
});

test/components/views/dialogs/__snapshots__/RoomSettingsDialog-test.tsx.snap

+2-2
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ NodeList [
8989
class="mx_TabbedView_tabLabel_text"
9090
id="mx_tabpanel_ROOM_POLL_HISTORY_TAB_label"
9191
>
92-
Poll history
92+
Polls
9393
</span>
9494
</li>,
9595
]
@@ -105,7 +105,7 @@ exports[`<RoomSettingsDialog /> poll history displays poll history when tab clic
105105
<h2
106106
class="mx_Heading_h2 mx_PollHistory_header"
107107
>
108-
Poll history
108+
Polls
109109
</h2>
110110
<div
111111
class="mx_PollHistoryList"

test/components/views/polls/pollHistory/PollHistory-test.tsx

+3-3
Original file line numberDiff line numberDiff line change
@@ -320,7 +320,7 @@ describe("<PollHistory />", () => {
320320

321321
fireEvent.click(getByText("Question?"));
322322

323-
expect(queryByText("Poll history")).not.toBeInTheDocument();
323+
expect(queryByText("Polls")).not.toBeInTheDocument();
324324
// elements from MPollBody
325325
expect(getByText("Question?")).toMatchSnapshot();
326326
expect(getByText("Socks")).toBeInTheDocument();
@@ -396,13 +396,13 @@ describe("<PollHistory />", () => {
396396
expect(getByText("Question?")).toBeInTheDocument();
397397

398398
// header not shown
399-
expect(queryByText("Poll history")).not.toBeInTheDocument();
399+
expect(queryByText("Polls")).not.toBeInTheDocument();
400400

401401
expect(getByText("Active polls")).toMatchSnapshot();
402402
fireEvent.click(getByText("Active polls"));
403403

404404
// main list header displayed again
405-
expect(getByText("Poll history")).toBeInTheDocument();
405+
expect(getByText("Polls")).toBeInTheDocument();
406406
// active filter still active
407407
expect(getByTestId("filter-tab-PollHistory_filter-ACTIVE").firstElementChild).toBeChecked();
408408
// list displayed

test/components/views/polls/pollHistory/__snapshots__/PollHistory-test.tsx.snap

+1-1
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ exports[`<PollHistory /> renders a list of active polls when there are polls in
3737
<h2
3838
class="mx_Heading_h2 mx_PollHistory_header"
3939
>
40-
Poll history
40+
Polls
4141
</h2>
4242
<div
4343
class="mx_PollHistoryList"

test/components/views/right_panel/RightPanelTabs-test.tsx

+2-2
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,8 @@ describe("<RightPanelTabs />", () => {
3838
const { container } = render(<RightPanelTabs phase={RightPanelPhases.RoomMemberList} />);
3939
expect(container).toMatchSnapshot();
4040
// Assert that the active tab is Info
41-
expect(container.querySelectorAll("[aria-selected='true'").length).toEqual(1);
42-
expect(container.querySelector("[aria-selected='true'")).toHaveAccessibleName("People");
41+
expect(container.querySelectorAll("[aria-selected='true']").length).toEqual(1);
42+
expect(container.querySelector("[aria-selected='true']")).toHaveAccessibleName("People");
4343
});
4444

4545
it("Renders nothing for some phases, eg: FilePanel", () => {

test/components/views/right_panel/RoomSummaryCard-test.tsx

+3-3
Original file line numberDiff line numberDiff line change
@@ -272,22 +272,22 @@ describe("<RoomSummaryCard />", () => {
272272
mocked(settingsHooks.useFeatureEnabled).mockImplementation((feature) => feature === "feature_pinning");
273273
const { getByText } = getComponent();
274274

275-
expect(getByText("Pinned")).toBeInTheDocument();
275+
expect(getByText("Pinned messages")).toBeInTheDocument();
276276
});
277277
});
278278

279279
describe("poll history", () => {
280280
it("renders poll history option", () => {
281281
const { getByText } = getComponent();
282282

283-
expect(getByText("Poll history")).toBeInTheDocument();
283+
expect(getByText("Polls")).toBeInTheDocument();
284284
});
285285

286286
it("opens poll history dialog on button click", () => {
287287
const permalinkCreator = new RoomPermalinkCreator(room);
288288
const { getByText } = getComponent({ permalinkCreator });
289289

290-
fireEvent.click(getByText("Poll history"));
290+
fireEvent.click(getByText("Polls"));
291291

292292
expect(Modal.createDialog).toHaveBeenCalledWith(PollHistoryDialog, {
293293
room,

test/components/views/right_panel/__snapshots__/RightPanelTabs-test.tsx.snap

+28
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,20 @@ exports[`<RightPanelTabs /> Component renders the correct tabs 1`] = `
5454
Threads
5555
</button>
5656
</li>
57+
<li
58+
class="_nav-tab_135dy_33"
59+
role="presentation"
60+
>
61+
<button
62+
aria-controls="thread-panel"
63+
aria-selected="false"
64+
class="_nav-item_135dy_55"
65+
id="extensions-panel-tab"
66+
role="tab"
67+
>
68+
Extensions
69+
</button>
70+
</li>
5771
</ul>
5872
</nav>
5973
</div>
@@ -113,6 +127,20 @@ exports[`<RightPanelTabs /> Correct tab is active 1`] = `
113127
Threads
114128
</button>
115129
</li>
130+
<li
131+
class="_nav-tab_135dy_33"
132+
role="presentation"
133+
>
134+
<button
135+
aria-controls="thread-panel"
136+
aria-selected="false"
137+
class="_nav-item_135dy_55"
138+
id="extensions-panel-tab"
139+
role="tab"
140+
>
141+
Extensions
142+
</button>
143+
</li>
116144
</ul>
117145
</nav>
118146
</div>

0 commit comments

Comments
 (0)