diff --git a/cypress/e2e/start-mobile-overflow.cy.js b/cypress/e2e/start-mobile-overflow.cy.js new file mode 100644 index 0000000..5cc51f6 --- /dev/null +++ b/cypress/e2e/start-mobile-overflow.cy.js @@ -0,0 +1,23 @@ +describe('start page fits narrow mobile viewports', () => { + for (const width of [320, 375, 390]) { + it(`keeps all page content reachable at ${width}px`, () => { + cy.viewport(width, 812) + cy.visit('/start') + + cy.document().then((doc) => { + const style = doc.createElement('style') + style.setAttribute('data-test-unmask', 'overflow') + style.innerHTML = + 'html, body { overflow-x: visible !important; width: auto !important; }' + doc.head.appendChild(style) + + const viewportWidth = doc.documentElement.clientWidth + + expect(doc.documentElement.scrollWidth).to.be.at.most( + viewportWidth + ) + expect(doc.body.scrollWidth).to.be.at.most(viewportWidth) + }) + }) + } +}) diff --git a/pages/start.js b/pages/start.js index 0261dce..4ba78c1 100644 --- a/pages/start.js +++ b/pages/start.js @@ -23,7 +23,7 @@ function Command({ command, event }) { } return ( -
+
{command} @@ -79,12 +79,12 @@ export default function StartPage() {

Command line

@@ -136,7 +136,7 @@ export default function StartPage() {

Native app ยท Beta