From 5826f73c39a6545c969c112273b340f7d1fb5b55 Mon Sep 17 00:00:00 2001 From: Florian Zia Date: Fri, 24 Jan 2025 13:12:02 +0100 Subject: [PATCH] fix: Unit test coverage --- src/app/(proper_react)/(redesign)/MobileShell.test.tsx | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/app/(proper_react)/(redesign)/MobileShell.test.tsx b/src/app/(proper_react)/(redesign)/MobileShell.test.tsx index 21a5bc7b8e1..56764f3f511 100644 --- a/src/app/(proper_react)/(redesign)/MobileShell.test.tsx +++ b/src/app/(proper_react)/(redesign)/MobileShell.test.tsx @@ -19,14 +19,18 @@ describe("MobileShell public", () => { expect(await axe(container)).toHaveNoViolations(); }); - it("shows the sign-in button", () => { + it("shows the sign-in buttons", () => { const ComposedMobileShell = composeStory(MobileShellPublic, Meta); render(); - const signInButton = screen.getByRole("button", { + // Depending on the viewport size we are showing a sign-in button in + // the top navbar or collapsable menu. + const signInButtons = screen.getAllByRole("button", { name: "Sign In", }); - expect(signInButton).toBeInTheDocument(); + expect(signInButtons.length).toBe(2); + expect(signInButtons[0]).toBeInTheDocument(); + expect(signInButtons[1]).toBeInTheDocument(); }); it("opens and closes the menu", async () => {