diff --git a/src/__tests__/__snapshots__/shallow.test.js.snap b/src/__tests__/__snapshots__/shallow.test.js.snap new file mode 100644 index 000000000..53e96ce8f --- /dev/null +++ b/src/__tests__/__snapshots__/shallow.test.js.snap @@ -0,0 +1,31 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`shallow rendering React Test Instance 1`] = ` + + + Press me + + +`; + +exports[`shallow rendering React elements 1`] = ` + + + + Press me + + + +`; diff --git a/src/__tests__/shallow.test.js b/src/__tests__/shallow.test.js new file mode 100644 index 000000000..7ebeb8e44 --- /dev/null +++ b/src/__tests__/shallow.test.js @@ -0,0 +1,25 @@ +// @flow +import React from 'react'; +import { View, TouchableOpacity, Text } from '../__mocks__/reactNativeMock'; +import { shallow, render } from '..'; + +const OnPressComponent = ({ onPress }) => ( + + + Press me + + +); + +test('shallow rendering React elements', () => { + const { output } = shallow(); + + expect(output).toMatchSnapshot(); +}); + +test('shallow rendering React Test Instance', () => { + const { getByTestId } = render(); + const { output } = shallow(getByTestId('root')); + + expect(output).toMatchSnapshot(); +});