-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test: use testing library for snapshots (#3802)
- Loading branch information
1 parent
1b747fa
commit f9d3db1
Showing
34 changed files
with
749 additions
and
958 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,31 +1,31 @@ | ||
import * as React from 'react'; | ||
|
||
import renderer from 'react-test-renderer'; | ||
import { render } from '@testing-library/react-native'; | ||
|
||
import ActivityIndicator from '../ActivityIndicator'; | ||
|
||
it('renders indicator', () => { | ||
const tree = renderer.create(<ActivityIndicator animating />).toJSON(); | ||
const tree = render(<ActivityIndicator animating />).toJSON(); | ||
|
||
expect(tree).toMatchSnapshot(); | ||
}); | ||
|
||
it('renders hidden indicator', () => { | ||
const tree = renderer | ||
.create(<ActivityIndicator animating={false} hidesWhenStopped />) | ||
.toJSON(); | ||
const tree = render( | ||
<ActivityIndicator animating={false} hidesWhenStopped /> | ||
).toJSON(); | ||
|
||
expect(tree).toMatchSnapshot(); | ||
}); | ||
|
||
it('renders large indicator', () => { | ||
const tree = renderer.create(<ActivityIndicator size="large" />).toJSON(); | ||
const tree = render(<ActivityIndicator size="large" />).toJSON(); | ||
|
||
expect(tree).toMatchSnapshot(); | ||
}); | ||
|
||
it('renders colored indicator', () => { | ||
const tree = renderer.create(<ActivityIndicator color="#FF0000" />).toJSON(); | ||
const tree = render(<ActivityIndicator color="#FF0000" />).toJSON(); | ||
|
||
expect(tree).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
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
Oops, something went wrong.