-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
174 additions
and
29 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,16 @@ | ||
import '@testing-library/jest-dom'; | ||
import { render } from '@testing-library/react'; | ||
import { Divider } from './Divider'; | ||
|
||
const snapshot = (props, name) => expect(render(<Divider {...props} />).container).toMatchSnapshot(name); | ||
import { snapshot } from '../../test'; | ||
|
||
describe('Divider Snapshot', () => { | ||
test('check snapshots', () => { | ||
snapshot({}, 'default'); | ||
snapshot({ layout: 'horizontal', align: 'left' }, 'horizontal left'); | ||
snapshot({ layout: 'horizontal', align: 'right' }, 'horizontal right'); | ||
snapshot({ layout: 'horizontal', align: 'center' }, 'horizontal center'); | ||
snapshot({ layout: 'vertical', align: 'center' }, 'vertical center'); | ||
snapshot({ layout: 'vertical', align: 'top' }, 'vertical top'); | ||
snapshot({ layout: 'vertical', align: 'bottom' }, 'vertical bottom'); | ||
snapshot({ type: 'dashed' }, 'dashed'); | ||
snapshot({ type: 'dotted' }, 'dotted'); | ||
}); | ||
describe('Divider', () => { | ||
snapshot(<Divider />, 'default'); | ||
snapshot(<Divider layout="horizontal" align="left" />, 'horizontal left'); | ||
snapshot(<Divider layout="horizontal" align="right" />, 'horizontal right'); | ||
snapshot(<Divider layout="horizontal" align="center" />, 'horizontal center'); | ||
snapshot(<Divider layout="vertical" align="center" />, 'vertical center'); | ||
snapshot(<Divider layout="vertical" align="top" />, 'vertical top'); | ||
snapshot(<Divider layout="vertical" align="bottom" />, 'vertical bottom'); | ||
snapshot(<Divider type="dashed" />, 'type dashed'); | ||
snapshot(<Divider type="dotted" />, 'type dotted'); | ||
}); |
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,21 @@ | ||
import '@testing-library/jest-dom'; | ||
import { Tag } from './Tag'; | ||
|
||
import { snapshot } from '../../test'; | ||
|
||
describe('Divider', () => { | ||
snapshot(<Tag />, 'default'); | ||
snapshot(<Tag value={`jest`} />, 'value'); | ||
snapshot(<Tag severity="success" />, 'sevrity success'); | ||
snapshot(<Tag severity="info" />, 'sevrity info'); | ||
snapshot(<Tag severity="warning" />, 'sevrity warning'); | ||
snapshot(<Tag severity="danger" />, 'sevrity danger'); | ||
snapshot(<Tag rounded />, 'rounded'); | ||
snapshot(<Tag icon="pi pi-check" />, 'icon'); | ||
snapshot( | ||
<Tag> | ||
<div>hello</div> | ||
</Tag>, | ||
'children' | ||
); | ||
}); |
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,127 @@ | ||
// Jest Snapshot v1, https://goo.gl/fbAQLP | ||
|
||
exports[`Divider children 1`] = ` | ||
<div> | ||
<span | ||
class="p-tag p-component" | ||
> | ||
<span | ||
class="p-tag-value" | ||
/> | ||
<span> | ||
<div> | ||
hello | ||
</div> | ||
</span> | ||
</span> | ||
</div> | ||
`; | ||
|
||
exports[`Divider default 1`] = ` | ||
<div> | ||
<span | ||
class="p-tag p-component" | ||
> | ||
<span | ||
class="p-tag-value" | ||
/> | ||
<span /> | ||
</span> | ||
</div> | ||
`; | ||
|
||
exports[`Divider icon 1`] = ` | ||
<div> | ||
<span | ||
class="p-tag p-component" | ||
> | ||
<span | ||
class="p-tag-icon pi pi-check" | ||
/> | ||
<span | ||
class="p-tag-value" | ||
/> | ||
<span /> | ||
</span> | ||
</div> | ||
`; | ||
|
||
exports[`Divider rounded 1`] = ` | ||
<div> | ||
<span | ||
class="p-tag p-component p-tag-rounded" | ||
> | ||
<span | ||
class="p-tag-value" | ||
/> | ||
<span /> | ||
</span> | ||
</div> | ||
`; | ||
|
||
exports[`Divider sevrity danger 1`] = ` | ||
<div> | ||
<span | ||
class="p-tag p-component p-tag-danger" | ||
> | ||
<span | ||
class="p-tag-value" | ||
/> | ||
<span /> | ||
</span> | ||
</div> | ||
`; | ||
|
||
exports[`Divider sevrity info 1`] = ` | ||
<div> | ||
<span | ||
class="p-tag p-component p-tag-info" | ||
> | ||
<span | ||
class="p-tag-value" | ||
/> | ||
<span /> | ||
</span> | ||
</div> | ||
`; | ||
|
||
exports[`Divider sevrity success 1`] = ` | ||
<div> | ||
<span | ||
class="p-tag p-component p-tag-success" | ||
> | ||
<span | ||
class="p-tag-value" | ||
/> | ||
<span /> | ||
</span> | ||
</div> | ||
`; | ||
|
||
exports[`Divider sevrity warning 1`] = ` | ||
<div> | ||
<span | ||
class="p-tag p-component p-tag-warning" | ||
> | ||
<span | ||
class="p-tag-value" | ||
/> | ||
<span /> | ||
</span> | ||
</div> | ||
`; | ||
|
||
exports[`Divider value 1`] = ` | ||
<div> | ||
<span | ||
class="p-tag p-component" | ||
> | ||
<span | ||
class="p-tag-value" | ||
> | ||
jest | ||
</span> | ||
<span /> | ||
</span> | ||
</div> | ||
`; |