Skip to content

Commit

Permalink
chore: add visual test file to boilerplate code
Browse files Browse the repository at this point in the history
  • Loading branch information
DavideMininni-Fincons committed Jul 8, 2024
1 parent a8b26ff commit c27e6b3
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions tools/generate-component/boilerplate/component.visual.spec.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
import { html } from 'lit';

import { describeViewports, visualDiffStandardStates } from '../core/testing/private.js';

import './__noPrefixName__.js';

describe('__name__', () => {
/**
* Add the `viewports` param to test only specific viewport;
* add the `viewportHeight` param to set a fixed height for the browser.
*/
describeViewports(() => {
// Add visual tests
for (const state of visualDiffStandardStates) {
it(
`${state.name}`,
state.with(async (setup) => {
await setup.withFixture(html`<__name__></__name__>`);
}),
);
}
});
});

0 comments on commit c27e6b3

Please sign in to comment.