Skip to content

Rename test to match components for simple referencing #216

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

Closed
travis5491811 opened this issue Apr 1, 2021 · 3 comments
Closed

Rename test to match components for simple referencing #216

travis5491811 opened this issue Apr 1, 2021 · 3 comments

Comments

@travis5491811
Copy link
Contributor

Hello,
I came here through https://testing-library.com/docs/vue-testing-library/examples because I was trying to see how good this might be for use with vue or nuxt. There were only 2 examples on the page and neither used props and the docs said to look at the examples in the repo for more.

While looking at the examples in the repo, I started by exploring components in https://github.com/testing-library/vue-testing-library/tree/master/src/__tests__/components and then once i found a component that had the structure I wanted to test, I went back looking for that component in the test folder, but the test names don't match the names of the components they are testing.

For example this test (simple-button.js) is for this button (Button.vue). Is there some reasoning behind not using naming conventions (button.js, Button.vue, fetch.js, Fetch.vue or fetch-axios-mock, Fetch.vue instead of axios-mock.js, Fetch.vue) that will make it straight forward for people new to the project to follow the examples?

@afontcu
Copy link
Member

afontcu commented Apr 2, 2021

Hi! Thank you for your feedback! There's no reasoning other than examples, tests, and components have been evolving differently and without clear structure :)

Form your comment, I see two main quick wins:

  1. Add some props to the main examples of testing-library.com. It is quite a common use case.
  2. Improve naming, and make sure test files match Vue components. This won't be so easy, because some dummy components are used in two different test files. Now, we could simply duplicate them.

Fancy to open up a PR fixing up some of these issues? :)

@travis5491811
Copy link
Contributor Author

@afontcu Yes, no problem. PR's added for 1 and 2.

@afontcu
Copy link
Member

afontcu commented May 8, 2021

Closing as this as names are already updated :) thanks!

@afontcu afontcu closed this as completed May 8, 2021
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