Skip to content

Commit

Permalink
fix(sidebar): ensure that component renders correctly at 400% zoom
Browse files Browse the repository at this point in the history
fixes #7035
  • Loading branch information
DipperTheDan committed Nov 6, 2024
1 parent be6d9f1 commit dc605f4
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/components/sidebar/sidebar.pw.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -430,6 +430,18 @@ test.describe("Accessibility tests for Sidebar component", () => {
});
});

test("check component has correctly styling when zoom is 400%", async ({
mount,
page,
}) => {
await mount(<Default />);

// 4.0 zoom is equal to 400%
await page.evaluate("document.body.style.zoom=4.0");

await assertCssValueIsApproximately(sidebarPreview(page), "max-width", 1366);
});

test.describe("Check background scroll when tabbing", () => {
// TODO: Skipped due to flaky focus behaviour. To review in FE-6428
test.skip("tabbing forward through the sidebar and back to the start should not make the background scroll to the bottom", async ({
Expand Down
1 change: 1 addition & 0 deletions src/components/sidebar/sidebar.style.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ const StyledSidebar = styled.div<StyledSidebarProps>`
flex-direction: column;
top: 0;
z-index: ${theme.zIndex.fullScreenModal};
max-width: 100vw;
${!width &&
size &&
Expand Down

0 comments on commit dc605f4

Please sign in to comment.