Skip to content

Commit

Permalink
#12: Added test step
Browse files Browse the repository at this point in the history
  • Loading branch information
lerastromtsova committed May 16, 2020
1 parent 5f26747 commit 05db167
Show file tree
Hide file tree
Showing 3 changed files with 65 additions and 14 deletions.
14 changes: 0 additions & 14 deletions __tests__/App-test.js

This file was deleted.

26 changes: 26 additions & 0 deletions __tests__/BasicButton-test.js
Original file line number Diff line number Diff line change
@@ -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(
<ApplicationProvider mapping={mapping} theme={theme}>
<BasicButton />
</ApplicationProvider>,
)
.toJSON();
expect(tree).toMatchSnapshot();
});
39 changes: 39 additions & 0 deletions __tests__/__snapshots__/BasicButton-test.js.snap
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP

exports[`renders correctly 1`] = `
<View
style={
Object {
"flex": 1,
}
}
>
<View
accessible={true}
focusable={true}
onClick={[Function]}
onResponderGrant={[Function]}
onResponderMove={[Function]}
onResponderRelease={[Function]}
onResponderTerminate={[Function]}
onResponderTerminationRequest={[Function]}
onStartShouldSetResponder={[Function]}
style={
Object {
"alignItems": "center",
"backgroundColor": "transparent",
"borderColor": "transparent",
"borderRadius": 4,
"borderWidth": 1,
"flexDirection": "row",
"justifyContent": "center",
"minHeight": 40,
"minWidth": 40,
"opacity": 1,
"paddingHorizontal": 10,
"paddingVertical": 12,
}
}
/>
</View>
`;

0 comments on commit 05db167

Please sign in to comment.