ci: verify isolated Docker news journeys before merging to main
This commit is contained in:
1 parent
043c763484
commit
33a760ab6b
6 files changed
+274
-7
No files matched your search
@@ -59,6 +59,9 @@ test("staff signs in, saves a draft, previews it and publishes to anonymous read
|
||||
const rows = async (sql: string, params: string[] = []) =>
|
||||
(await database.query<RowDataPacket[]>(sql, params))[0];
|
||||
const title = "Notizia browser: città e novità 🎉";
|
||||
const publicTitle = reader.locator(
|
||||
".content-card:has(.article-body) .content-card-title",
|
||||
);
|
||||
const slug = "browser-news-real";
|
||||
const summary =
|
||||
"Una notizia creata e pubblicata attraverso il pannello reale.";
|
||||
@@ -160,9 +163,7 @@ test("staff signs in, saves a draft, previews it and publishes to anonymous read
|
||||
expect(response?.status()).toBeLessThan(500);
|
||||
// Next can stream not-found markup with HTTP 200; assert the actual 404 screen.
|
||||
await expect(reader.locator(".error-screen-code")).toHaveText("404");
|
||||
await expect(
|
||||
reader.getByRole("heading", { name: title, exact: true }),
|
||||
).toHaveCount(0);
|
||||
await expect(publicTitle).toHaveCount(0);
|
||||
const listing = await anonymous.request
|
||||
.get("/api/articles")
|
||||
.then((response) => response.json());
|
||||
@@ -257,9 +258,8 @@ test("staff signs in, saves a draft, previews it and publishes to anonymous read
|
||||
await test.step("anonymous pages and API read the newly published content", async () => {
|
||||
const response = await reader.reload();
|
||||
expect(response?.status()).toBe(200);
|
||||
await expect(
|
||||
reader.getByRole("heading", { name: title, exact: true }),
|
||||
).toBeVisible();
|
||||
await expect(publicTitle).toHaveText(title);
|
||||
await expect(publicTitle).toBeVisible();
|
||||
await expect(reader.locator(".article-body")).toContainText(body);
|
||||
await expect(reader.locator(".error-screen-code")).toHaveCount(0);
|
||||
const listing = await anonymous.request
|
||||
|
||||
Reference in new issue
Block a user