As discovered in issue #156 , adding the floatingLabel prop to a Native Base form <Item> makes the enclosed <Input> field undiscoverable by Cavy.
How to replicate
The component:
import { Form, Item, Label, Input } from 'native-base';
import { hook } from 'cavy';
class AuthScreen extends React.Component {
constructor(props) {
super(props);
this.state = {
someValue: '',
};
}
render() {
return (
<Form>
<Item floatingLabel>
<Label>Some Input</Label>
<Input
ref={this.props.generateTestHook('NativeBaseTextInput')}
onChangeText={(someValue) => this.setState({ someValue })}
/>
</Item>
</Form>
);
}
}
export default hook(AuthScreen);
The failing test:
export default function(spec) {
spec.describe('Logging in', function() {
spec.it('works', async function() {
await spec.findComponent('NativeBaseTextInput');
// findComponent times out
}
}
}
See comment posted by @PoetiCode for a starter: #156 (comment)
As discovered in issue #156 , adding the
floatingLabelprop to a Native Base form<Item>makes the enclosed<Input>field undiscoverable by Cavy.How to replicate
The component:
The failing test:
See comment posted by @PoetiCode for a starter: #156 (comment)