App-test.js 646 B

12345678910111213141516171819202122
  1. import 'react-native';
  2. import React from 'react';
  3. import App from '../App';
  4. import renderer from 'react-test-renderer';
  5. import NavigationTestUtils from 'react-navigation/NavigationTestUtils';
  6. describe('App snapshot', () => {
  7. jest.useFakeTimers();
  8. beforeEach(() => {
  9. NavigationTestUtils.resetInternalState();
  10. });
  11. it('renders the loading screen', async () => {
  12. const tree = renderer.create(<App />).toJSON();
  13. expect(tree).toMatchSnapshot();
  14. });
  15. it('renders the root without loading screen', async () => {
  16. const tree = renderer.create(<App skipLoadingScreen />).toJSON();
  17. expect(tree).toMatchSnapshot();
  18. });
  19. });