import { configure } from '@testing-library/react'; configure({ testIdAttribute:…
- User
import { configure } from '@testing-library/react';
configure({ testIdAttribute: 'data-qa' }); why test try to find data-testid but not data-qa
- Assistant
The code snippet you've provided configures the Testing Library to use a different attribute (
data-qainstead of the defaultdata-testid) as the query selector for testing. However, if your tests are still trying to find elements using , there are a few reasons this might be happening: