Skip to content

Commit

Permalink
test(sbb-teaser-hero): fix visual spec
Browse files Browse the repository at this point in the history
  • Loading branch information
TomMenga committed Dec 13, 2024
1 parent 32af28e commit f2dd234
Showing 1 changed file with 12 additions and 14 deletions.
26 changes: 12 additions & 14 deletions src/elements/teaser-hero/teaser-hero.visual.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ describe(`sbb-teaser-hero`, () => {
for (const state of [visualDiffDefault, visualDiffHover, visualDiffFocus]) {
for (const testCase of imgTestCases) {
it(
testCase.title,
`${testCase.title} ${state.name}`,
visualDiffDefault.with(async (setup) => {
await setup.withFixture(html`
<sbb-teaser-hero href="#" link-content="Find out more">
Expand Down Expand Up @@ -79,20 +79,18 @@ describe(`sbb-teaser-hero`, () => {

describeViewports({ viewports: ['large'] }, () => {
for (const testCase of imgTestCases) {
describe(testCase.title, () => {
it(
`custom width`,
visualDiffDefault.with(async (setup) => {
await setup.withFixture(html`
<sbb-teaser-hero href="#" style="width: 700px">
${testCase.imgTemplate()}
</sbb-teaser-hero>
`);
it(
`custom width ${testCase.title}`,
visualDiffDefault.with(async (setup) => {
await setup.withFixture(html`
<sbb-teaser-hero href="#" link-content="Find out more" style="width: 700px">
Break out and explore castles and palaces. ${testCase.imgTemplate()}
</sbb-teaser-hero>
`);

await waitForImageReady(setup.snapshotElement.querySelector(testCase.imgSelector)!);
}),
);
});
await waitForImageReady(setup.snapshotElement.querySelector(testCase.imgSelector)!);
}),
);
}
});
});

0 comments on commit f2dd234

Please sign in to comment.