From 05db1676dc34282d2dddd6bfdafa8ca00ebb19b8 Mon Sep 17 00:00:00 2001 From: Valeria Stromtsova Date: Sat, 16 May 2020 19:30:48 +0300 Subject: [PATCH] #12: Added test step --- __tests__/App-test.js | 14 ------- __tests__/BasicButton-test.js | 26 +++++++++++++ .../__snapshots__/BasicButton-test.js.snap | 39 +++++++++++++++++++ 3 files changed, 65 insertions(+), 14 deletions(-) delete mode 100644 __tests__/App-test.js create mode 100644 __tests__/BasicButton-test.js create mode 100644 __tests__/__snapshots__/BasicButton-test.js.snap diff --git a/__tests__/App-test.js b/__tests__/App-test.js deleted file mode 100644 index 090aefa..0000000 --- a/__tests__/App-test.js +++ /dev/null @@ -1,14 +0,0 @@ -/** - * @format - */ - -import 'react-native'; -import React from 'react'; -import App from '../App'; - -// Note: test renderer must be required after react-native. -import renderer from 'react-test-renderer'; - -it('renders correctly', () => { - renderer.create(); -}); diff --git a/__tests__/BasicButton-test.js b/__tests__/BasicButton-test.js new file mode 100644 index 0000000..7d5902f --- /dev/null +++ b/__tests__/BasicButton-test.js @@ -0,0 +1,26 @@ +/** + * @format + */ + +import 'react-native'; +import React from 'react'; +import renderer from 'react-test-renderer'; + +import {light as lightTheme, mapping} from '@eva-design/eva'; +import {ApplicationProvider} from '@ui-kitten/components'; + +import {BasicButton} from '../src/components/buttons/BasicButton'; +import {default as appTheme} from '../src/styles/theme'; + +const theme = {...lightTheme, ...appTheme}; + +test('renders correctly', () => { + const tree = renderer + .create( + + + , + ) + .toJSON(); + expect(tree).toMatchSnapshot(); +}); diff --git a/__tests__/__snapshots__/BasicButton-test.js.snap b/__tests__/__snapshots__/BasicButton-test.js.snap new file mode 100644 index 0000000..f563480 --- /dev/null +++ b/__tests__/__snapshots__/BasicButton-test.js.snap @@ -0,0 +1,39 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`renders correctly 1`] = ` + + + +`;