From b248de552d68bedbdb982d6f4ffb081875465885 Mon Sep 17 00:00:00 2001 From: Nicolas Gallagher Date: Thu, 3 Nov 2016 08:51:51 -0700 Subject: [PATCH] Fix tests --- src/components/TextInput/__tests__/index-test.js | 12 ++++++------ src/components/TextInput/index.js | 2 +- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/components/TextInput/__tests__/index-test.js b/src/components/TextInput/__tests__/index-test.js index ded28b8d..dd5b02a3 100644 --- a/src/components/TextInput/__tests__/index-test.js +++ b/src/components/TextInput/__tests__/index-test.js @@ -22,12 +22,12 @@ const testIfDocumentIsFocused = (message, fn) => { suite('components/TextInput', () => { test('prop "autoComplete"', () => { - // off - let input = findNativeInput(shallow()); - assert.equal(input.prop('autoComplete'), undefined); // on - input = findNativeInput(shallow()); + let input = findNativeInput(shallow()); assert.equal(input.prop('autoComplete'), 'on'); + // off + input = findNativeInput(shallow()); + assert.equal(input.prop('autoComplete'), 'off'); }); test('prop "autoFocus"', () => { @@ -179,8 +179,8 @@ suite('components/TextInput', () => { const input = findNativeInput(mount()); input.simulate('select', { target: { selectionStart: 0, selectionEnd: 3 } }); function onSelectionChange(e) { - assert.equal(e.selectionEnd, 3); - assert.equal(e.selectionStart, 0); + assert.equal(e.nativeEvent.selection.end, 3); + assert.equal(e.nativeEvent.selection.start, 0); done(); } }); diff --git a/src/components/TextInput/index.js b/src/components/TextInput/index.js index 6f8d4877..9dc98b7f 100644 --- a/src/components/TextInput/index.js +++ b/src/components/TextInput/index.js @@ -79,11 +79,11 @@ class TextInput extends Component { placeholder: PropTypes.string, placeholderTextColor: PropTypes.string, secureTextEntry: PropTypes.bool, + selectTextOnFocus: PropTypes.bool, selection: PropTypes.shape({ start: PropTypes.number.isRequired, end: PropTypes.number }), - selectTextOnFocus: PropTypes.bool, style: Text.propTypes.style, testID: Text.propTypes.testID, value: PropTypes.string