Upgrade to Pro — share decks privately, control downloads, hide ads and more …

ReactDay 2022 - Unit testing

ReactDay 2022 - Unit testing

Luca Del Puppo

October 19, 2022
Tweet

More Decks by Luca Del Puppo

Other Decks in Programming

Transcript

  1. Ego Slide Luca Del Puppo (aka Puppo) Full-Stack Developer at

    Flowing a Claranet Italian Company @puppo92 https://www.linkedin.com/in/lucadelpuppo/ [email protected]
  2. Single Element Type of Query 0 Matches 1 Match >1

    Matches Retry (Async/Await) getBy... Throw error Return element Throw error No queryBy... Return null Return element Throw error No findBy... Throw error Return element Throw error Yes
  3. Multiple Elements Type of Query 0 Matches 1 Match >1

    Matches Retry (Async/Await) getAllBy... Throw error Return array Return array No queryAllBy... Return [] Return array Return array No findAllBy... Throw error Return array Return array Yes
  4. Query types - Queries Accessible to Everyone - getByRole -

    getByLabelText - getByPlaceholderText - getByText - getByDisplayValue - Semantic Queries - getByAltText (img, area, input) - getByTitle - Test IDs - getByTestId