Skip to content
masterclassBuddyTech Buzz5 fresh blogs · 5:00 AM IST

API reference

React Testing Library API reference

React Testing Library

Identifiers
104
With full guides
0
Types
4

Topics covered

  • getBy / findBy queries
  • user-event
  • Async UI testing
  • Mocking fetch
  • Testing hooks
  • Accessibility queries
  • Testing forms
  • Best practices

Function

NameWhat it does
renderFunction
fireEventFunction
waitForFunction
withinFunction
getByRoleFunction
getByTextFunction
findByTextFunction
queryByTextFunction
renderHookFunction
getByLabelTextFunction
getByPlaceholderTextFunction
getByTestIdFunction
queryByRoleFunction
findByRoleFunction
waitForElementToBeRemovedFunction
actFunction
cleanupFunction
prettyDOMFunction
configureFunction
logRolesFunction
getDefaultNormalizerFunction
getRolesFunction
getNodeTextFunction

Const

NameWhat it does
screenConst
userEventConst

Module

NameWhat it does
getByAltTextModule
getByTitleModule
getByDisplayValueModule
queryByLabelTextModule
queryByTestIdModule
findByLabelTextModule
findByTestIdModule
getAllByRoleModule
getAllByTextModule
queryAllByRoleModule
findAllByRoleModule
getAllByTestIdModule
userEvent.setupModule
userEvent.clickModule
userEvent.dblClickModule
userEvent.typeModule
userEvent.keyboardModule
userEvent.clearModule
userEvent.selectOptionsModule
userEvent.deselectOptionsModule
userEvent.uploadModule
userEvent.hoverModule
userEvent.unhoverModule
userEvent.tabModule
userEvent.pasteModule
userEvent.pointerModule
fireEvent.clickModule
fireEvent.changeModule
fireEvent.submitModule
fireEvent.keyDownModule
fireEvent.keyUpModule
fireEvent.focusModule
fireEvent.blurModule
fireEvent.mouseOverModule
fireEvent.mouseEnterModule
fireEvent.inputModule
toBeInTheDocumentModule
toBeVisibleModule
toBeDisabledModule
toBeEnabledModule
toBeCheckedModule
toBeRequiredModule
toBeValidModule
toBeInvalidModule
toHaveValueModule
toHaveTextContentModule
toHaveClassModule
toHaveAttributeModule
toHaveStyleModule
toHaveFocusModule
toContainElementModule
toContainHTMLModule
toHaveAccessibleNameModule
toHaveAccessibleDescriptionModule
toBeEmptyDOMElementModule
toHaveDisplayValueModule
toHaveFormValuesModule
toBePartiallyCheckedModule
queryByAltTextModule
queryByTitleModule
queryByDisplayValueModule
queryByPlaceholderTextModule
findByAltTextModule
findByPlaceholderTextModule
getAllByLabelTextModule
getAllByPlaceholderTextModule
getAllByAltTextModule
getAllByTitleModule
getAllByDisplayValueModule
fireEvent.scrollModule
fireEvent.dropModule
fireEvent.pasteModule
fireEvent.contextMenuModule

Pipe

NameWhat it does
containerPipe
rerenderPipe
unmountPipe
asFragmentPipe
baseElementPipe
debugPipe

Search across every package and filter by type in your dashboard.

Start learning