Skip to content

Commit

Permalink
feat(create-element): ssr tests
Browse files Browse the repository at this point in the history
  • Loading branch information
bennypowers committed May 20, 2024
1 parent fb017cf commit 67696da
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions tools/create-element/templates/element/test/element.e2e.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { test } from '@playwright/test';
import { PfeDemoPage } from '@patternfly/pfe-tools/test/playwright/PfeDemoPage.js';
import { SSRPage } from '@patternfly/pfe-tools/test/playwright/SSRPage.js';

const tagName = '<%= tagName %>';

Expand All @@ -9,4 +10,16 @@ test.describe(tagName, () => {
await componentPage.navigate();
await componentPage.snapshot();
});

test('ssr', async ({ browser }) => {
const fixture = new SSRPage({
tagName,
browser,
demoDir: new URL('../demo/', import.meta.url),
importSpecifiers: [
`@patternfly/elements/${tagName}/${tagName}.js`,
],
});
await fixture.snapshots();
});
});

0 comments on commit 67696da

Please sign in to comment.