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

Updating contributing docs #38

Merged
merged 3 commits into from
May 18, 2020
Merged

Updating contributing docs #38

merged 3 commits into from
May 18, 2020

Conversation

weerd
Copy link
Contributor

@weerd weerd commented May 18, 2020

We are using Testing Library on Phoenix, which is a great little utility library that helps with writing better and easier to understand tests for web UIs.

This utility library comes with a helper method for querying elements called getByTestId() which is very helpful but requires the data label to be data-testid. This is very close to our current standard but not exact, so it's useful to note that we want to switch to using new standard data-testid for testing moving forward!

This came up in a recent ghost inspector test fix.

If you want to see more examples in Phoenix for this data-testid in use, you can check the Buttons/ directory and see the different button tests which currently utilize this.

I also make the recommendation that we should not use data-id anymore for testing purposes. The Testing Library helper method only supports data-testid (of course the library itself supports querying by lots of different things, but setting data-testid as the standard seems good to provide consistency).

I also cleaned up this contrib doc a bit and added a section on sibling element spacing ✨

Copy link
Contributor

@DFurnes DFurnes left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like it! 🆔

Copy link
Contributor

@katiecrane katiecrane left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I dig this!

@weerd weerd merged commit 161abaa into master May 18, 2020
@weerd weerd deleted the updating-contributing-docs branch May 18, 2020 17:09
@mendelB
Copy link
Contributor

mendelB commented May 18, 2020

👏love it!

@weerd weerd mentioned this pull request May 18, 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.

4 participants