Skip to content

Commit

Permalink
Fix primefaces#3603: Skeleton jest tests
Browse files Browse the repository at this point in the history
  • Loading branch information
melloware committed Nov 9, 2022
1 parent c718d79 commit 368c6e4
Show file tree
Hide file tree
Showing 2 changed files with 98 additions and 0 deletions.
16 changes: 16 additions & 0 deletions components/lib/skeleton/Skeleton.spec.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import '@testing-library/jest-dom';
import { Skeleton } from './Skeleton';

import { snapshot } from '../../test';

describe('Skeleton', () => {
snapshot(<Skeleton />, 'default');
snapshot(<Skeleton shape="circle" />, 'shape circle');
snapshot(<Skeleton shape="rectangle" />, 'shape rectangle');
snapshot(<Skeleton animation="none" />, 'animation none');
snapshot(<Skeleton animation="wave" />, 'animation wave');
snapshot(<Skeleton borderRadius="16px" />, 'border radius');
snapshot(<Skeleton borderRadius="16px" />, 'border radius');
snapshot(<Skeleton width="100%" height="2rem" />, 'size width and height');
snapshot(<Skeleton size="50px" />, 'size in pixels');
});
82 changes: 82 additions & 0 deletions components/lib/skeleton/__snapshots__/Skeleton.spec.js.snap
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP

exports[`Skeleton animation none 1`] = `
<div>
<div
class="p-skeleton p-component p-skeleton-none"
style="width: 100%; height: 1rem;"
/>
</div>
`;

exports[`Skeleton animation wave 1`] = `
<div>
<div
class="p-skeleton p-component"
style="width: 100%; height: 1rem;"
/>
</div>
`;

exports[`Skeleton border radius 1`] = `
<div>
<div
class="p-skeleton p-component"
style="width: 100%; height: 1rem; border-radius: 16px;"
/>
</div>
`;

exports[`Skeleton border radius 2`] = `
<div>
<div
class="p-skeleton p-component"
style="width: 100%; height: 1rem; border-radius: 16px;"
/>
</div>
`;

exports[`Skeleton default 1`] = `
<div>
<div
class="p-skeleton p-component"
style="width: 100%; height: 1rem;"
/>
</div>
`;

exports[`Skeleton shape circle 1`] = `
<div>
<div
class="p-skeleton p-component p-skeleton-circle"
style="width: 100%; height: 1rem;"
/>
</div>
`;

exports[`Skeleton shape rectangle 1`] = `
<div>
<div
class="p-skeleton p-component"
style="width: 100%; height: 1rem;"
/>
</div>
`;

exports[`Skeleton size in pixels 1`] = `
<div>
<div
class="p-skeleton p-component"
style="width: 50px; height: 50px;"
/>
</div>
`;

exports[`Skeleton size width and height 1`] = `
<div>
<div
class="p-skeleton p-component"
style="width: 100%; height: 2rem;"
/>
</div>
`;

0 comments on commit 368c6e4

Please sign in to comment.