Skip to content

Commit

Permalink
test: add playwright eslint config [skip ci]
Browse files Browse the repository at this point in the history
  • Loading branch information
stefanprobst committed Mar 13, 2024
1 parent baa06ab commit 6c4dc46
Show file tree
Hide file tree
Showing 4 changed files with 40 additions and 6 deletions.
13 changes: 7 additions & 6 deletions e2e/tests/app/i18n.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -85,12 +85,13 @@ test.describe("i18n", () => {
return elements.map((element) => element.outerHTML);
});

// TODO: use toMatchSnapshot
expect(links).toEqual([
`<link id="i18n-alt-de" rel="alternate" href="${createAbsoluteUrl(`/de${pathname}`)}" hreflang="de">`,
`<link id="i18n-alt-en" rel="alternate" href="${createAbsoluteUrl(`/en${pathname}`)}" hreflang="en">`,
`<link id="i18n-xd" rel="alternate" href="${createAbsoluteUrl(`/en${pathname}`)}" hreflang="x-default">`,
]);
expect(links).toEqual(
expect.arrayContaining([
`<link id="i18n-alt-de" rel="alternate" href="${createAbsoluteUrl(`/de${pathname}`)}" hreflang="de">`,
`<link id="i18n-alt-en" rel="alternate" href="${createAbsoluteUrl(`/en${pathname}`)}" hreflang="en">`,
`<link id="i18n-xd" rel="alternate" href="${createAbsoluteUrl(`/en${pathname}`)}" hreflang="x-default">`,
]),
);
}
}
});
Expand Down
2 changes: 2 additions & 0 deletions e2e/tests/app/metadata.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@ test.describe("should add json+ld metadata", () => {
await page.goto("/en");

const metadata = await page.locator('script[type="application/ld+json"]').textContent();
// eslint-disable-next-line playwright/prefer-web-first-assertions
expect(metadata).toBe(
JSON.stringify({
"@context": "https://schema.org",
Expand All @@ -117,6 +118,7 @@ test.describe("should add json+ld metadata", () => {
await page.goto("/de");

const metadata = await page.locator('script[type="application/ld+json"]').textContent();
// eslint-disable-next-line playwright/prefer-web-first-assertions
expect(metadata).toBe(
JSON.stringify({
"@context": "https://schema.org",
Expand Down
2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@
"devDependencies": {
"@acdh-oeaw/eslint-config": "^1.0.6",
"@acdh-oeaw/eslint-config-nuxt": "^1.0.12",
"@acdh-oeaw/eslint-config-playwright": "^1.0.7",
"@acdh-oeaw/eslint-config-vue": "^1.0.11",
"@acdh-oeaw/prettier-config": "^2.0.0",
"@acdh-oeaw/stylelint-config": "^2.0.1",
Expand Down Expand Up @@ -103,6 +104,7 @@
"@acdh-oeaw/eslint-config/strict",
"@acdh-oeaw/eslint-config-vue",
"@acdh-oeaw/eslint-config-nuxt",
"@acdh-oeaw/eslint-config-playwright",
"plugin:eslint-plugin-tailwindcss/recommended"
]
},
Expand Down
29 changes: 29 additions & 0 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 6c4dc46

Please sign in to comment.