Skip to content

Commit

Permalink
fix two tests
Browse files Browse the repository at this point in the history
  • Loading branch information
ChristopherChudzicki committed Aug 10, 2024
1 parent 4eaa4e1 commit 38159d8
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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(<ChannelAvatar channel={channel} />, { 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 () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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`)
})
Expand Down

0 comments on commit 38159d8

Please sign in to comment.