From e8607c5d202c35c57a8cc45ff547a6d59c87e506 Mon Sep 17 00:00:00 2001 From: Paul Russo Date: Wed, 27 Nov 2019 16:22:00 -0700 Subject: [PATCH] Clarify testIdAttribute I was a bit confused while reading through these docs as to whether or not the value I supplied to `testIdAttribute` would be prefixed with `data-`. It turns out that the value is _not_ prefixed, and so `my-data-test-id` wouldn't be a valid `data-` attribute. This change replaces the current example `my-data-test-id` with `data-my-test-id`. --- docs/dom-testing-library/api-configuration.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/dom-testing-library/api-configuration.md b/docs/dom-testing-library/api-configuration.md index f8a096a70..66577ef74 100644 --- a/docs/dom-testing-library/api-configuration.md +++ b/docs/dom-testing-library/api-configuration.md @@ -29,7 +29,7 @@ and related queries. Defaults to `data-testid`. // setup-tests.js import { configure } from '@testing-library/dom' -configure({testIdAttribute: 'my-data-test-id'}) +configure({testIdAttribute: 'data-my-test-id'}) ``` @@ -38,7 +38,7 @@ configure({testIdAttribute: 'my-data-test-id'}) // setup-tests.js import { configure } from '@testing-library/react' -configure({testIdAttribute: 'my-data-test-id'}) +configure({testIdAttribute: 'data-my-test-id'}) ``` @@ -47,7 +47,7 @@ configure({testIdAttribute: 'my-data-test-id'}) // setup-tests.js import { configure } from '@testing-library/cypress' -configure({testIdAttribute: 'my-data-test-id'}) +configure({testIdAttribute: 'data-my-test-id'}) ```