Skip to content

Commit

Permalink
chore(e2e): adds e2e tests for expression metadata
Browse files Browse the repository at this point in the history
- adds tags for tickets

RISDEV-6266
  • Loading branch information
hamo225 committed Feb 17, 2025
1 parent bd9f41d commit dc92731
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 11 deletions.
8 changes: 3 additions & 5 deletions frontend/e2e/expression-metadata-editor.spec.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { expect } from "@playwright/test"
import { test } from "@e2e/utils/test-with-auth"

test.describe("navigate to page", () => {
test.describe("navigate to page", { tag: ["@RISDEV-6266"] }, () => {
// Opening the page is tested in expression-metadata-editor-rahmen.spec.ts as that's
// the page that is effectively being opened. This file only tests behavior that is
// shared between all metadata editor pages.
Expand All @@ -17,15 +17,14 @@ test.describe("navigate to page", () => {
})
})

test.describe("table of contents", () => {
test("shows the elements affected by this amending law", async ({ page }) => {
test.describe("table of contents", { tag: ["@RISDEV-6266"] }, () => {
test("shows the elements affected by this expression", async ({ page }) => {
await page.goto(
"/eli/bund/bgbl-1/1002/1/1002-01-01/1/deu/regelungstext-1/metadata",
)

const nav = page.getByRole("complementary", { name: "Inhaltsverzeichnis" })

// Ensure the TOC is loaded before running checks
await expect(nav.getByRole("link")).not.toHaveCount(0)

const expectedLinks = [
Expand All @@ -42,7 +41,6 @@ test.describe("table of contents", () => {
"Übergangsregelungen und Geltungszeiten",
]

// Check that each expected link is visible individually
for (const linkText of expectedLinks) {
await expect(nav.getByRole("link", { name: linkText })).toBeVisible()
}
Expand Down
6 changes: 3 additions & 3 deletions frontend/e2e/expression-metadata-element.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ async function restoreInitialState(page: Page) {
)
}

test.describe("navigate to page", () => {
test.describe("navigate to page", { tag: ["@RISDEV-6266"] }, () => {
test("shows an error when an element page could not be loaded", async ({
page,
}) => {
Expand Down Expand Up @@ -67,7 +67,7 @@ test.describe("navigate to page", () => {
})
})

test.describe("preview", () => {
test.describe("preview", { tag: ["@RISDEV-6266"] }, () => {
test("displays the title and preview", async ({ page }) => {
// Given
await page.goto(
Expand Down Expand Up @@ -124,7 +124,7 @@ test.describe("preview", () => {
})
})

test.describe("metadata view", () => {
test.describe("metadata view", { tag: ["@RISDEV-6266"] }, () => {
let sharedPage: Page

async function saveMetadata() {
Expand Down
2 changes: 1 addition & 1 deletion frontend/e2e/expression-metadata-outline-element.spec.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { test } from "@e2e/utils/test-with-auth"
import { expect } from "@playwright/test"

test.describe("navigate to page", () => {
test.describe("navigate to page", { tag: ["@RISDEV-6266"] }, () => {
test("display the preview when an outline element is selected", async ({
page,
}) => {
Expand Down
4 changes: 2 additions & 2 deletions frontend/e2e/expression-metadata-rahmen.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { test } from "@e2e/utils/test-with-auth"
import { MetadataEditorRahmenPage } from "@e2e/pages/MetadataEditorRahmenPage"
import { uploadAmendingLaw } from "@e2e/utils/upload-with-force"

test.describe("preview", () => {
test.describe("preview", { tag: ["@RISDEV-6266"] }, () => {
test("displays the title and preview", async ({ page }) => {
// Given
await page.goto(
Expand Down Expand Up @@ -63,7 +63,7 @@ test.describe("preview", () => {
})
})

test.describe("metadata view", () => {
test.describe("metadata view", { tag: ["@RISDEV-6266"] }, () => {
test.afterAll(async ({ request }) => {
await uploadAmendingLaw(request, "bgbl-1_2023_413/aenderungsgesetz.xml")
})
Expand Down

0 comments on commit dc92731

Please sign in to comment.