Skip to content

Commit

Permalink
test(sbb-teaser): improve test stability (#3303)
Browse files Browse the repository at this point in the history
  • Loading branch information
TomMenga authored Dec 17, 2024
1 parent 275c89b commit b6b4c22
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/elements/teaser/teaser.visual.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -142,15 +142,15 @@ describe(`sbb-teaser`, () => {
<div style="display:grid; gap: 2rem; grid-template-columns: repeat(2, 1fr);">
${repeat(
new Array(count),
(_, i) => html`
(_) => html`
<sbb-teaser
title-content="This is a title"
href="#"
alignment="below"
style="--sbb-teaser-align-items: stretch;"
>
<figure slot="image" class="sbb-figure" style="width: 100%">
<sbb-image image-src=${imageUrl} id=${`img${i}`}></sbb-image>
<sbb-image image-src=${imageUrl}></sbb-image>
<sbb-chip-label class="sbb-figure-overlap-start-start">
AI chip
</sbb-chip-label>
Expand All @@ -164,8 +164,8 @@ describe(`sbb-teaser`, () => {
`);

await Promise.all(
new Array(count).map((_, i) =>
waitForImageReady(setup.snapshotElement.querySelector(`#img${i}`)!),
Array.from(setup.snapshotElement.querySelectorAll('sbb-image')).map((el) =>
waitForImageReady(el),
),
);
}),
Expand Down

0 comments on commit b6b4c22

Please sign in to comment.