Implement foundation for the solution approved in RFC 52: Find by ref to Find by text
Task
After the discussion and subsequent approval of RFC: gitlab-org/frontend/rfcs#52 (closed), we need to take some foundation steps to allow this solution to be used by the Frontend team at large.
Change pattern proposal: Find by ref/class/component to Find by text where possible
Old Pattern
In Frontend unit tests we reference dom elements in the following ways:
wrapper.find(Component)
wrapper.find({ name: 'some-name' })
wrapper.find({ ref: 'some-ref' })
wrapper.find('.css-class')
New Pattern
Except for finding by Component
use the following
getByText(/submit issue/i)
getByLabelText('Assignee')
How
- Adding
dom-testing-library
- Use it in one scenario
- Update technical docs to reflect this guideline
Edited by André Luís