This repository has been archived by the owner on Nov 10, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 89
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
13 changed files
with
625 additions
and
967 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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 |
---|---|---|
@@ -0,0 +1,11 @@ | ||
describe('SplashScreen', () => { | ||
|
||
beforeEach(async () => { | ||
await device.relaunchApp(); | ||
}); | ||
|
||
it('should show sample screen', async () => { | ||
await expect(element(by.id('SAMPLE_SCREEN'))).toBeVisible(); | ||
}); | ||
|
||
}); |
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 |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"setupTestFrameworkScriptFile" : "./init.js" | ||
} |
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 |
---|---|---|
@@ -0,0 +1,19 @@ | ||
const detox = require('detox'); | ||
const config = require('../package.json').detox; | ||
const adapter = require('detox/runners/jest/adapter'); | ||
|
||
jest.setTimeout(120000); | ||
jasmine.getEnv().addReporter(adapter); | ||
|
||
beforeAll(async () => { | ||
await detox.init(config); | ||
}); | ||
|
||
beforeEach(async function() { | ||
await adapter.beforeEach(); | ||
}); | ||
|
||
afterAll(async () => { | ||
await adapter.afterAll(); | ||
await detox.cleanup(); | ||
}); |
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
File renamed without changes.
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,18 +1,22 @@ | ||
import 'react-native'; | ||
import * as React from 'react'; | ||
import * as testRenderer from 'react-test-renderer'; | ||
// import { shallow } from 'enzyme'; | ||
|
||
const Button = () => null; | ||
import { shallow } from 'enzyme'; | ||
import Button from '../Button'; | ||
|
||
test('renders correctly', () => { | ||
const tree = testRenderer.create(<Button />).toJSON(); | ||
|
||
const tree = testRenderer.create(<Button title="test" />).toJSON(); | ||
expect(tree).toMatchSnapshot(); | ||
}); | ||
|
||
// test('Button renders children text', () => { | ||
// const text = 'Sample text'; | ||
// const button = shallow(<Button />); | ||
// expect(button.findWhere(c => c.text() === text)).toBeTruthy(); | ||
// }); | ||
test('Button renders children text', () => { | ||
const text = 'Sample text'; | ||
const button = shallow(<Button title={text} />); | ||
expect(button.findWhere(c => c.text() === text)).toHaveLength(1); | ||
}); | ||
|
||
test('Button calls onPress function', () => { | ||
const onPress = jest.fn(); | ||
const button = shallow(<Button title="demo" onPress={onPress} />); | ||
button.simulate('press'); | ||
expect(onPress).toHaveBeenCalled(); | ||
}) |
53 changes: 52 additions & 1 deletion
53
src/components/button/__tests__/__snapshots__/Button.spec.tsx.snap
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,3 +1,54 @@ | ||
// Jest Snapshot v1, https://goo.gl/fbAQLP | ||
|
||
exports[`renders correctly 1`] = `null`; | ||
exports[`renders correctly 1`] = ` | ||
<View | ||
accessibilityComponentType="button" | ||
accessibilityTraits={ | ||
Array [ | ||
"button", | ||
] | ||
} | ||
accessible={true} | ||
isTVSelectable={true} | ||
onResponderGrant={[Function]} | ||
onResponderMove={[Function]} | ||
onResponderRelease={[Function]} | ||
onResponderTerminate={[Function]} | ||
onResponderTerminationRequest={[Function]} | ||
onStartShouldSetResponder={[Function]} | ||
style={ | ||
Object { | ||
"opacity": 1, | ||
} | ||
} | ||
> | ||
<View | ||
style={ | ||
Array [ | ||
Object { | ||
"backgroundColor": "#f8f8f8", | ||
"borderRadius": 4, | ||
}, | ||
] | ||
} | ||
> | ||
<Text | ||
style={ | ||
Array [ | ||
Object { | ||
"color": "black", | ||
"fontSize": 18, | ||
"paddingBottom": 12, | ||
"paddingLeft": 12, | ||
"paddingRight": 12, | ||
"paddingTop": 12, | ||
"textAlign": "center", | ||
}, | ||
] | ||
} | ||
> | ||
test | ||
</Text> | ||
</View> | ||
</View> | ||
`; |
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.