Skip to content

Commit

Permalink
fix: ensure that #skeleton animation actually runs
Browse files Browse the repository at this point in the history
  • Loading branch information
tujoworker committed Oct 5, 2020
1 parent 38929ea commit 9839f7b
Show file tree
Hide file tree
Showing 9 changed files with 12 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ You may import a given figure, or create your own.
import { Article } from 'dnb-ui-lib/components/skeleton/figures'
```

<ComponentBox scope={{Article}}>
<ComponentBox scope={{Article}} data-dnb-test="skeleton-shine">
{`
<Skeleton
show
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/**
* Screenshot Test
* This file will not run on "test:staged" because we dont require any related files
* This file will not run on "test:staged" because we don't require any related files
*/

import {
Expand All @@ -10,6 +10,13 @@ import {

describe('Skeleton screenshot', () => {
setupPageScreenshot({ url: '/uilib/components/skeleton/demos' })
it('have to match shine effect', async () => {
const screenshot = await testPageScreenshot({
style: { width: '20rem', height: '20rem' },
selector: '[data-dnb-test="skeleton-shine"]'
})
expect(screenshot).toMatchImageSnapshot()
})
it('have to match excluded components', async () => {
const screenshot = await testPageScreenshot({
style: { width: '20rem', height: '20rem' },
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -341,8 +341,7 @@ exports[`Skeleton scss have to match snapshot 1`] = `
html[data-dnb-test] .dnb-skeleton,
html[data-dnb-test] .dnb-skeleton::after,
html[data-dnb-test] .dnb-skeleton--shine .dnb-skeleton::after {
animation: none !important;
background-image: none !important; }
animation: none !important; }
@keyframes skeletonFontAnimation {
0% {
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -119,9 +119,6 @@
html[data-dnb-test] &::after,
html[data-dnb-test] &--shine &::after {
animation: none !important;

// Looks like on CI (Linux) the lines do not work? Skip then for now
background-image: none !important;
}

// Not used right now!
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
&--lines#{&}--shape#{&}::after {
background-image: repeating-linear-gradient(
-45deg,
var(--skeleton-color--contrast) 0 1px,
var(--skeleton-color--contrast) 1px 2px,
transparent 0 6px
) !important;
background-repeat: repeat !important;
Expand Down Expand Up @@ -80,7 +80,7 @@
&--font {
background-image: repeating-linear-gradient(
-45deg,
var(--skeleton-color--contrast) 0 1px,
var(--skeleton-color--contrast) 1px 2px,
transparent 0 6px
) !important;

Expand Down

0 comments on commit 9839f7b

Please sign in to comment.