Put in order · JavaScript and React course · Module 13: Testing React

Selector priority from best to worst

Arrange RTL selectors from highest priority (best) to lowest:

Items to put in order

  • getByTestId
  • getByLabelText
  • getByText
  • getByRole

You can check the correct answer by solving this task in the CodeWorlds game.