Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 bedata-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 standarddata-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 theButtons/
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 supportsdata-testid
(of course the library itself supports querying by lots of different things, but settingdata-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 ✨