diff --git a/src/elements/message/message.visual.spec.ts b/src/elements/message/message.visual.spec.ts index 7003fcc711..f6c52e0c56 100644 --- a/src/elements/message/message.visual.spec.ts +++ b/src/elements/message/message.visual.spec.ts @@ -1,17 +1,13 @@ import { html } from 'lit/static-html.js'; -import { - describeViewports, - loadAssetAsBase64, - visualDiffDefault, -} from '../core/testing/private.js'; +import { describeViewports, visualDiffDefault } from '../core/testing/private.js'; +import { waitForImageReady } from '../core/testing.js'; import './message.js'; import '../image.js'; import '../button/secondary-button.js'; const imageUrl = import.meta.resolve('../core/testing/assets/lucerne.png'); -await loadAssetAsBase64(imageUrl); describe(`sbb-message`, () => { describeViewports({ viewports: ['zero', 'medium'] }, () => { @@ -30,6 +26,8 @@ describe(`sbb-message`, () => { > `); + + await waitForImageReady(setup.snapshotElement.querySelector('sbb-image')!); }), ); @@ -64,6 +62,8 @@ describe(`sbb-message`, () => { > `); + + await waitForImageReady(setup.snapshotElement.querySelector('sbb-image')!); }), ); @@ -77,6 +77,8 @@ describe(`sbb-message`, () => {
Error code: 0001
`); + + await waitForImageReady(setup.snapshotElement.querySelector('sbb-image')!); }), ); @@ -96,6 +98,8 @@ describe(`sbb-message`, () => { > `); + + await waitForImageReady(setup.snapshotElement.querySelector('sbb-image')!); }), ); });