Skip to content

Commit

Permalink
fix integration tests, android build, and upgrade detox
Browse files Browse the repository at this point in the history
  • Loading branch information
ruddell committed Oct 22, 2020
1 parent a96d37b commit 08a792a
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 7 deletions.
1 change: 1 addition & 0 deletions boilerplate/app/shared/components/search-bar/search-bar.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ export default class SearchBar extends React.Component {
returnKeyType={'search'}
autoCorrect={false}
selectionColor={Colors.snow}
testID='searchTextInput'
/>
<TouchableOpacity onPress={onCancel} style={styles.cancelButton}>
<Text style={styles.buttonLabel}>Cancel</Text>
Expand Down
2 changes: 1 addition & 1 deletion boilerplate/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
"eslint-plugin-prettier": "3.1.4",
"lint-staged": "10.4.2",
"react-native-app-auth": "6.0.0",
"detox": "17.10.2",
"detox": "17.10.3",
"mocha": "8.2.0",
"mockery": "2.1.0",
"react-dom": "16.13.1",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,6 @@ test('onSearch', () => {
const wrapperPress = shallow(<SearchBar onSearch={onSearch} onCancel={onCancel} searchTerm={searchTerm} />)

// checks that the methods use the right handlers
expect(wrapperPress.find('TextInput').prop('onChangeText')).toBe(onSearch) // uses the right handler
expect(JSON.stringify(wrapperPress.find('TextInput').prop('onSubmitEditing'))).toEqual(JSON.stringify(onSubmitEditing))
expect(wrapperPress.findWhere((node) => node.prop('testID') === 'searchTextInput').prop('onChangeText')).toBe(onSearch) // uses the right handler
expect(JSON.stringify(wrapperPress.findWhere((node) => node.prop('testID') === 'searchTextInput').prop('onSubmitEditing'))).toEqual(JSON.stringify(onSubmitEditing))
})
2 changes: 1 addition & 1 deletion src/lib/react-native-navigation.js
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ const updateAndroidFiles = async (context) => {
// settings.gradle
await patchInFile(context, `${process.cwd()}/android/build.gradle`, {
after: `dependencies {`,
insert: ` classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$RNNKotlinVersion")"`,
insert: ` classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:$RNNKotlinVersion")`,
})

await patchInFile(context, `${process.cwd()}/android/build.gradle`, {
Expand Down
6 changes: 3 additions & 3 deletions test/auth-tests/common-methods.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ const copyFilesAndGenerateApp = async (authType, useDto) => {
console.log('Generating App...')

// create a dummy jhipster backend
await execa('mkdir', ['backend'])
await execa('mkdir', ['backend/.jhipster'])
await execa('mkdir', ['-p', 'backend'])
await execa('mkdir', ['-p', 'backend/.jhipster'])
await execa('cp', [`${testFolder}/.jhipster/${authType}-yo-rc.json`, 'backend/.yo-rc.json'])
await execa('cp', [`${testFolder}/jdl/entities${useDto ? '-dto' : ''}.jdl`, 'backend/backend.jdl'])
await execa('cp', [`${testFolder}/.jhipster/FieldTestEntity.json`, 'backend/.jhipster/FieldTestEntity.json'])
Expand Down Expand Up @@ -57,7 +57,7 @@ const runTests = async () => {
const tests = await execa('npm', ['-s', 'run', 'test', '--', '-u'])
console.log('Tests Complete')
console.log(tests.stdout)
expect(tests.stderr).not.toMatch(/failed/)
expect(tests.stderr).not.toMatch(/failed,/)
}

module.exports = {
Expand Down

0 comments on commit 08a792a

Please sign in to comment.