@@ -44,7 +44,7 @@ components. It provides light utility functions on top of `react-dom` and
4444 * [ ` Simulate ` ] ( #simulate )
4545 * [ ` flushPromises ` ] ( #flushpromises )
4646 * [ ` render ` ] ( #render )
47- * [ More on ` data-test ` ids ] ( #more-on-data-test-ids )
47+ * [ More on ` data-testid ` s ] ( #more-on-data-testids )
4848* [ FAQ] ( #faq )
4949* [ Other Solutions] ( #other-solutions )
5050* [ Guiding Principles] ( #guiding-principles )
@@ -128,16 +128,16 @@ The containing DOM node of your rendered React Element (rendered using
128128
129129#### ` queryByTestId `
130130
131- A shortcut to `` container.querySelector(`[data-test ="${yourId}"]`) `` . Read
132- more about data-test ids below.
131+ A shortcut to `` container.querySelector(`[data-testid ="${yourId}"]`) `` . Read
132+ more about ` data-testid ` s below.
133133
134134``` javascript
135135const usernameInputElement = queryByTestId (' username-input' )
136136```
137137
138- ## More on ` data-test ` ids
138+ ## More on ` data-testid ` s
139139
140- The ` queryByTestId ` utility is referring to the practice of using ` data-test `
140+ The ` queryByTestId ` utility is referring to the practice of using ` data-testid `
141141attributes to identify individual elements in your rendered component. This is
142142one of the practices this library is intended to encourage.
143143
@@ -216,18 +216,18 @@ something more
216216Learn more about how Jest mocks work from my blog post:
217217[ "But really, what is a JavaScript mock?"] ( https://blog.kentcdodds.com/but-really-what-is-a-javascript-mock-10d060966f7d )
218218
219- ** I don't want to use ` data-test ` attributes for everything. Do I have to?**
219+ ** I don't want to use ` data-testid ` attributes for everything. Do I have to?**
220220
221- Definitely not. That said, a common reason people don't like the ` data-test `
221+ Definitely not. That said, a common reason people don't like the ` data-testid `
222222attribute is they're concerned about shipping that to production. I'd suggest
223223that you probably want some simple E2E tests that run in production on occasion
224- to make certain that things are working smoothly. In that case the ` data-test `
224+ to make certain that things are working smoothly. In that case the ` data-testid `
225225attributes will be very useful. Even if you don't run these in production, you
226226may want to run some E2E tests that run on the same code you're about to ship to
227- production. In that case, the ` data-test ` attributes will be valuable there as
227+ production. In that case, the ` data-testid ` attributes will be valuable there as
228228well.
229229
230- All that said, if you really don't want to ship ` data-test ` attributes, then you
230+ All that said, if you really don't want to ship ` data-testid ` attributes, then you
231231can use
232232[ this simple babel plugin] ( https://www.npmjs.com/package/babel-plugin-react-remove-properties )
233233to remove them.
0 commit comments