MCPcopy Create free account

hub / github.com/testing-library/jest-dom / functions

Functions182 in github.com/testing-library/jest-dom

↓ 33 callersFunctioncheckHtmlElement
(htmlElement, ...args)
src/utils.js:70
↓ 33 callersFunctionrender
(html)
src/__tests__/helpers/test-utils.js:3
↓ 26 callersFunctionqueryByTestId
src/__tests__/helpers/test-utils.js:6
↓ 15 callersFunctiongetMessage
( context, matcher, expectedLabel, expectedValue, receivedLabel, receivedValue, )
src/utils.js:129
↓ 9 callersMethodtoBeChecked
* @description * Assert whether the given element is checked. * * It accepts an `input` of type `checkbox` or `radio` and elements with
types/matchers.d.ts:456
↓ 9 callersMethodtoBeDisabled
* @description * Allows you to check whether an element is disabled from the user's perspective. * * Matches if the element is a form c
types/matchers.d.ts:126
↓ 9 callersMethodtoBeEmpty
* @deprecated * since v5.9.0 * @description * Assert whether an element has content or not. * @example * <span data-testid="n
types/matchers.d.ts:92
↓ 9 callersMethodtoBeEnabled
* @description * Allows you to check whether an element is not disabled from the user's perspective. * * Works like `not.toBeDisabled()
types/matchers.d.ts:146
↓ 9 callersMethodtoBeInTheDOM
* @deprecated * since v1.9.0 * @description * Assert whether a value is a DOM element, or not. Contrary to what its name implies, this
types/matchers.d.ts:37
↓ 9 callersMethodtoBeInTheDocument
* @description * Assert whether an element is present in the document or not. * @example * <svg data-testid="svg-element"></svg> *
types/matchers.d.ts:49
↓ 9 callersMethodtoBeInvalid
* @description * Check if a form element, or the entire `form`, is currently invalid. * * An `input`, `select`, `textarea`, or `form` e
types/matchers.d.ts:165
↓ 9 callersMethodtoBeRequired
* @description * This allows you to check if a form element is currently required. * * An element is required if it is having a `requir
types/matchers.d.ts:183
↓ 9 callersMethodtoBeValid
* @description * Allows you to check if a form element is currently required. * * An `input`, `select`, `textarea`, or `form` element i
types/matchers.d.ts:202
↓ 9 callersMethodtoBeVisible
* @description * This allows you to check if an element is currently visible to the user. * * An element is visible if **all** the foll
types/matchers.d.ts:76
↓ 9 callersMethodtoContainElement
* @description * Allows you to assert whether an element contains another element as a descendant or not. * @example * <span data-testi
types/matchers.d.ts:220
↓ 9 callersMethodtoContainHTML
* @description * Assert whether a string representing a HTML element is contained in another element. * @example * <span data-testid="p
types/matchers.d.ts:231
↓ 9 callersMethodtoHaveAccessibleDescription
* @description * This allows to assert that an element has the expected [accessible description](https://w3c.github.io/accname/). * * Y
types/matchers.d.ts:531
↓ 9 callersMethodtoHaveAccessibleName
* @description * This allows to assert that an element has the expected [accessible name](https://w3c.github.io/accname/). * It is useful, f
types/matchers.d.ts:603
↓ 9 callersMethodtoHaveAttribute
* @description * Allows you to check if a given element has an attribute or not. * * You can also optionally check that the attribute h
types/matchers.d.ts:254
↓ 9 callersMethodtoHaveClass
* @description * Check whether the given element has certain classes within its `class` attribute. * * You must provide at least one cl
types/matchers.d.ts:281
↓ 9 callersMethodtoHaveDescription
* @deprecated * since v5.14.1 * @description * Check the accessible description for an element. * This allows you to check whether
types/matchers.d.ts:505
↓ 9 callersMethodtoHaveDisplayValue
* @description * This allows you to check whether the given form element has the specified displayed value (the one the * end user will see)
types/matchers.d.ts:324
↓ 9 callersMethodtoHaveErrorMessage
* @deprecated * since v5.17.0 * * @description * Check whether the given element has an [ARIA error message](https://www.w3.org/TR
types/matchers.d.ts:725
↓ 9 callersMethodtoHaveFocus
* @description * Assert whether an element has focus or not. * @example * <div> * <input type="text" data-testid="element-to-foc
types/matchers.d.ts:341
↓ 9 callersMethodtoHaveFormValues
* @description * Check if a form or fieldset contains form controls for each given name, and having the specified value. * * Can only b
types/matchers.d.ts:362
↓ 9 callersMethodtoHaveStyle
* @description * Check if an element has specific css properties with specific values applied. * * Only matches if the element has *all
types/matchers.d.ts:385
↓ 9 callersMethodtoHaveTextContent
* @description * Check whether the given element has a text content or not. * * When a string argument is passed through, it will perfo
types/matchers.d.ts:409
↓ 9 callersMethodtoHaveValue
* @description * Check whether the given form element has the specified value. * * Accepts `<input>`, `<select>`, and `<textarea>` elem
types/matchers.d.ts:432
↓ 6 callersFunctiongetTag
(element)
src/utils.js:171
↓ 6 callersMethodtoHaveRole
* @description * This allows you to assert that an element has the expected * [role](https://www.w3.org/TR/html-aria/#docconformance).
types/matchers.d.ts:640
↓ 5 callersFunctiondeprecate
(name, replacementText)
src/utils.js:158
↓ 5 callersMethodtoBeEmptyDOMElement
* @description * Assert whether an element has content or not. * @example * <span data-testid="not-empty"> * <span data-testid="
types/matchers.d.ts:106
↓ 5 callersMethodtoBePartiallyChecked
* @description * This allows you to check whether the given element is partially checked. * It accepts an input of type checkbox and element
types/matchers.d.ts:682
↓ 5 callersMethodtoContainAnyByAltText
* @description * Assert whether an element contains one or more descendants with the specified alt text. * @example * <img alt="Image D
types/matchers.d.ts:883
↓ 5 callersMethodtoContainAnyByDisplayValue
* @description * Assert whether an element contains one or more descendants with the specified display value. * @example * <select><opt
types/matchers.d.ts:905
↓ 5 callersMethodtoContainAnyByLabelText
* @description * Assert whether an element contains one or more descendants with the specified label text. * @example * <label for="nam
types/matchers.d.ts:927
↓ 5 callersMethodtoContainAnyByPlaceholderText
* @description * Assert whether an element contains one or more descendants with the specified placeholder text. * @example * <input pl
types/matchers.d.ts:949
↓ 5 callersMethodtoContainAnyByRole
* @description * Assert whether an element contains one or more descendants with the specified role. * @example * <div role="alert">Som
types/matchers.d.ts:971
↓ 5 callersMethodtoContainAnyByTestId
* @description * Assert whether an element contains one or more descendants with the specified test ID. * @example * <div data-testid="
types/matchers.d.ts:993
↓ 5 callersMethodtoContainAnyByText
* @description * Assert whether an element contains one or more descendants with the specified text. * @example * <span>Hello world</sp
types/matchers.d.ts:1015
↓ 5 callersMethodtoContainAnyByTitle
* @description * Assert whether an element contains one or more descendants with the specified title. * @example * <h1 title="Page titl
types/matchers.d.ts:1037
↓ 5 callersMethodtoContainOneByAltText
* @description * Assert whether an element contains exactly one descendant with the specified alt text. * @example * <img alt="Image De
types/matchers.d.ts:894
↓ 5 callersMethodtoContainOneByDisplayValue
* @description * Assert whether an element contains exactly one descendant with the specified display value. * @example * <select><opti
types/matchers.d.ts:916
↓ 5 callersMethodtoContainOneByLabelText
* @description * Assert whether an element contains exactly one descendant with the specified label text. * @example * <label for="name
types/matchers.d.ts:938
↓ 5 callersMethodtoContainOneByPlaceholderText
* @description * Assert whether an element contains exactly one descendant with the specified placeholder text. * @example * <input pla
types/matchers.d.ts:960
↓ 5 callersMethodtoContainOneByRole
* @description * Assert whether an element contains exactly one descendant with the specified role. * @example * <div role="alert">Some
types/matchers.d.ts:982
↓ 5 callersMethodtoContainOneByTestId
* @description * Assert whether an element contains exactly one descendant with the specified test ID. * @example * <div data-testid="a
types/matchers.d.ts:1004
↓ 5 callersMethodtoContainOneByText
* @description * Assert whether an element contains exactly one descendant with the specified text. * @example * <span>Hello world</spa
types/matchers.d.ts:1026
↓ 5 callersMethodtoContainOneByTitle
* @description * Assert whether an element contains exactly one descendant with the specified title. * @example * <h1 title="Page title
types/matchers.d.ts:1048
↓ 5 callersMethodtoHaveAccessibleErrorMessage
* @description * This allows you to assert that an element has the expected * [accessible error message](https://w3c.github.io/aria/#aria-er
types/matchers.d.ts:571
↓ 4 callersFunctionnormalize
(text)
src/utils.js:167
↓ 3 callersFunctioncompareAsSet
(val1, val2)
src/utils.js:233
↓ 3 callersFunctionrenderList
(items, mapper)
src/__tests__/to-have-form-values.js:349
↓ 2 callersFunctioncanElementBeDisabled
(element)
src/to-be-disabled.js:47
↓ 2 callersFunctioncheckHasWindow
(htmlElement, ErrorClass, ...args)
src/utils.js:51
↓ 2 callersFunctioncheckNode
(node, ...args)
src/utils.js:61
↓ 2 callersFunctioncheckToAppear
(methodName, targetDocumentPosition)
src/to-appear-before.js:30
↓ 2 callersFunctiongetSingleElementValue
(element)
src/utils.js:207
↓ 2 callersFunctionisElementDisabled
(element)
src/to-be-disabled.js:52
↓ 2 callersFunctionisElementInvalid
(element)
src/to-be-invalid.js:16
↓ 2 callersFunctionisElementOrAncestorDisabled
(element)
src/to-be-disabled.js:64
↓ 2 callersFunctionisSelected
(value, option)
src/__tests__/to-have-form-values.js:266
↓ 2 callersFunctionisValidInput
()
src/to-be-checked.js:7
↓ 2 callersFunctionisValidInput
()
src/to-be-partially-checked.js:6
↓ 2 callersFunctionmatch
(element)
src/to-have-role.js:103
↓ 2 callersFunctionrenderSelect
(name, label, options, value, multiple)
src/__tests__/to-have-form-values.js:316
↓ 2 callersFunctiontoSentence
( array, {wordConnector = ', ', lastWordConnector = ' and '} = {}, )
src/utils.js:224
↓ 1 callersFunctionasFragment
()
src/__tests__/helpers/test-utils.js:9
↓ 1 callersFunctionbuildElementRoleList
* Transform the roles map (with required attributes and constraints) to a list * of roles. Each item in the list has functions to match an element ag
src/to-have-role.js:76
↓ 1 callersFunctioncreateQueryMatcher
* Factory that creates an expect matcher function for the given DOM query. * @param {'Any'|'One'} quantity Whether to match any or one element. * @p
src/query-matchers.js:40
↓ 1 callersFunctioncustomExpect
( _actual: HTMLElement, )
types/__tests__/jest/jest-custom-expect-types.test.ts:15
↓ 1 callersFunctioncustomExpect
( _actual: HTMLElement, )
types/__tests__/jest-globals/jest-globals-custom-expect-types.test.ts:16
↓ 1 callersFunctioncustomExpect
( _actual: HTMLElement, )
types/__tests__/vitest/vitest-custom-expect-types.test.ts:16
↓ 1 callersFunctioncustomExpect
( _actual: HTMLElement, )
types/__tests__/bun/bun-custom-expect-types.test.ts:17
↓ 1 callersFunctiondisplay
(context, value)
src/utils.js:125
↓ 1 callersFunctionerrorFound
()
src/to-be-in-the-document.js:13
↓ 1 callersFunctionerrorNotFound
()
src/to-be-in-the-document.js:18
↓ 1 callersFunctionexpectedDiff
(diffFn, expected, computedStyles)
src/to-have-style.js:43
↓ 1 callersFunctiongetAccessibleValue
(element)
src/utils.js:200
↓ 1 callersFunctiongetAllFormValues
(container)
src/to-have-form-values.js:51
↓ 1 callersFunctiongetAttributeComment
(stringify, name, value)
src/to-have-attribute.js:7
↓ 1 callersFunctiongetDOMElement
(htmlString, selector)
src/__tests__/to-be-invalid.js:22
↓ 1 callersFunctiongetExpectedClassNamesAndOptions
(params)
src/to-have-class.js:3
↓ 1 callersFunctiongetExpectedValues
(expectedValue)
src/to-have-display-value.js:59
↓ 1 callersFunctiongetExplicitOrImplicitRoles
(htmlElement)
src/to-have-role.js:33
↓ 1 callersFunctiongetFormValue
(container, name)
src/to-have-form-values.js:32
↓ 1 callersFunctiongetImplicitAriaRoles
(currentNode)
src/to-have-role.js:51
↓ 1 callersFunctiongetInputValue
(inputElement)
src/utils.js:188
↓ 1 callersFunctiongetMultiElementValue
(elements)
src/to-have-form-values.js:10
↓ 1 callersFunctiongetNormalizedHtml
(container, htmlText)
src/to-contain-html.js:3
↓ 1 callersFunctiongetPureName
(name)
src/to-have-form-values.js:47
↓ 1 callersFunctiongetSelectValue
({multiple, options})
src/utils.js:175
↓ 1 callersFunctiongetSelection
* Returns the selection from the element. * * @param element {HTMLElement} The element to get the selection from. * @returns {String} The selection
src/to-have-selection.js:9
↓ 1 callersFunctiongetSelectorSpecificity
({attributes = []})
src/to-have-role.js:92
↓ 1 callersFunctiongetStyleDeclaration
(document, css)
src/to-have-style.js:4
↓ 1 callersFunctiongetValues
(tagName, htmlElement)
src/to-have-display-value.js:51
↓ 1 callersFunctionisAncestorDisabled
(element)
src/to-be-disabled.js:56
↓ 1 callersFunctionisAttributeVisible
(element, previousElement)
src/to-be-visible.js:16
↓ 1 callersFunctionisChecked
()
src/to-be-checked.js:29
↓ 1 callersFunctionisCustomElement
(tag)
src/to-be-disabled.js:39
next →1–100 of 182, ranked by callers