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

Uses different hooks method for fillIn #29

Closed
llaine opened this issue May 29, 2017 · 4 comments
Closed

Uses different hooks method for fillIn #29

llaine opened this issue May 29, 2017 · 4 comments

Comments

@llaine
Copy link

llaine commented May 29, 2017

Hello, this issue is more a question:
Is there a way to override the fillIn and press method with other function on the component?

Something like :

  async fillIn(identifier, str, fn: Function) {
    const component =  await this.findComponent(identifier);
    component.props[fn](str);
  }

I'm already overriding theses function in my component which makes cavy unusable with my codebase.
If I could have a way to pass the function to trigger the fillIn would be nice.

@llaine llaine changed the title Uses different hooks method. Uses different hooks method for fillIn May 29, 2017
@jalada
Copy link
Contributor

jalada commented Jun 1, 2017

Hi @llaine, you can write your own spec helper functions in a similar style to fillIn (making use of findComponent) to call whatever function you like, and then use those within your specs.

@jalada jalada closed this as completed Jun 1, 2017
@llaine
Copy link
Author

llaine commented Jun 1, 2017

Hello @jalada thanks for answering, any documentation or example on that ?

@jalada
Copy link
Contributor

jalada commented Jun 2, 2017

@llaine Not right now. That's a good suggestion though :) I've added an issue #33 to track that.

@llaine
Copy link
Author

llaine commented Jun 2, 2017

@jalada okay thanks, maybe you could give me some hints about the way to do it, I'm keen to document it if I can.

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

No branches or pull requests

2 participants