-
Notifications
You must be signed in to change notification settings - Fork 80
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added more tests, better type checks
- Loading branch information
1 parent
936928f
commit 96ad0df
Showing
6 changed files
with
67 additions
and
11 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
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 |
---|---|---|
@@ -1,16 +1,11 @@ | ||
// Jest Snapshot v1, https://goo.gl/fbAQLP | ||
|
||
exports[`2 children delayed fade in 1`] = ` | ||
exports[`1 child delayed fade in 1`] = ` | ||
<DocumentFragment> | ||
<div> | ||
<p> | ||
1 | ||
</p> | ||
</div> | ||
<div> | ||
<p> | ||
2 | ||
</p> | ||
</div> | ||
</DocumentFragment> | ||
`; |
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,34 @@ | ||
// Jest Snapshot v1, https://goo.gl/fbAQLP | ||
|
||
exports[`custom components 1`] = ` | ||
<DocumentFragment> | ||
<div> | ||
<div> | ||
<p> | ||
1 | ||
</p> | ||
</div> | ||
<p /> | ||
<p> | ||
2 | ||
</p> | ||
<p /> | ||
<div> | ||
<p> | ||
3 | ||
</p> | ||
</div> | ||
<div> | ||
<p> | ||
4 | ||
</p> | ||
</div> | ||
<div> | ||
<p> | ||
5 | ||
</p> | ||
</div> | ||
<div /> | ||
</div> | ||
</DocumentFragment> | ||
`; |
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,27 @@ | ||
import '@testing-library/jest-dom'; | ||
import React from 'react'; | ||
import { render } from '@testing-library/react'; | ||
import Anime from '../src/react-anime'; | ||
|
||
const MyComponent = (props) => <div>{props.children}</div>; | ||
|
||
//snapshot test | ||
it('custom components', () => { | ||
const tree = render( | ||
<div> | ||
<Anime component={null}> | ||
<p>1</p> | ||
</Anime> | ||
<Anime component="p"> | ||
<p>2</p> | ||
</Anime> | ||
<Anime component={MyComponent}> | ||
<p>3</p> | ||
<p>4</p> | ||
<p>5</p> | ||
</Anime> | ||
<Anime/> | ||
</div> | ||
); | ||
expect(tree.asFragment()).toMatchSnapshot(); | ||
}); |
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