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

Commit 2a9c22a

Browse files
committed
Fix tests
1 parent 7ac5665 commit 2a9c22a

File tree

3 files changed

+7
-8
lines changed

3 files changed

+7
-8
lines changed

src/components/views/elements/AccessibleButton.tsx

-1
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,6 @@ const AccessibleButton = forwardRef(function <T extends keyof JSX.IntrinsicEleme
191191
[`mx_AccessibleButton_kind_${kind}`]: kind,
192192
mx_AccessibleButton_disabled: disabled,
193193
});
194-
195194
// React.createElement expects InputHTMLAttributes
196195
const button = React.createElement(element, newProps, children);
197196

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

+5-5
Original file line numberDiff line numberDiff line change
@@ -442,10 +442,10 @@ describe("<UserInfo />", () => {
442442
});
443443

444444
// there should now be a button with the non-dehydrated device ID
445-
expect(screen.getByRole("button", { description: "d1" })).toBeInTheDocument();
445+
expect(screen.getByRole("button", { name: "my device" })).toBeInTheDocument();
446446

447447
// but not for the dehydrated device ID
448-
expect(screen.queryByRole("button", { description: "d2" })).not.toBeInTheDocument();
448+
expect(screen.queryByRole("button", { name: "dehydrated device" })).not.toBeInTheDocument();
449449

450450
// there should be a line saying that the user has "Offline device" enabled
451451
expect(screen.getByText("Offline device enabled")).toBeInTheDocument();
@@ -528,7 +528,7 @@ describe("<UserInfo />", () => {
528528

529529
// the dehydrated device should be shown as an unverified device, which means
530530
// there should now be a button with the device id ...
531-
const deviceButton = screen.getByRole("button", { description: "d2" });
531+
const deviceButton = screen.getByRole("button", { name: "dehydrated device Not trusted" });
532532

533533
// ... which should contain the device name
534534
expect(within(deviceButton).getByText("dehydrated device")).toBeInTheDocument();
@@ -571,12 +571,12 @@ describe("<UserInfo />", () => {
571571

572572
// the dehydrated devices should be shown as an unverified device, which means
573573
// there should now be a button with the first dehydrated device id ...
574-
const device1Button = screen.getByRole("button", { description: "d1" });
574+
const device1Button = screen.getByRole("button", { name: "dehydrated device 1" });
575575

576576
// ... which should contain the device name
577577
expect(within(device1Button).getByText("dehydrated device 1")).toBeInTheDocument();
578578
// and a button with the second dehydrated device id ...
579-
const device2Button = screen.getByRole("button", { description: "d2" });
579+
const device2Button = screen.getByRole("button", { name: "dehydrated device 2" });
580580

581581
// ... which should contain the device name
582582
expect(within(device2Button).getByText("dehydrated device 2")).toBeInTheDocument();

test/components/views/spaces/__snapshots__/SpacePanel-test.tsx.snap

+2-2
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,9 @@ exports[`<SpacePanel /> should show all activated MetaSpaces in the correct orde
1414
aria-haspopup="true"
1515
aria-label="User menu"
1616
class="mx_AccessibleButton mx_UserMenu_contextMenuButton"
17+
data-state="closed"
1718
role="button"
1819
tabindex="0"
19-
title="User menu"
2020
>
2121
<div
2222
class="mx_UserMenu_userAvatar"
@@ -34,8 +34,8 @@ exports[`<SpacePanel /> should show all activated MetaSpaces in the correct orde
3434
</div>
3535
</div>
3636
<div
37-
aria-label="Expand"
3837
class="mx_AccessibleButton mx_SpacePanel_toggleCollapse"
38+
data-state="closed"
3939
role="button"
4040
tabindex="0"
4141
/>

0 commit comments

Comments
 (0)