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

fix #1477 Note exception to chaining find calls #1481

Merged
merged 2 commits into from
Mar 26, 2020
Merged

fix #1477 Note exception to chaining find calls #1481

merged 2 commits into from
Mar 26, 2020

Conversation

unclejustin
Copy link
Contributor

Make it clear that when chaining find calls, you can only use DOM selectors.

What kind of change does this PR introduce? (check at least one)

  • Bugfix
  • Feature
  • Code style update
  • Refactor
  • Build-related changes
  • Other, please describe: Docs update

Does this PR introduce a breaking change? (check one)

  • Yes
  • No

If yes, please describe the impact and migration path for existing applications:

The PR fulfills these requirements:

If adding a new feature, the PR's description includes:

  • [-] A convincing reason for adding this feature (to avoid wasting your time, it's best to open a suggestion issue first and wait for approval before working on it)

Other information:

@JessicaSachs
Copy link
Collaborator

Nice. Thank you. Can you run the formatter for the docs? yarn format

@unclejustin
Copy link
Contributor Author

Whoops! My bad, thanks @JessicaSachs formatted and pushed.

Make it clear that when chaining find calls, you can only use DOM selectors.
@lmiller1990
Copy link
Member

lmiller1990 commented Mar 23, 2020

Why is this the case? I would have thought find returns a wrapper which should let you use find with any kind of selector. Interesting. Good catch. I wonder if we should totally disallow multiple find calls entirely, if it doesn't cover all the cases.

Can you remove the generated dist files? We don't commit those - those are generated when the next version of the package is published to npm (which will be soon with all the PRs that were merged lately).

@Stoom
Copy link
Contributor

Stoom commented Mar 25, 2020

I've used multiple find calls in the past to split things up in my testing:

describe('SomeComponent.vue', () => {
  let button;
  beforeEach(() => {
    button = wrapper.find('button-stub');
  });

  it('Should have an icon', () => {
    const icon = button.find('icon-stub');
    expect(icon.exists()).to.be.true;
  });
});

So this is minimal, but if I had multiple tests on the button then it's cleaner for me to do that outside of each it block.

@lmiller1990
Copy link
Member

@Stoom good point. Would be good to figure out why this is the case and fix.

@lmiller1990 lmiller1990 merged commit 9d5b642 into vuejs:dev Mar 26, 2020
@Stoom Stoom mentioned this pull request Mar 27, 2020
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

Successfully merging this pull request may close these issues.

None yet

4 participants