Add more test for ReactionsRowButton.tsx
This commit is contained in:
parent
8f07672da1
commit
d9f718e589
2 changed files with 35 additions and 0 deletions
|
@ -116,4 +116,18 @@ describe("ReactionsRowButton", () => {
|
||||||
|
|
||||||
expect(root.asFragment()).toMatchSnapshot();
|
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();
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
|
|
@ -97,3 +97,24 @@ exports[`ReactionsRowButton renders reaction row button emojis correctly 2`] = `
|
||||||
</div>
|
</div>
|
||||||
</DocumentFragment>
|
</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>
|
||||||
|
`;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue