| /** | |
| * E2E: Publish workflow. | |
| * | |
| * Validates: open publish dialog -> publish -> success feedback -> published HTML accessible. | |
| */ | |
| import { test, expect } from "./fixtures.js"; | |
| test.describe("Publish", () => { | |
| test("publish creates accessible HTML page", async ({ appPage, serverUrl }) => { | |
| // Wait for editor content to load | |
| await appPage.waitForSelector("[aria-label='Undo']", { timeout: 15_000 }); | |
| // Open publish dialog | |
| await appPage.click("[aria-label='Publish article']"); | |
| // Look for the publish button inside the dialog | |
| const publishDialog = appPage.locator("dialog"); | |
| const publishButton = publishDialog.getByRole("button", { name: /publish/i }); | |
| await publishButton.click(); | |
| // Wait for success (the dialog should update or close) | |
| await appPage.waitForSelector("text=Published", { timeout: 15_000 }); | |
| // Verify published HTML is accessible at /published/default/index.html | |
| const response = await appPage.request.get(`${serverUrl}/published/default/index.html`); | |
| expect(response.status()).toBe(200); | |
| const html = await response.text(); | |
| expect(html).toContain("<!DOCTYPE html"); | |
| expect(html).toContain("</html>"); | |
| }); | |
| }); | |