Soundorv0.13.0

ByLabelText

Finds nodes by their accessibility label.

screen.getByLabelText(text: TextMatch, options?: MatchOptions): TestNode;
// also queryByLabelText, getAllByLabelText, queryAllByLabelText, findByLabelText, findAllByLabelText

Finds nodes by their accessibilityLabel: a text input called "Preset name", a knob called "Gain".

await user.type(screen.getByLabelText('Preset name'), 'Warm');

Good to know

  • Only accessibilityLabel labels a node: there is no HTML <label> association in Soundor.
  • Prefer ByRole with a name when the role matters too: getByRole('textinput', { name: 'Preset name' }).
  • Options as for every query.

On this page