mirror of
https://github.com/zoriya/react-native-web.git
synced 2026-08-15 18:45:06 +00:00
Fix tests
This commit is contained in:
@@ -22,12 +22,12 @@ const testIfDocumentIsFocused = (message, fn) => {
|
||||
|
||||
suite('components/TextInput', () => {
|
||||
test('prop "autoComplete"', () => {
|
||||
// off
|
||||
let input = findNativeInput(shallow(<TextInput />));
|
||||
assert.equal(input.prop('autoComplete'), undefined);
|
||||
// on
|
||||
input = findNativeInput(shallow(<TextInput autoComplete />));
|
||||
let input = findNativeInput(shallow(<TextInput />));
|
||||
assert.equal(input.prop('autoComplete'), 'on');
|
||||
// off
|
||||
input = findNativeInput(shallow(<TextInput autoComplete='off' />));
|
||||
assert.equal(input.prop('autoComplete'), 'off');
|
||||
});
|
||||
|
||||
test('prop "autoFocus"', () => {
|
||||
@@ -179,8 +179,8 @@ suite('components/TextInput', () => {
|
||||
const input = findNativeInput(mount(<TextInput defaultValue='12345' onSelectionChange={onSelectionChange} />));
|
||||
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();
|
||||
}
|
||||
});
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user