// Mocks the API via cy.intercept — this job doesn't run a live backend (see // .github/workflows/ci.yml). // // Issue #107 — "Paramètres d'application" is packaged-app only now. Its // content (installed version + update check) is inert on the web, and the // one web-relevant control it carried (the "stay on web" redirect toggle) // moved to `/telecharger` (see download-page.cy.ts). Cypress always runs as // a plain web browser (`Capacitor.isNativePlatform()` is never true here), // so the page itself has no seam to reach — same untested-on-purpose // posture already accepted for `useAppUpdateCheck` / `UpdateBanner`. This // spec now only covers the web-side gating. const authenticatedProfile = { id: 1, firstName: "Alice", lastName: "Martin", email: "alice@example.com", tokenVersion: 0, houseId: null, dietId: null, }; describe("App settings — hidden on the web (#107)", () => { beforeEach(() => { cy.intercept("GET", "**/auth/me", { statusCode: 200, body: authenticatedProfile }); cy.intercept("GET", /\/planning\?/, { statusCode: 200, body: null }); }); it("is absent from the Paramètres menu", () => { cy.visit("/"); cy.contains("button", "Paramètres").click(); cy.contains("a", "Paramètres d'application").should("not.exist"); }); it("redirects /parametres/application to /parametres/compte instead of an orphaned page", () => { cy.visit("/parametres/application"); cy.url().should("include", "/parametres/compte"); cy.contains("h1", "Paramètres d'application").should("not.exist"); }); });