Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test(sbb-link): fix visual regression tests #2849

Merged
merged 1 commit into from
Jun 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ describe(`sbb-block-link-button`, () => {
for (const state of visualDiffStandardStates) {
it(
state.name,
state.with((setup) => {
setup.withFixture(
state.with(async (setup) => {
await setup.withFixture(
html`<sbb-block-link-button ?negative=${negative}
>Travelcards & tickets</sbb-block-link-button
>`,
Expand All @@ -37,8 +37,8 @@ describe(`sbb-block-link-button`, () => {
describeEach(iconState, ({ iconPlacement, slotted }) => {
it(
visualDiffDefault.name,
visualDiffDefault.with((setup) => {
setup.withFixture(html`
visualDiffDefault.with(async (setup) => {
await setup.withFixture(html`
<sbb-block-link-button
icon-name=${slotted ? nothing : 'chevron-small-right-small'}
icon-placement=${iconPlacement}
Expand All @@ -56,8 +56,8 @@ describe(`sbb-block-link-button`, () => {
for (const size of ['xs', 's', 'm']) {
it(
`size=${size} ${visualDiffDefault.name}`,
visualDiffDefault.with((setup) => {
setup.withFixture(
visualDiffDefault.with(async (setup) => {
await setup.withFixture(
html`<sbb-block-link-button size=${size}>Travelcards & tickets</sbb-block-link-button>`,
);
}),
Expand All @@ -66,8 +66,8 @@ describe(`sbb-block-link-button`, () => {

it(
`width=fixed ${visualDiffDefault.name}`,
visualDiffDefault.with((setup) => {
setup.withFixture(
visualDiffDefault.with(async (setup) => {
await setup.withFixture(
html`<sbb-block-link-button icon-name="chevron-small-right-small" style="width: 200px;">
A lot of link text to show what happens if there is not enough space.
</sbb-block-link-button>`,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ describe(`sbb-block-link-static`, () => {
for (const state of [visualDiffDefault, visualDiffActive, visualDiffHover]) {
it(
state.name,
state.with((setup) => {
setup.withFixture(
state.with(async (setup) => {
await setup.withFixture(
html` <sbb-block-link-static ?negative="${negative}"
>Travelcards & tickets</sbb-block-link-static
>`,
Expand All @@ -38,8 +38,8 @@ describe(`sbb-block-link-static`, () => {
describeEach(iconState, ({ iconPlacement, slotted }) => {
it(
visualDiffDefault.name,
visualDiffDefault.with((setup) => {
setup.withFixture(html`
visualDiffDefault.with(async (setup) => {
await setup.withFixture(html`
<sbb-block-link-static
icon-name="${slotted ? nothing : 'chevron-small-right-small'}"
icon-placement="${iconPlacement}"
Expand All @@ -57,8 +57,8 @@ describe(`sbb-block-link-static`, () => {
for (const size of ['xs', 's', 'm']) {
it(
`size=${size} ${visualDiffDefault.name}`,
visualDiffDefault.with((setup) => {
setup.withFixture(
visualDiffDefault.with(async (setup) => {
await setup.withFixture(
html` <sbb-block-link-static size="${size}"
>Travelcards & tickets</sbb-block-link-static
>`,
Expand All @@ -69,8 +69,8 @@ describe(`sbb-block-link-static`, () => {

it(
`width=fixed ${visualDiffDefault.name}`,
visualDiffDefault.with((setup) => {
setup.withFixture(
visualDiffDefault.with(async (setup) => {
await setup.withFixture(
html` <sbb-block-link-static icon-name="chevron-small-right-small" style="width: 200px;">
A lot of link text to show what happens if there is not enough space.
</sbb-block-link-static>`,
Expand Down
16 changes: 8 additions & 8 deletions src/elements/link/block-link/block-link.visual.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ describe(`sbb-block-link`, () => {
for (const state of visualDiffStandardStates) {
it(
state.name,
state.with((setup) => {
setup.withFixture(
state.with(async (setup) => {
await setup.withFixture(
html`<sbb-block-link href="#" ?negative=${negative}
>Travelcards & tickets</sbb-block-link
>`,
Expand All @@ -37,8 +37,8 @@ describe(`sbb-block-link`, () => {
describeEach(iconState, ({ iconPlacement, slotted }) => {
it(
visualDiffDefault.name,
visualDiffDefault.with((setup) => {
setup.withFixture(html`
visualDiffDefault.with(async (setup) => {
await setup.withFixture(html`
<sbb-block-link
href="#"
icon-name=${slotted ? nothing : 'chevron-small-right-small'}
Expand All @@ -57,8 +57,8 @@ describe(`sbb-block-link`, () => {
for (const size of ['xs', 's', 'm']) {
it(
`size=${size} ${visualDiffDefault.name}`,
visualDiffDefault.with((setup) => {
setup.withFixture(
visualDiffDefault.with(async (setup) => {
await setup.withFixture(
html`<sbb-block-link href="#" size=${size}>Travelcards & tickets</sbb-block-link>`,
);
}),
Expand All @@ -67,8 +67,8 @@ describe(`sbb-block-link`, () => {

it(
`width=fixed ${visualDiffDefault.name}`,
visualDiffDefault.with((setup) => {
setup.withFixture(
visualDiffDefault.with(async (setup) => {
await setup.withFixture(
html`<sbb-block-link href="#" icon-name="chevron-small-right-small" style="width: 200px;">
A lot of link text to show what happens if there is not enough space.
</sbb-block-link>`,
Expand Down
4 changes: 2 additions & 2 deletions src/elements/link/link-button/link-button.visual.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ describe(`sbb-link-button`, () => {
for (const state of visualDiffStandardStates) {
it(
`negative=${negative} ${state.name}`,
state.with((setup) => {
setup.withFixture(
state.with(async (setup) => {
await setup.withFixture(
html` <p class="sbb-text-m">
Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod
tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua.
Expand Down
4 changes: 2 additions & 2 deletions src/elements/link/link-static/link-static.visual.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ describe(`sbb-link-static`, () => {
for (const state of [visualDiffDefault, visualDiffActive, visualDiffHover]) {
it(
`negative=${negative} ${state.name}`,
state.with((setup) => {
setup.withFixture(
state.with(async (setup) => {
await setup.withFixture(
html` <p class="sbb-text-m">
Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod
tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua.
Expand Down
4 changes: 2 additions & 2 deletions src/elements/link/link/link.visual.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ describe(`sbb-link`, () => {
for (const state of visualDiffStandardStates) {
it(
`negative=${negative} ${state.name}`,
state.with((setup) => {
setup.withFixture(
state.with(async (setup) => {
await setup.withFixture(
html` <p class="sbb-text-m">
Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod
tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua.
Expand Down
Loading