-
Notifications
You must be signed in to change notification settings - Fork 32
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: make #tabs fallback of selected key more robust. Add screenshot …
…testing
- Loading branch information
1 parent
695bcd6
commit ed4a5f1
Showing
4 changed files
with
38 additions
and
9 deletions.
There are no files selected for viewing
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
28 changes: 28 additions & 0 deletions
28
packages/dnb-ui-lib/src/components/tabs/__tests__/Tabs.screenshot.test.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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
/** | ||
* Screenshot Test | ||
* This file will not run on "test:staged" because we dont require any related files | ||
*/ | ||
|
||
import { | ||
setupPageScreenshot, | ||
testPageScreenshot | ||
} from '../../../core/jest/jestSetupScreenshots' | ||
|
||
setupPageScreenshot() | ||
|
||
describe('Tabs screenshot', () => { | ||
it('have to match the "Tablist" screenshot snapshot', async () => { | ||
const screenshot = await testPageScreenshot({ | ||
url: '/uilib/components/tabs?fullscreen', | ||
selector: '.example-box:nth-child(1) .dnb-tabs' | ||
}) | ||
expect(screenshot).toMatchImageSnapshot() | ||
}) | ||
it('have to match the "Tabs" screenshot snapshot, right aligned', async () => { | ||
const screenshot = await testPageScreenshot({ | ||
url: '/uilib/components/tabs?fullscreen', | ||
selector: '.example-box:nth-child(4) .dnb-tabs' | ||
}) | ||
expect(screenshot).toMatchImageSnapshot() | ||
}) | ||
}) |
Binary file added
BIN
+6.67 KB
...-tabs-screenshot-have-to-match-the-tablist-screenshot-snapshot-1-08b69.snap.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+11.4 KB
...nshot-have-to-match-the-tabs-screenshot-snapshot-right-aligned-1-0c021.snap.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.