Files
privacy.sexy/tests/e2e/no-unintended-overflow.cy.ts
undergroundwires e541a35e86 Fix mobile layout overflow caused by tooltips
This commit fixes an issue where tooltips create unwanted horizontal
overflow on mobile devices.

An overlay has been added to contain the tooltip within the viewport,
ensuring it doesn't disrupt the page layout.

The changes include adjustments to CSS visibility and pointer event
handling for the tooltip container and its children.

Changes:

- Introduce an overlay that spans the entire viewport for the tooltip
  container.
- Add CSS rules to ensure the tooltip and its children maintain correct
  pointer events and overflow behavior.
- Add a Cypress end-to-end test that verifies the absence of the
  unintended horizontal overflow on small screens.
- Uploads videos/screenshots as artifacts during CI/CD to provide easier
  troubleshooting. This change is supported by creating
  `cypress-dirs.json` to be able to share directory information with
  CI/CD runners and cypress configuration file.
2023-11-14 13:46:53 +01:00

24 lines
1.1 KiB
TypeScript

describe('has no unintended overflow', () => {
it('fits the content without horizontal scroll', () => {
// arrange
cy.viewport(375, 667); // iPhone SE
// act
cy.visit('/');
// assert
cy.window().then((win) => {
expect(win.document.documentElement.scrollWidth, [
`Window inner dimensions: ${win.innerWidth}x${win.innerHeight}`,
`Window outer dimensions: ${win.outerWidth}x${win.outerHeight}`,
`Body scrollWidth: ${win.document.body.scrollWidth}`,
`Body clientWidth: ${win.document.body.clientWidth}`,
`Body offsetWidth: ${win.document.body.offsetWidth}`,
`DocumentElement clientWidth: ${win.document.documentElement.clientWidth}`,
`DocumentElement offsetWidth: ${win.document.documentElement.offsetWidth}`,
`Meta viewport content: ${win.document.querySelector('meta[name="viewport"]')?.getAttribute('content')}`,
`Device Pixel Ratio: ${win.devicePixelRatio}`,
`Cypress Viewport: ${Cypress.config('viewportWidth')}x${Cypress.config('viewportHeight')}`,
].join('\n')).to.be.lte(win.innerWidth);
});
});
});