-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test(sbb-title): implement visual regression tests (#2869)
- Loading branch information
1 parent
7048f87
commit 2a33bd9
Showing
3 changed files
with
83 additions
and
13 deletions.
There are no files selected for viewing
23 changes: 23 additions & 0 deletions
23
src/elements/title/__snapshots__/title.snapshot.spec.snap.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
import { html } from 'lit'; | ||
|
||
import { describeViewports, visualDiffDefault } from '../core/testing/private.js'; | ||
|
||
import '../title.js'; | ||
|
||
describe(`sbb-title`, () => { | ||
describeViewports({ viewports: ['zero', 'small', 'medium', 'large', 'ultra'] }, () => { | ||
for (const level of ['1', '2', '3', '4', '5', '6']) { | ||
it( | ||
`level=${level}`, | ||
visualDiffDefault.with(async (setup) => { | ||
await setup.withFixture( | ||
html`<sbb-title level=${level}> | ||
Data without insights are trivial, and insights without action are pointless | ||
</sbb-title> | ||
<article> | ||
Diam maecenas ultricies mi eget mauris pharetra et ultrices neque ornare aenean | ||
euismod elementum nisi quis eleifend quam adipiscing vitae proin sagittis nisl | ||
rhoncus mattis rhoncus urna neque viverra justo nec ultrices dui sapien eget mi | ||
proin sed libero enim sed faucibus turpis in eu mi bibendum neque egestas congue. | ||
</article> `, | ||
); | ||
}), | ||
); | ||
} | ||
|
||
it( | ||
'negative', | ||
visualDiffDefault.with(async (setup) => { | ||
await setup.withFixture( | ||
html` | ||
<sbb-title negative> | ||
Data without insights are trivial, and insights without action are pointless | ||
</sbb-title> | ||
`, | ||
{ backgroundColor: 'var(--sbb-color-charcoal)' }, | ||
); | ||
}), | ||
); | ||
}); | ||
}); |