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 5327e4c
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('Tag', () => {
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[`Tag animation none 1`] = `
<div>
<div
class="p-skeleton p-component p-skeleton-none"
style="width: 100%; height: 1rem;"
/>
</div>
`;

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

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

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

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

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

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

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

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

0 comments on commit 5327e4c

Please sign in to comment.