OrderNot attempted
Query priority
Order Testing Library queries from MOST to LEAST preferred.
Drag the rows, or use the arrows, to put them in order from first to last.
getByTestIdgetByTextgetByLabelTextgetByRole(withname)
Show answer & explanation
Correct order:
getByRole(withname)getByLabelTextgetByTextgetByTestId
Role queries match how assistive technology sees the page, so they double as accessibility checks. Labels come next for form fields, then visible text. Test ids are invisible to users, so they're a last resort.