-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
- Loading branch information
There are no files selected for viewing
This file was deleted.
This file was deleted.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,6 +9,8 @@ | |
import { expect } from "@playwright/test"; | ||
import { test } from "../apiMock"; | ||
|
||
test.slow(); | ||
|
||
test.beforeEach(async ({ page }) => { | ||
await page.goto("/subject-matter/frontpage-article/new"); | ||
const el = page.getByTestId("slate-editor"); | ||
|
@@ -25,7 +27,7 @@ test("adds and removes grid", async ({ page }) => { | |
await page.getByTestId("slate-block-picker").click(); | ||
await expect(page.getByTestId("create-keyFigure")).toBeVisible(); | ||
await expect(page.getByTestId("create-image")).toBeVisible(); | ||
await expect(page.getByTestId("create-blogPost")).toBeVisible(); | ||
await expect(page.getByTestId("create-pitch")).toBeVisible(); | ||
await expect(page.getByTestId("slate-block-picker-menu").getByRole("button")).toHaveCount(6); | ||
await expect(page.getByTestId("remove-grid")).toBeVisible(); | ||
await page.getByTestId("remove-grid").click(); | ||
|
@@ -34,63 +36,68 @@ test("adds and removes grid", async ({ page }) => { | |
|
||
test("adds and removes keyfigure", async ({ page }) => { | ||
await page.getByTestId("create-keyFigure").click(); | ||
await expect(page.getByRole("button", { name: "Lagre", exact: true })).toBeDisabled(); | ||
const modal = page.locator('div[role="dialog"]'); | ||
await modal.locator("div[name='title']").fill("test"); | ||
await modal.locator("div[name='subtitle']").fill("test"); | ||
await page.getByTestId("select-image-from-list").first().click(); | ||
await page.getByTestId("use-image").click(); | ||
await expect(page.getByRole("button", { name: "Lagre", exact: true })).toBeEnabled(); | ||
await page.getByRole("button", { name: "Lagre", exact: true }).click(); | ||
const dialog = page.getByRole("dialog"); | ||
await expect(dialog.getByRole("button", { name: "Lagre", exact: true })).toBeDisabled(); | ||
await dialog.locator("div[name='title']").fill("test"); | ||
await dialog.locator("div[name='subtitle']").fill("test"); | ||
await dialog.getByTestId("select-image-from-list").first().dispatchEvent("click"); | ||
await dialog.getByTestId("use-image").dispatchEvent("click"); | ||
await expect(dialog.getByRole("button", { name: "Lagre", exact: true })).toBeEnabled(); | ||
await dialog.getByRole("button", { name: "Lagre", exact: true }).dispatchEvent("click"); | ||
await expect(page.getByTestId("slate-key-figure")).toBeVisible(); | ||
await page.getByTestId("remove-key-figure").click(); | ||
await expect(page.getByTestId("slate-key-figure")).toHaveCount(0); | ||
}); | ||
|
||
test("adds and removes blogpost", async ({ page }) => { | ||
await page.getByTestId("create-blogPost").click(); | ||
await expect(page.getByRole("button", { name: "Lagre", exact: true })).toBeDisabled(); | ||
const modal = page.locator('div[role="dialog"]'); | ||
await modal.locator("div[name='title']").fill("test"); | ||
await page.locator("input[name='author']").fill("test"); | ||
await page.locator("input[name='link']").fill("https://test.test"); | ||
await page.getByTestId("select-image-from-list").first().click(); | ||
await page.getByTestId("use-image").click(); | ||
await expect(page.getByRole("button", { name: "Lagre", exact: true })).toBeEnabled(); | ||
await page.getByRole("button", { name: "Lagre", exact: true }).click(); | ||
await expect(page.getByTestId("slate-blog-post")).toBeVisible(); | ||
await page.getByTestId("remove-blogpost").click(); | ||
await expect(page.getByTestId("slate-blog-post")).toHaveCount(0); | ||
test("adds and removes pitch", async ({ page }) => { | ||
await page.getByTestId("create-grid").click(); | ||
await expect(page.getByTestId("slate-grid-cell")).toHaveCount(2); | ||
await page.getByTestId("slate-grid-cell").first().click(); | ||
await page.getByTestId("slate-block-picker").click(); | ||
await page.getByTestId("create-pitch").click(); | ||
const dialog = page.getByRole("dialog"); | ||
await expect(dialog.getByRole("button", { name: "Lagre", exact: true })).toBeDisabled(); | ||
await dialog.locator("div[name='title']").fill("test"); | ||
await dialog.locator("div[name='description']").fill("test"); | ||
await dialog.locator("input[name='link']").fill("https://test.test"); | ||
await dialog.getByTestId("select-image-from-list").first().dispatchEvent("click"); | ||
await dialog.getByTestId("use-image").dispatchEvent("click"); | ||
await expect(dialog.getByRole("button", { name: "Lagre", exact: true })).toBeEnabled(); | ||
await dialog.getByRole("button", { name: "Lagre", exact: true }).dispatchEvent("click"); | ||
await expect(page.getByTestId("slate-pitch")).toBeVisible(); | ||
await page.getByTestId("remove-pitch").click(); | ||
await expect(page.getByTestId("slate-pitch")).toHaveCount(0); | ||
}); | ||
|
||
test("adds and removes contactblock", async ({ page }) => { | ||
await page.getByTestId("create-contactBlock").click(); | ||
await expect(page.getByRole("button", { name: "Lagre", exact: true })).toBeDisabled(); | ||
await page.locator("input[name='name']").fill("test"); | ||
await page.locator("input[name='jobTitle']").fill("test"); | ||
await page.locator("input[name='email']").fill("[email protected]"); | ||
await page.locator("textarea[name='description']").fill("email"); | ||
await page.getByTestId("select-image-from-list").first().click(); | ||
await page.getByTestId("use-image").click(); | ||
await expect(page.getByRole("button", { name: "Lagre", exact: true })).toBeEnabled(); | ||
await page.getByRole("button", { name: "Lagre", exact: true }).click(); | ||
const dialog = page.getByRole("dialog"); | ||
await expect(dialog.getByRole("button", { name: "Lagre", exact: true })).toBeDisabled(); | ||
await dialog.locator("input[name='name']").fill("test"); | ||
await dialog.locator("input[name='jobTitle']").fill("test"); | ||
await dialog.locator("input[name='email']").fill("[email protected]"); | ||
await dialog.locator("textarea[name='description']").fill("email"); | ||
await dialog.getByTestId("select-image-from-list").first().dispatchEvent("click"); | ||
await dialog.getByTestId("use-image").dispatchEvent("click"); | ||
await expect(dialog.getByRole("button", { name: "Lagre", exact: true })).toBeEnabled(); | ||
await dialog.getByRole("button", { name: "Lagre", exact: true }).dispatchEvent("click"); | ||
await expect(page.getByTestId("slate-contact-block")).toBeVisible(); | ||
await page.getByTestId("remove-contact-block").click(); | ||
await expect(page.getByTestId("slate-contact-block")).toHaveCount(0); | ||
}); | ||
|
||
test("adds and removes campaignblock", async ({ page }) => { | ||
await page.getByTestId("create-campaignBlock").click(); | ||
await expect(page.getByRole("button", { name: "Lagre", exact: true })).toBeDisabled(); | ||
const modal = page.locator('div[role="dialog"]'); | ||
await modal.locator("div[name='title']").fill("test"); | ||
await modal.locator("div[name='description']").fill("test"); | ||
await page.locator("input[name='link']").fill("https://test.test"); | ||
await modal.locator("div[name='linkText']").fill("Test page"); | ||
await page.getByTestId("select-image-from-list").first().click(); | ||
await page.getByTestId("use-image").click(); | ||
await expect(page.getByRole("button", { name: "Lagre", exact: true })).toBeEnabled(); | ||
await page.getByRole("button", { name: "Lagre", exact: true }).click(); | ||
const dialog = page.getByRole("dialog"); | ||
await expect(dialog.getByRole("button", { name: "Lagre", exact: true })).toBeDisabled(); | ||
await dialog.locator("div[name='title']").fill("test"); | ||
await dialog.locator("div[name='description']").fill("test"); | ||
await dialog.locator("input[name='link']").fill("https://test.test"); | ||
await dialog.locator("div[name='linkText']").fill("Test page"); | ||
await dialog.getByTestId("select-image-from-list").first().dispatchEvent("click"); | ||
await dialog.getByTestId("use-image").dispatchEvent("click"); | ||
await expect(dialog.getByRole("button", { name: "Lagre", exact: true })).toBeEnabled(); | ||
await dialog.getByRole("button", { name: "Lagre", exact: true }).dispatchEvent("click"); | ||
await expect(page.getByTestId("slate-campaign-block")).toBeVisible(); | ||
await page.getByTestId("remove-campaign-block").click(); | ||
await expect(page.getByTestId("slate-campaign-block")).toHaveCount(0); | ||
|