Add a snapshot for RoomHeaderButtons (#10807)

This commit is contained in:
Suguru Hirahara 2023-05-12 19:49:07 +00:00 committed by GitHub
parent 87e2274ae7
commit 70b67fca77
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 40 additions and 0 deletions

View file

@ -54,6 +54,11 @@ describe("RoomHeaderButtons-test.tsx", function () {
return container.querySelector(".mx_RightPanel_threadsButton .mx_Indicator")!.className.includes(type);
}
it("should render", () => {
const { asFragment } = getComponent(room);
expect(asFragment()).toMatchSnapshot();
});
it("shows the thread button", () => {
const { container } = getComponent(room);
expect(getThreadButton(container)).not.toBeNull();

View file

@ -0,0 +1,35 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`RoomHeaderButtons-test.tsx should render 1`] = `
<DocumentFragment>
<div
aria-current="false"
aria-label="Chat"
class="mx_AccessibleButton mx_RightPanel_headerButton mx_RightPanel_timelineCardButton"
role="button"
tabindex="0"
/>
<div
aria-current="false"
aria-label="Threads"
class="mx_AccessibleButton mx_RightPanel_headerButton mx_RightPanel_threadsButton"
data-testid="threadsButton"
role="button"
tabindex="0"
/>
<div
aria-current="false"
aria-label="Notifications"
class="mx_AccessibleButton mx_RightPanel_headerButton mx_RightPanel_notifsButton"
role="button"
tabindex="0"
/>
<div
aria-current="false"
aria-label="Room info"
class="mx_AccessibleButton mx_RightPanel_headerButton mx_RightPanel_roomSummaryButton"
role="button"
tabindex="0"
/>
</DocumentFragment>
`;