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-title): implement visual regression tests #2869

Merged
merged 3 commits into from
Jul 2, 2024
Merged
Changes from 1 commit
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
35 changes: 35 additions & 0 deletions src/elements/title/title.visual.spec.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
import { html } from 'lit';

import { describeViewports, visualDiffDefault } from '../core/testing/private.js';

import '../title.js';

describe(`sbb-title`, () => {
describeViewports({ viewports: ['zero', 'small', 'large', 'ultra'] }, () => {
MarioCastigliano marked this conversation as resolved.
Show resolved Hide resolved
for (const level of ['1', '2', '3', '4', '5', '6']) {
jeripeierSBB marked this conversation as resolved.
Show resolved Hide resolved
it(
`visual level ${level}`,
MarioCastigliano marked this conversation as resolved.
Show resolved Hide resolved
visualDiffDefault.with(async (setup) => {
await setup.withFixture(
html`<sbb-title level=${level}>
Data without insights are trivial, and insights without action are pointless
MarioCastigliano marked this conversation as resolved.
Show resolved Hide resolved
</sbb-title>`,
);
}),
);
}

it(
'negative',
visualDiffDefault.with(async (setup) => {
await setup.withFixture(
html` <div style="padding: 1rem; background-color: var(--sbb-color-charcoal);">
<sbb-title negative>
Data without insights are trivial, and insights without action are pointless
</sbb-title>
</div>`,
);
MarioCastigliano marked this conversation as resolved.
Show resolved Hide resolved
}),
);
});
});
Loading