feat(web): add desktop parity shell — #203
This commit is contained in:
@ -8,7 +8,7 @@
|
||||
* desktop-only action.
|
||||
*/
|
||||
import { describe, it, expect } from "vitest";
|
||||
import { fireEvent, render, screen } from "@testing-library/react";
|
||||
import { fireEvent, render, screen, within } from "@testing-library/react";
|
||||
|
||||
import type { Gateways } from "@/ports";
|
||||
import { DIProvider } from "@/app/di";
|
||||
@ -51,6 +51,23 @@ function renderPairedWebApp(gateways: Gateways) {
|
||||
}
|
||||
|
||||
describe("WebWorkspace « Panneaux » menu (#90)", () => {
|
||||
it("renders the #203 desktop shell zones with persistent surface navigation", async () => {
|
||||
renderPairedWebApp(await seededGateways());
|
||||
|
||||
expect(await screen.findByTestId("web-desktop-shell")).toBeTruthy();
|
||||
expect(screen.getByTestId("web-shell-topbar")).toBeTruthy();
|
||||
expect(screen.getByTestId("web-shell-primary-rail")).toBeTruthy();
|
||||
expect(screen.getByTestId("web-shell-canvas")).toBeTruthy();
|
||||
expect(screen.getByTestId("web-shell-secondary-rail")).toBeTruthy();
|
||||
|
||||
fireEvent.click(await screen.findByText("Demo"));
|
||||
expect(await screen.findByText("Surface Travail")).toBeTruthy();
|
||||
|
||||
fireEvent.click(screen.getByRole("button", { name: "Surface Tickets" }));
|
||||
expect(await screen.findByText("Surface Tickets")).toBeTruthy();
|
||||
expect(screen.getByRole("button", { name: "Surface Travail" })).toBeTruthy();
|
||||
});
|
||||
|
||||
it("only enables Projets while no project is open, with a help note", async () => {
|
||||
renderPairedWebApp(await seededGateways());
|
||||
|
||||
@ -66,7 +83,9 @@ describe("WebWorkspace « Panneaux » menu (#90)", () => {
|
||||
|
||||
// A disabled entry does nothing.
|
||||
fireEvent.click(contextEntry);
|
||||
expect(screen.queryByText("Contexte projet")).toBeTruthy(); // sheet still open, menu entry still there
|
||||
expect(
|
||||
within(screen.getByRole("dialog", { name: "Panneaux" })).queryByText("Contexte projet"),
|
||||
).toBeTruthy(); // sheet still open, menu entry still there
|
||||
});
|
||||
|
||||
it("routes the main surface to the selected panel once a project is open", async () => {
|
||||
|
||||
Reference in New Issue
Block a user