Skip to content
This repository has been archived by the owner on Oct 22, 2024. It is now read-only.

Commit

Permalink
Improve coverage
Browse files Browse the repository at this point in the history
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
  • Loading branch information
t3chguy committed Oct 14, 2024
1 parent b3ea35b commit b286d8d
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
9 changes: 9 additions & 0 deletions test/components/views/rooms/EventTile-test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,15 @@ describe("EventTile", () => {
});
});

describe("EventTile renderingType: File", () => {
it("should not display the pinned message badge", async () => {
jest.spyOn(PinningUtils, "isPinned").mockReturnValue(true);
getComponent({}, TimelineRenderingType.File);

expect(screen.queryByText("Pinned message")).not.toBeInTheDocument();
});
});

describe("EventTile renderingType: default", () => {
it.each([[Layout.Group], [Layout.Bubble], [Layout.IRC]])(
"should display the pinned message badge",
Expand Down
7 changes: 5 additions & 2 deletions test/utils/FileUtils-test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,16 @@ describe("FileUtils", () => {
describe("downloadLabelForFile", () => {
it.each([
[
"File",
"File with size",
{
input: {
msgtype: "m.file",
body: "Test",
info: {
size: 102434566,
},
} as MediaEventContent,
output: "Download file",
output: "Download file (97.69 MB)",
},
],
[
Expand Down

0 comments on commit b286d8d

Please sign in to comment.