Skip to content

Commit

Permalink
Fix tests which broken by saving by reload
Browse files Browse the repository at this point in the history
RISDEV-2530
  • Loading branch information
rvp-c committed Nov 20, 2023
1 parent a10ddd4 commit 564e120
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 34 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -113,14 +113,15 @@ test.describe("active citations", () => {
activeCitationContainer.getByLabel("Listen Eintrag"),
).toHaveCount(1)

await page.getByLabel("Weitere Angabe").click()
await page.getByLabel("Aktenzeichen der Aktivzitierung").fill("two")
await page.getByLabel("Aktivzitierung speichern").click()
// "Aktivzitierung speichern" only saves state in frontend, no communication to backend yet
await page.reload()
await expect(
activeCitationContainer.getByLabel("Listen Eintrag"),
).toHaveCount(1)
// Change with commit reload by saving
// await page.getByLabel("Weitere Angabe").click()
// await page.getByLabel("Aktenzeichen der Aktivzitierung").fill("two")
// await page.getByLabel("Aktivzitierung speichern").click()
// // "Aktivzitierung speichern" only saves state in frontend, no communication to backend yet
// await page.reload()
// await expect(
// activeCitationContainer.getByLabel("Listen Eintrag"),
// ).toHaveCount(1)

await page.getByLabel("Weitere Angabe").click()
await waitForSaving(
Expand Down
27 changes: 14 additions & 13 deletions frontend/test/e2e/caselaw/categories/ensuing-decisions.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -187,19 +187,20 @@ test.describe("ensuing decisions", () => {
ensuingDecisionContainer.getByLabel("Listen Eintrag"),
).toHaveCount(1, { timeout: 10000 }) // reloading can be slow if too many parallel tests

await page.getByLabel("Weitere Angabe").click()
await page.getByLabel("Aktenzeichen Nachgehende Entscheidung").fill("two")
await page.getByLabel("Nachgehende Entscheidung speichern").click()
await expect(
page.getByText(`nachgehend, two`, {
exact: true,
}),
).toBeVisible()
// "Nachgehende Entscheidung speichern" only saves state in frontend, no communication to backend yet
await page.reload()
await expect(
ensuingDecisionContainer.getByLabel("Listen Eintrag"),
).toHaveCount(1, { timeout: 10000 }) // reloading can be slow if too many parallel tests
// Change with commit reload by saving
// await page.getByLabel("Weitere Angabe").click()
// await page.getByLabel("Aktenzeichen Nachgehende Entscheidung").fill("two")
// await page.getByLabel("Nachgehende Entscheidung speichern").click()
// await expect(
// page.getByText(`nachgehend, two`, {
// exact: true,
// }),
// ).toBeVisible()
// // "Nachgehende Entscheidung speichern" only saves state in frontend, no communication to backend yet
// await page.reload()
// await expect(
// ensuingDecisionContainer.getByLabel("Listen Eintrag"),
// ).toHaveCount(1, { timeout: 10000 }) // reloading can be slow if too many parallel tests

await page.getByLabel("Weitere Angabe").click()
await waitForSaving(
Expand Down
27 changes: 14 additions & 13 deletions frontend/test/e2e/caselaw/categories/previous-decisions.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -122,19 +122,20 @@ test.describe("previous decisions", () => {
previousDecisionContainer.getByLabel("Listen Eintrag"),
).toHaveCount(1, { timeout: 10000 }) // reloading can be slow if too many parallel tests

await page.getByLabel("Weitere Angabe").click()
await page.getByLabel("Aktenzeichen Vorgehende Entscheidung").fill("two")
await page.getByLabel("Vorgehende Entscheidung speichern").click()
await expect(
page.getByText(`two`, {
exact: true,
}),
).toBeVisible()
// "Vorgehende Entscheidung speichern" only saves state in frontend, no communication to backend yet
await page.reload()
await expect(
previousDecisionContainer.getByLabel("Listen Eintrag"),
).toHaveCount(1, { timeout: 10000 }) // reloading can be slow if too many parallel tests
// Change with commit reload by saving
// await page.getByLabel("Weitere Angabe").click()
// await page.getByLabel("Aktenzeichen Vorgehende Entscheidung").fill("two")
// await page.getByLabel("Vorgehende Entscheidung speichern").click()
// await expect(
// page.getByText(`two`, {
// exact: true,
// }),
// ).toBeVisible()
// // "Vorgehende Entscheidung speichern" only saves state in frontend, no communication to backend yet
// await page.reload()
// await expect(
// previousDecisionContainer.getByLabel("Listen Eintrag"),
// ).toHaveCount(1, { timeout: 10000 }) // reloading can be slow if too many parallel tests

await page.getByLabel("Weitere Angabe").click()
await waitForSaving(
Expand Down

0 comments on commit 564e120

Please sign in to comment.