Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NativeBase form inputs with floating labels can't be found #161

Open
AbigailMcP opened this issue Jan 3, 2020 · 0 comments
Open

NativeBase form inputs with floating labels can't be found #161

AbigailMcP opened this issue Jan 3, 2020 · 0 comments

Comments

@AbigailMcP
Copy link
Contributor

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)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant