Skip to content

Commit

Permalink
test(sbb-form-field): enhance borderless tests
Browse files Browse the repository at this point in the history
  • Loading branch information
jeripeierSBB committed Aug 8, 2024
1 parent 6ed0752 commit b1e2633
Showing 1 changed file with 25 additions and 9 deletions.
34 changes: 25 additions & 9 deletions src/elements/form-field/form-field/form-field.visual.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -337,15 +337,31 @@ describe(`sbb-form-field`, () => {
);

// borderless
it(
`borderless=true`,
visualDiffDefault.with(async (setup) => {
const noLabel = { ...basicArgs, borderless: true };
await setup.withFixture(html`${formField(noLabel, template(noLabel))}`, {
forcedColors,
});
}),
);
for (const negative of [false, true]) {
describe(`negative=${negative}`, () => {
it(
`borderless=true`,
visualDiffDefault.with(async (setup) => {
const noLabel = { ...basicArgs, negative, borderless: true };
await setup.withFixture(html`${formField(noLabel, template(noLabel))}`, {
backgroundColor: negative ? 'var(--sbb-color-black)' : undefined,
forcedColors,
});
}),
);

it(
`borderless=true ${visualDiffFocus.name}`,
visualDiffFocus.with(async (setup) => {
const noLabel = { ...basicArgs, negative, borderless: true };
await setup.withFixture(html`${formField(noLabel, template(noLabel))}`, {
backgroundColor: negative ? 'var(--sbb-color-black)' : undefined,
forcedColors,
});
}),
);
});
}

// visual
describeEach(visualProp, ({ size, width, errorText }) => {
Expand Down

0 comments on commit b1e2633

Please sign in to comment.