// Pure layout spec, no Cucumber — a single static page with no user // journey of its own (see layout.cy.ts's identical rationale for this // 3-way test split). No `cy.intercept("**/auth/me", ...)` needed: this // route renders outside RequireAuth entirely (see App.tsx's own doc // comment on why), so it never calls that endpoint. describe("DownloadPage — the mobile-app-redirect fallback", () => { it("renders the APK download link, a retry button, and a way back home", () => { cy.visit("/telecharger"); cy.contains("h1", "Installer l'application Android").should("be.visible"); // API_BASE_URL is empty locally (relative-URL, same-origin default — // see client.ts), so the real target collapses to this relative path. cy.contains("a", "Télécharger l'APK").should("have.attr", "href", "/mobile/download"); cy.contains("button", "Réessayer d'ouvrir l'application").should("be.visible"); cy.contains("a", "Retour à l'accueil").should("have.attr", "href", "/"); }); it("is reachable without being logged in — no bounce to /login", () => { cy.visit("/telecharger"); cy.url().should("include", "/telecharger"); }); // Issue #107 — the "toujours rester sur le site web" preference moved // here from "Paramètres d'application" (packaged-app only now). Written to // `localStorage` on the public web origin, which is where // `attemptOpenNativeApp` reads it. it("defaults 'stay on web' to unchecked, and persists a toggle across a reload", () => { cy.visit("/telecharger"); cy.contains("label", "Toujours rester sur le site web") .find('input[type="checkbox"]') .should("not.be.checked"); cy.contains("label", "Toujours rester sur le site web").click(); cy.contains("label", "Toujours rester sur le site web") .find('input[type="checkbox"]') .should("be.checked"); cy.window().then((win) => { expect(win.localStorage.getItem("batchcooking:stayOnWeb")).to.equal("true"); }); cy.reload(); cy.contains("label", "Toujours rester sur le site web") .find('input[type="checkbox"]') .should("be.checked"); }); });