Skip to content

Commit

Permalink
fix: tests
Browse files Browse the repository at this point in the history
  • Loading branch information
DavideMininni-Fincons committed Jun 14, 2024
1 parent b327f52 commit 2f9c7b2
Showing 1 changed file with 21 additions and 17 deletions.
38 changes: 21 additions & 17 deletions src/elements/breadcrumb/breadcrumb/breadcrumb.visual.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,32 +12,36 @@ describe('sbb-breadcrumb', () => {
let root: HTMLElement;

const cases = [
{ name: 'text', icon: undefined, text: 'Breadcrumb' },
{ name: 'icon', icon: 'house-small', text: undefined },
{ name: 'both', icon: 'house-small', text: 'Breadcrumb' },
{ case: 'only label', icon: undefined, text: 'Breadcrumb' },
{ case: 'only icon', icon: 'house-small', text: undefined },
{ case: 'label and icon', icon: 'house-small', text: 'Breadcrumb' },
];

describeViewports({ viewports: ['wide'] }, () => {
describe('combination', () => {
for (const singleCase of cases) {
for (const singleCase of cases) {
describe(`${singleCase.case}`, () => {
beforeEach(async function () {
root = await visualRegressionFixture(html`
<sbb-breadcrumb
href="https://www.sbb.ch"
target="_blank"
download="false"
icon-name=${singleCase.icon || nothing}
>${singleCase.text || nothing}</sbb-breadcrumb
>
`);
});

for (const state of visualDiffStandardStates) {
it(
`${singleCase.name} ${state.name}`,
`${state.name}`,
state.with((setup) => {
setup.withFixture(html`
<sbb-breadcrumb
href="https://www.sbb.ch"
target="_blank"
download="false"
.iconName=${singleCase.icon}
>${singleCase.text ? singleCase.text : nothing}</sbb-breadcrumb
>
`);
setup.withSnapshotElement(root);
}),
);
}
}
});
});
}

describe('slotted icon', () => {
beforeEach(async function () {
Expand Down

0 comments on commit 2f9c7b2

Please sign in to comment.