From 38159d8cf1e2ce1d2693f8438b8053edc7551589 Mon Sep 17 00:00:00 2001 From: Chris Chudzicki Date: Fri, 9 Aug 2024 20:52:52 -0400 Subject: [PATCH] fix two tests --- .../src/components/ChannelAvatar/ChannelAvatar.test.tsx | 4 ++-- .../src/components/SimpleMenu/SimpleMenu.test.tsx | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/frontends/mit-open/src/components/ChannelAvatar/ChannelAvatar.test.tsx b/frontends/mit-open/src/components/ChannelAvatar/ChannelAvatar.test.tsx index eb8cbeadac..2d11709a1b 100644 --- a/frontends/mit-open/src/components/ChannelAvatar/ChannelAvatar.test.tsx +++ b/frontends/mit-open/src/components/ChannelAvatar/ChannelAvatar.test.tsx @@ -12,14 +12,14 @@ describe("Avatar", () => { wrapper: ThemeProvider, }) const img = screen.getByRole("img") - expect(img.getAttribute("alt")).toBe(null) // should be empty unless meaningful + expect(img.getAttribute("alt")).toBe("") // should be empty unless meaningful expect(img.getAttribute("src")).toEqual(channel.avatar_small) }) it("Displays a medium avatar image by default", async () => { const channel = factory.channel() render(, { wrapper: ThemeProvider }) const img = screen.getByRole("img") - expect(img.getAttribute("alt")).toBe(null) // should be empty unless meaningful + expect(img.getAttribute("alt")).toBe("") // should be empty unless meaningful expect(img.getAttribute("src")).toEqual(channel.avatar_medium) }) it("Displays initials if no avatar image exists", async () => { diff --git a/frontends/ol-components/src/components/SimpleMenu/SimpleMenu.test.tsx b/frontends/ol-components/src/components/SimpleMenu/SimpleMenu.test.tsx index ac1caab5b5..9d7446ded2 100644 --- a/frontends/ol-components/src/components/SimpleMenu/SimpleMenu.test.tsx +++ b/frontends/ol-components/src/components/SimpleMenu/SimpleMenu.test.tsx @@ -147,7 +147,7 @@ describe("SimpleMenu", () => { wrapper: ThemeProvider, }) await user.click(screen.getByRole("button", { name: "Open Menu" })) - const item2 = screen.getByRole("menuitem", { name: "Item 2" }) + const item2 = screen.getByRole("link", { name: "Item 2" }) expect(item2.dataset.reactComponent).toBe("custom-link") expect((item2 as HTMLAnchorElement).href).toBe(`${window.origin}/woof`) })