Files
site/apps/web/e2e/content/content-pages.spec.ts
T
vlad 86cc3fa541 Update admin theme/layout and refresh README details.
Align the project baseline with the latest admin interface styling and layout structure while documenting setup and usage updates in README.
2026-07-14 17:12:28 +03:00

26 lines
941 B
TypeScript

import { expect, test } from "@playwright/test";
import { API_URL, adminLogin } from "../helpers/api";
test.describe("§15.7 scenario 4: Admin content publish", () => {
test("admin creates content → publish → visible on /pages/:slug", async ({ page, request }) => {
const admin = await adminLogin(request);
const headers = { Authorization: `Bearer ${(await admin.json()).access_token}` };
const slug = `e2e-page-${Date.now()}`;
const created = await request.post(`${API_URL}/api/v1/content/pages`, {
headers,
data: {
slug,
title: "E2E Published Page",
body: "<p>Published by admin</p>",
status: "published"
}
});
expect(created.ok()).toBeTruthy();
await page.goto(`/pages/${slug}`);
await expect(page.getByRole("heading", { name: "E2E Published Page" })).toBeVisible();
await expect(page.getByText("Published by admin")).toBeVisible();
});
});