-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Optimize I e2e tests + bug fix subtitle
RISDEV-0000
- Loading branch information
1 parent
050859c
commit 50f6057
Showing
6 changed files
with
44 additions
and
32 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
25 changes: 25 additions & 0 deletions
25
frontend/e2e/redirect-to-amending-laws-page-and-test-content.spec.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
import { test, expect } from "@playwright/test" | ||
import { amendingLaws, getExpectedHeading } from "@e2e/testData/testData" | ||
|
||
for (const amendingLaw of amendingLaws) { | ||
test(`redirect to amending laws page and test content for ${amendingLaw.eli}`, async ({ | ||
page, | ||
}) => { | ||
await page.goto("/") | ||
await expect(page).toHaveURL("/amending-laws") | ||
|
||
await expect(page.getByText(getExpectedHeading(amendingLaw))).toBeVisible() | ||
await expect( | ||
page.getByText(convertToGermanDate(amendingLaw.publicationDate)), | ||
).toBeVisible() | ||
}) | ||
} | ||
|
||
function convertToGermanDate(isoDate: string): string { | ||
const options: Intl.DateTimeFormatOptions = { | ||
day: "2-digit", | ||
month: "2-digit", | ||
year: "numeric", | ||
} | ||
return new Date(isoDate).toLocaleDateString("de-DE", options) | ||
} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters