Add more test for `ReactionsRowButton.tsx`

pull/28217/head
Florian Duros 2024-05-22 16:24:09 +02:00
parent 8f07672da1
commit d9f718e589
No known key found for this signature in database
GPG Key ID: A5BBB4041B493F15
2 changed files with 35 additions and 0 deletions

View File

@ -116,4 +116,18 @@ describe("ReactionsRowButton", () => {
expect(root.asFragment()).toMatchSnapshot();
});
it("renders without a room", () => {
mockClient.getRoom.mockImplementation(() => null);
const props = createProps({});
const root = render(
<MatrixClientContext.Provider value={mockClient}>
<ReactionsRowButton {...props} />
</MatrixClientContext.Provider>,
);
expect(root.asFragment()).toMatchSnapshot();
});
});

View File

@ -97,3 +97,24 @@ exports[`ReactionsRowButton renders reaction row button emojis correctly 2`] = `
</div>
</DocumentFragment>
`;
exports[`ReactionsRowButton renders without a room 1`] = `
<DocumentFragment>
<div
class="mx_AccessibleButton mx_ReactionsRowButton"
role="button"
tabindex="0"
>
<span
aria-hidden="true"
class="mx_ReactionsRowButton_content"
/>
<span
aria-hidden="true"
class="mx_ReactionsRowButton_count"
>
2
</span>
</div>
</DocumentFragment>
`;