diff --git a/definitions/npm/@testing-library/react_v11.x.x/flow_v0.104.x-/react_v11.x.x.js b/definitions/npm/@testing-library/react_v11.x.x/flow_v0.104.x-/react_v11.x.x.js index 094c5afb08..5391dad5bb 100644 --- a/definitions/npm/@testing-library/react_v11.x.x/flow_v0.104.x-/react_v11.x.x.js +++ b/definitions/npm/@testing-library/react_v11.x.x/flow_v0.104.x-/react_v11.x.x.js @@ -2,7 +2,7 @@ * A local copy from: * https://github.com/A11yance/aria-query/blob/2e6a3011a0d8987655f3a14853934fe3df38a8d8/flow/aria.js */ -declare module '@@aria-query' { + declare module '@@aria-query' { declare export type ARIAAbstractRole = | 'command' | 'composite' @@ -257,86 +257,102 @@ declare module '@testing-library/react' { selector?: string, |}; + // These two types must be updated kept in sync + declare export type UnionHTMLElement = + | HTMLElement + | HTMLInputElement + | HTMLAnchorElement + | HTMLButtonElement + | HTMLSelectElement; + + declare export type IntersectionHTMLElement = + & HTMLElement + & HTMLInputElement + & HTMLAnchorElement + & HTMLButtonElement + & HTMLSelectElement; + // End mixed html types + declare type QueryByBoundAttribute = ( text: Matcher, options?: MatcherOptions - ) => ?HTMLElement; + ) => ?IntersectionHTMLElement; declare type AllByBoundAttribute = ( text: Matcher, options?: MatcherOptions - ) => Array; + ) => Array; declare type FindAllByBoundAttribute = ( text: Matcher, options?: MatcherOptions, waitForElementOptions?: WaitForOptions - ) => Promise; + ) => Promise; declare type GetByBoundAttribute = ( text: Matcher, options?: MatcherOptions - ) => HTMLElement; + ) => IntersectionHTMLElement; declare type FindByBoundAttribute = ( text: Matcher, options?: MatcherOptions, waitForElementOptions?: WaitForOptions - ) => Promise; + ) => Promise; declare type QueryByText = ( text: Matcher, options?: SelectorMatcherOptions - ) => ?HTMLElement; + ) => ?IntersectionHTMLElement; declare type AllByText = ( text: Matcher, options?: SelectorMatcherOptions - ) => Array; + ) => Array; declare type FindAllByText = ( text: Matcher, options?: SelectorMatcherOptions, waitForElementOptions?: WaitForOptions - ) => Promise; + ) => Promise; declare type GetByText = ( text: Matcher, options?: SelectorMatcherOptions - ) => HTMLElement; + ) => IntersectionHTMLElement; declare type FindByText = ( text: Matcher, options?: SelectorMatcherOptions, waitForElementOptions?: WaitForOptions - ) => Promise; + ) => Promise; declare type AllByRole = ( role: ByRoleMatcher, options?: ByRoleOptions - ) => HTMLElement[]; + ) => IntersectionHTMLElement[]; declare type GetByRole = ( role: ByRoleMatcher, options?: ByRoleOptions - ) => HTMLElement; + ) => IntersectionHTMLElement; declare type QueryByRole = ( role: ByRoleMatcher, options?: ByRoleOptions - ) => HTMLElement | null; + ) => IntersectionHTMLElement | null; declare type FindByRole = ( role: ByRoleMatcher, options?: ByRoleOptions, waitForElementOptions?: WaitForOptions - ) => Promise; + ) => Promise; declare type FindAllByRole = ( role: ByRoleMatcher, options?: ByRoleOptions, waitForElementOptions?: WaitForOptions - ) => Promise; + ) => Promise; declare type GetsAndQueries = {| getByLabelText: GetByText, @@ -397,7 +413,7 @@ declare module '@testing-library/react' { |}; declare type FireEvent = ( - element: HTMLElement, + element: UnionHTMLElement, eventProperties?: TInit ) => boolean; @@ -474,7 +490,7 @@ declare module '@testing-library/react' { declare export function waitFor( callback: () => T | Promise, options?: {| - container?: HTMLElement, + container?: UnionHTMLElement, timeout?: number, interval?: number, mutationObserverOptions?: MutationObserverInit, @@ -484,7 +500,7 @@ declare module '@testing-library/react' { declare export function waitForElementToBeRemoved( callback: (() => T) | T, options?: {| - container?: HTMLElement, + container?: UnionHTMLElement, timeout?: number, interval?: number, mutationObserverOptions?: MutationObserverInit, @@ -496,7 +512,7 @@ declare module '@testing-library/react' { * In most cases you should be able to find/replace `wait` with `waitFor`. * Learn more: https://testing-library.com/docs/dom-testing-library/api-async#waitfor. */ - declare export function wait( + declare export function wait( callback?: () => void, options?: { timeout?: number, @@ -510,7 +526,7 @@ declare module '@testing-library/react' { * Use `waitFor` instead: https://testing-library.com/docs/dom-testing-library/api-async#waitfor. */ declare export function waitForDomChange(options?: { - container?: HTMLElement, + container?: UnionHTMLElement, timeout?: number, mutationObserverOptions?: MutationObserverInit, ... @@ -524,7 +540,7 @@ declare module '@testing-library/react' { declare export function waitForElement( callback?: () => T, options?: { - container?: HTMLElement, + container?: UnionHTMLElement, timeout?: number, mutationObserverOptions?: MutationObserverInit, ... @@ -532,12 +548,12 @@ declare module '@testing-library/react' { ): Promise; declare export function within( - element: HTMLElement, + element: UnionHTMLElement, queriesToBind?: GetsAndQueries | Array ): GetsAndQueries; declare export var fireEvent: {| - (element: HTMLElement, event: Event): void, + (element: UnionHTMLElement, event: Event): void, copy: FireEvent, cut: FireEvent, @@ -611,55 +627,55 @@ declare module '@testing-library/react' { |}; // dom-testing-library re-declares declare export function queryByTestId( - container: HTMLElement, + container: UnionHTMLElement, id: Matcher, options?: MatcherOptions - ): ?HTMLElement; + ): ?IntersectionHTMLElement; declare export function getByTestId( - container: HTMLElement, + container: UnionHTMLElement, id: Matcher, options?: MatcherOptions - ): HTMLElement; + ): IntersectionHTMLElement; declare export function queryByText( - container: HTMLElement, + container: UnionHTMLElement, text: Matcher, options?: MatcherOptions - ): ?HTMLElement; + ): ?IntersectionHTMLElement; declare export function getByText( - container: HTMLElement, + container: UnionHTMLElement, text: Matcher, options?: { selector?: string, ... } & MatcherOptions - ): HTMLElement; + ): IntersectionHTMLElement; declare export function queryByPlaceholderText( - container: HTMLElement, + container: UnionHTMLElement, text: Matcher, options?: MatcherOptions - ): ?HTMLElement; + ): ?IntersectionHTMLElement; declare export function getByPlaceholderText( - container: HTMLElement, + container: UnionHTMLElement, text: Matcher, options?: MatcherOptions - ): HTMLElement; + ): IntersectionHTMLElement; declare export function queryByLabelText( - container: HTMLElement, + container: UnionHTMLElement, text: Matcher, options?: MatcherOptions - ): ?HTMLElement; + ): ?IntersectionHTMLElement; declare export function getByLabelText( - container: HTMLElement, + container: UnionHTMLElement, text: Matcher, options?: { selector?: string, ... } & MatcherOptions - ): HTMLElement; + ): IntersectionHTMLElement; declare export function queryByAltText( - container: HTMLElement, + container: UnionHTMLElement, text: Matcher, options?: MatcherOptions - ): ?HTMLElement; + ): ?IntersectionHTMLElement; declare export function getByAltText( - container: HTMLElement, + container: UnionHTMLElement, text: Matcher, options?: MatcherOptions - ): HTMLElement; - declare export function getNodeText(node: HTMLElement): string; + ): IntersectionHTMLElement; + declare export function getNodeText(node: UnionHTMLElement): string; declare export var screen: Screen<>; } diff --git a/definitions/npm/@testing-library/react_v11.x.x/flow_v0.104.x-/test_react_v11.x.x.js b/definitions/npm/@testing-library/react_v11.x.x/flow_v0.104.x-/test_react_v11.x.x.js index 60fe1c208b..d785817fbd 100644 --- a/definitions/npm/@testing-library/react_v11.x.x/flow_v0.104.x-/test_react_v11.x.x.js +++ b/definitions/npm/@testing-library/react_v11.x.x/flow_v0.104.x-/test_react_v11.x.x.js @@ -13,6 +13,7 @@ import { within, screen, getNodeText, + type IntersectionHTMLElement, } from '@testing-library/react'; import { describe, it } from 'flow-typed-test'; @@ -217,7 +218,7 @@ describe('render', () => { it('asFragment should return a document fragment', () => { // $FlowExpectedError[incompatible-type] - const a: HTMLElement = asFragment(); + const a: IntersectionHTMLElement = asFragment(); const b: DocumentFragment = asFragment(); }); @@ -234,277 +235,284 @@ describe('render', () => { }); it('getByAltText should return HTML element', () => { - const a: HTMLElement = getByAltText('1'); + const a: IntersectionHTMLElement = getByAltText('1'); }); it('getAllByAltText should return array of HTML element', () => { // $FlowExpectedError[incompatible-type] - const a: HTMLElement = getAllByAltText('1'); - const b: Array = getAllByAltText('2'); + const a: IntersectionHTMLElement = getAllByAltText('1'); + const b: Array = getAllByAltText('2'); }); it('queryByAltText should return maybe HTML element', () => { // $FlowExpectedError[incompatible-type] - const a: HTMLElement = queryByAltText('1'); - const b: ?HTMLElement = queryByAltText('2'); + const a: IntersectionHTMLElement = queryByAltText('1'); + const b: ?IntersectionHTMLElement = queryByAltText('2'); }); it('queryAllByAltText should return array of HTML element', () => { // $FlowExpectedError[incompatible-type] - const a: HTMLElement = queryAllByAltText('1'); - const b: Array = queryAllByAltText('2'); + const a: IntersectionHTMLElement = queryAllByAltText('1'); + const b: Array = queryAllByAltText('2'); }); it('findByAltText should return HTML element', () => { // $FlowExpectedError[incompatible-type] - const a: HTMLElement = findByAltText('1'); - const b: Promise = findByAltText('1'); + const a: IntersectionHTMLElement = findByAltText('1'); + const b: Promise = findByAltText('1'); }); it('findAllByAltText should return array of HTML element', () => { // $FlowExpectedError[incompatible-type-arg] - const a: Promise = findAllByAltText('1'); - const b: Promise> = findAllByAltText('2'); + const a: Promise = findAllByAltText('1'); + const b: Promise> = findAllByAltText('2'); }); it('getByDisplayValue should return HTML element', () => { - const a: HTMLElement = getByDisplayValue('1'); + const a: IntersectionHTMLElement = getByDisplayValue('1'); }); it('getAllByDisplayValue should return array of HTML element', () => { // $FlowExpectedError[incompatible-type] - const a: HTMLElement = getAllByDisplayValue('1'); - const b: Array = getAllByDisplayValue('2'); + const a: IntersectionHTMLElement = getAllByDisplayValue('1'); + const b: Array = getAllByDisplayValue('2'); }); it('queryByDisplayValue should return maybe HTML element', () => { // $FlowExpectedError[incompatible-type] - const a: HTMLElement = queryByDisplayValue('1'); - const b: ?HTMLElement = queryByDisplayValue('2'); + const a: IntersectionHTMLElement = queryByDisplayValue('1'); + const b: ?IntersectionHTMLElement = queryByDisplayValue('2'); }); it('queryAllByDisplayValue should return array of HTML element', () => { // $FlowExpectedError[incompatible-type] - const a: HTMLElement = queryAllByDisplayValue('1'); - const b: Array = queryAllByDisplayValue('2'); + const a: IntersectionHTMLElement = queryAllByDisplayValue('1'); + const b: Array = queryAllByDisplayValue('2'); }); it('findByDisplayValue should return HTML element', () => { // $FlowExpectedError[incompatible-type] - const a: HTMLElement = findByDisplayValue('1'); - const b: Promise = findByDisplayValue('1'); + const a: IntersectionHTMLElement = findByDisplayValue('1'); + const b: Promise = findByDisplayValue('1'); }); it('findAllByDisplayValue should return array of HTML element', () => { // $FlowExpectedError[incompatible-type-arg] - const a: Promise = findAllByDisplayValue('1'); - const b: Promise> = findAllByDisplayValue('2'); + const a: Promise = findAllByDisplayValue('1'); + const b: Promise> = findAllByDisplayValue('2'); }); it('getByLabelText should return HTML element', () => { - const a: HTMLElement = getByLabelText('1'); + const a: IntersectionHTMLElement = getByLabelText('1'); }); it('getAllByLabelText should return array of HTML element', () => { // $FlowExpectedError[incompatible-type] - const a: HTMLElement = getAllByLabelText('1'); - const b: Array = getAllByLabelText('2'); + const a: IntersectionHTMLElement = getAllByLabelText('1'); + const b: Array = getAllByLabelText('2'); }); it('queryByLabelText should return maybe HTML element', () => { // $FlowExpectedError[incompatible-type] - const a: HTMLElement = queryByLabelText('1'); - const b: ?HTMLElement = queryByLabelText('2'); + const a: IntersectionHTMLElement = queryByLabelText('1'); + const b: ?IntersectionHTMLElement = queryByLabelText('2'); }); it('queryAllByLabelText should return array of HTML element', () => { // $FlowExpectedError[incompatible-type] - const a: HTMLElement = queryAllByLabelText('1'); - const b: Array = queryAllByLabelText('2'); + const a: IntersectionHTMLElement = queryAllByLabelText('1'); + const b: Array = queryAllByLabelText('2'); }); it('findByLabelText should return HTML element', () => { // $FlowExpectedError[incompatible-type] - const a: HTMLElement = findByLabelText('1'); - const b: Promise = findByLabelText('1'); + const a: IntersectionHTMLElement = findByLabelText('1'); + const b: Promise = findByLabelText('1'); }); it('findAllByLabelText should return array of HTML element', () => { // $FlowExpectedError[incompatible-type-arg] - const a: Promise = findAllByLabelText('1'); - const b: Promise> = findAllByLabelText('2'); + const a: Promise = findAllByLabelText('1'); + const b: Promise> = findAllByLabelText('2'); }); it('getByPlaceholderText should return HTML element', () => { - const a: HTMLElement = getByPlaceholderText('1'); + const a: IntersectionHTMLElement = getByPlaceholderText('1'); }); it('getAllByPlaceholderText should return array of HTML element', () => { // $FlowExpectedError[incompatible-type] - const a: HTMLElement = getAllByPlaceholderText('1'); - const b: Array = getAllByPlaceholderText('2'); + const a: IntersectionHTMLElement = getAllByPlaceholderText('1'); + const b: Array = getAllByPlaceholderText('2'); }); it('queryByPlaceholderText should return maybe HTML element', () => { // $FlowExpectedError[incompatible-type] - const a: HTMLElement = queryByPlaceholderText('1'); - const b: ?HTMLElement = queryByPlaceholderText('2'); + const a: IntersectionHTMLElement = queryByPlaceholderText('1'); + const b: ?IntersectionHTMLElement = queryByPlaceholderText('2'); }); it('queryAllByPlaceholderText should return array of HTML element', () => { // $FlowExpectedError[incompatible-type] - const a: HTMLElement = queryAllByPlaceholderText('1'); - const b: Array = queryAllByPlaceholderText('2'); + const a: IntersectionHTMLElement = queryAllByPlaceholderText('1'); + const b: Array = queryAllByPlaceholderText('2'); }); it('findByPlaceholderText should return HTML element', () => { // $FlowExpectedError[incompatible-type] - const a: HTMLElement = findByPlaceholderText('1'); - const b: Promise = findByPlaceholderText('1'); + const a: IntersectionHTMLElement = findByPlaceholderText('1'); + const b: Promise = findByPlaceholderText('1'); }); it('findAllByPlaceholderText should return array of HTML element', () => { // $FlowExpectedError[incompatible-type-arg] - const a: Promise = findAllByPlaceholderText('1'); - const b: Promise> = findAllByPlaceholderText('2'); + const a: Promise = findAllByPlaceholderText('1'); + const b: Promise> = findAllByPlaceholderText('2'); }); it('getByRole should return HTML element', () => { // $FlowExpectedError[incompatible-type] const a: string = getByRole('button'); - const b: HTMLElement = getByRole('button'); + const b: IntersectionHTMLElement = getByRole('button'); }); it('getAllByRole should return array of HTML element', () => { // $FlowExpectedError[incompatible-type] - const a: HTMLElement = getAllByRole('button'); - const b: Array = getAllByRole('button'); + const a: IntersectionHTMLElement = getAllByRole('button'); + const b: Array = getAllByRole('button'); }); it('queryByRole should return maybe HTML element', () => { // $FlowExpectedError[incompatible-type] - const a: HTMLElement = queryByRole('button'); - const b: ?HTMLElement = queryByRole('button'); + const a: IntersectionHTMLElement = queryByRole('button'); + const b: ?IntersectionHTMLElement = queryByRole('button'); }); it('queryAllByRole should return array of HTML element', () => { // $FlowExpectedError[incompatible-type] - const a: HTMLElement = queryAllByRole('button'); - const b: Array = queryAllByRole('button'); + const a: IntersectionHTMLElement = queryAllByRole('button'); + const b: Array = queryAllByRole('button'); }); it('findByRole should return HTML element', () => { // $FlowExpectedError[incompatible-type] - const a: HTMLElement = findByRole('button'); - const b: Promise = findByRole('button'); + const a: IntersectionHTMLElement = findByRole('button'); + const b: Promise = findByRole('button'); }); it('findAllByRole should return array of HTML element', () => { // $FlowExpectedError[incompatible-type-arg] - const a: Promise = findAllByRole('button'); - const b: Promise> = findAllByRole('button'); + const a: Promise = findAllByRole('button'); + const b: Promise> = findAllByRole('button'); }); it('getByTestId should return HTML element', () => { - const a: HTMLElement = getByTestId('1'); + const a: IntersectionHTMLElement = getByTestId('1'); + }); + + it('getByTestId returns a mixed HTML type', () => { + const a = getByTestId('1'); + a.value; + a.disabled; + a.href; }); it('getAllByTestId should return array of HTML element', () => { // $FlowExpectedError[incompatible-type] - const a: HTMLElement = getAllByTestId('1'); - const b: Array = getAllByTestId('2'); + const a: IntersectionHTMLElement = getAllByTestId('1'); + const b: Array = getAllByTestId('2'); }); it('queryByTestId should return maybe HTML element', () => { // $FlowExpectedError[incompatible-type] - const a: HTMLElement = queryByTestId('1'); - const b: ?HTMLElement = queryByTestId('2'); + const a: IntersectionHTMLElement = queryByTestId('1'); + const b: ?IntersectionHTMLElement = queryByTestId('2'); }); it('queryAllByTestId should return array of HTML element', () => { // $FlowExpectedError[incompatible-type] - const a: HTMLElement = queryAllByTestId('1'); - const b: Array = queryAllByTestId('2'); + const a: IntersectionHTMLElement = queryAllByTestId('1'); + const b: Array = queryAllByTestId('2'); }); it('findByTestId should return HTML element', () => { // $FlowExpectedError[incompatible-type] - const a: HTMLElement = findByTestId('1'); - const b: Promise = findByTestId('1'); + const a: IntersectionHTMLElement = findByTestId('1'); + const b: Promise = findByTestId('1'); }); it('findAllByTestId should return array of HTML element', () => { // $FlowExpectedError[incompatible-type] - const a: HTMLElement = findAllByTestId('1'); - const b: Promise> = findAllByTestId('2'); + const a: IntersectionHTMLElement = findAllByTestId('1'); + const b: Promise> = findAllByTestId('2'); }); it('getByText should return HTML element', () => { - const a: HTMLElement = getByText('1'); + const a: IntersectionHTMLElement = getByText('1'); }); it('getAllByText should return array of HTML element', () => { // $FlowExpectedError[incompatible-type] - const a: HTMLElement = getAllByText('1'); - const b: Array = getAllByText('2'); + const a: IntersectionHTMLElement = getAllByText('1'); + const b: Array = getAllByText('2'); }); it('queryByText should return maybe HTML element', () => { // $FlowExpectedError[incompatible-type] - const a: HTMLElement = queryByText('1'); - const b: ?HTMLElement = queryByText('2'); + const a: IntersectionHTMLElement = queryByText('1'); + const b: ?IntersectionHTMLElement = queryByText('2'); }); it('queryAllByText should return array of HTML element', () => { // $FlowExpectedError[incompatible-type] - const a: HTMLElement = queryAllByText('1'); - const b: Array = queryAllByText('2'); + const a: IntersectionHTMLElement = queryAllByText('1'); + const b: Array = queryAllByText('2'); }); it('findByText should return HTML element', () => { // $FlowExpectedError[incompatible-type] - const a: HTMLElement = findByText('1'); - const b: Promise = findByText('1'); + const a: IntersectionHTMLElement = findByText('1'); + const b: Promise = findByText('1'); }); it('findAllByText should return array of HTML element', () => { // $FlowExpectedError[incompatible-type-arg] - const a: Promise = findAllByText('1'); - const b: Promise> = findAllByText('2'); + const a: Promise = findAllByText('1'); + const b: Promise> = findAllByText('2'); }); it('getByTitle should return HTML element', () => { - const a: HTMLElement = getByTitle('1'); + const a: IntersectionHTMLElement = getByTitle('1'); }); it('getAllByTitle should return array of HTML element', () => { // $FlowExpectedError[incompatible-type] - const a: HTMLElement = getAllByTitle('1'); - const b: Array = getAllByTitle('2'); + const a: IntersectionHTMLElement = getAllByTitle('1'); + const b: Array = getAllByTitle('2'); }); it('queryByTitle should return maybe HTML element', () => { // $FlowExpectedError[incompatible-type] - const a: HTMLElement = queryByTitle('1'); - const b: ?HTMLElement = queryByTitle('2'); + const a: IntersectionHTMLElement = queryByTitle('1'); + const b: ?IntersectionHTMLElement = queryByTitle('2'); }); it('queryAllByTitle should return array of HTML element', () => { // $FlowExpectedError[incompatible-type] - const a: HTMLElement = queryAllByTitle('1'); - const b: Array = queryAllByTitle('2'); + const a: IntersectionHTMLElement = queryAllByTitle('1'); + const b: Array = queryAllByTitle('2'); }); it('findByTitle should return HTML element', () => { // $FlowExpectedError[incompatible-type] - const a: HTMLElement = findByTitle('1'); - const b: Promise = findByTitle('1'); + const a: IntersectionHTMLElement = findByTitle('1'); + const b: Promise = findByTitle('1'); }); it('findAllByTitle should return array of HTML element', () => { // $FlowExpectedError[incompatible-type] - const a: HTMLElement = findAllByTitle('1'); - const b: Promise> = findAllByTitle('2'); + const a: IntersectionHTMLElement = findAllByTitle('1'); + const b: Promise> = findAllByTitle('2'); }); }); @@ -970,7 +978,7 @@ describe('text matching API', () => { }); it('getAllByAltText should accept text match arguments', () => { - const result: Array = getAllByAltText('1'); + const result: Array = getAllByAltText('1'); }); it('queryByAltText should accept text match arguments', () => { @@ -987,7 +995,7 @@ describe('text matching API', () => { }); it('queryAllByAltText should accept text match arguments', () => { - const result: Array = queryAllByAltText('1'); + const result: Array = queryAllByAltText('1'); }); it('getByDisplayValue should accept text match arguments', () => { @@ -1012,7 +1020,7 @@ describe('text matching API', () => { }); it('getAllByDisplayValue should accept text match arguments', () => { - const result: Array = getAllByDisplayValue('1'); + const result: Array = getAllByDisplayValue('1'); }); it('queryByDisplayValue should accept text match arguments', () => { @@ -1037,7 +1045,7 @@ describe('text matching API', () => { }); it('queryAllByDisplayValue should accept text match arguments', () => { - const result: Array = queryAllByDisplayValue('1'); + const result: Array = queryAllByDisplayValue('1'); }); it('getByLabelText should accept text match arguments', () => { @@ -1055,7 +1063,7 @@ describe('text matching API', () => { }); it('getAllByLabelText should accept text match arguments', () => { - const result: Array = getAllByLabelText('1'); + const result: Array = getAllByLabelText('1'); }); it('queryByLabelText should accept text match arguments', () => { @@ -1082,7 +1090,7 @@ describe('text matching API', () => { }); it('queryAllByLabelText should accept text match arguments', () => { - const result: Array = queryAllByLabelText('1'); + const result: Array = queryAllByLabelText('1'); }); it('getByPlaceholderText should accept text match arguments', () => { @@ -1107,7 +1115,7 @@ describe('text matching API', () => { }); it('getAllByPlaceholderText should accept text match arguments', () => { - const result: Array = getAllByPlaceholderText('1'); + const result: Array = getAllByPlaceholderText('1'); }); it('queryByPlaceholderText should accept text match arguments', () => { @@ -1132,7 +1140,7 @@ describe('text matching API', () => { }); it('queryAllByPlaceholderText should accept text match arguments', () => { - const result: Array = queryAllByPlaceholderText('1'); + const result: Array = queryAllByPlaceholderText('1'); }); it('getByRole should accept by role arguments', () => { @@ -1145,7 +1153,7 @@ describe('text matching API', () => { }); it('getAllByRole should accept by role arguments', () => { - const result: Array = getAllByRole('button'); + const result: Array = getAllByRole('button'); }); it('queryByRole should accept by role arguments', () => { @@ -1158,7 +1166,7 @@ describe('text matching API', () => { }); it('queryAllByRole should accept by role arguments', () => { - const result: Array = queryAllByRole('button'); + const result: Array = queryAllByRole('button'); }); it('getByTestId should accept text match arguments', () => { @@ -1175,7 +1183,7 @@ describe('text matching API', () => { }); it('getAllByTestId should accept text match arguments', () => { - const result: Array = getAllByTestId('1'); + const result: Array = getAllByTestId('1'); }); it('queryByTestId should accept text match arguments', () => { @@ -1192,7 +1200,7 @@ describe('text matching API', () => { }); it('queryAllByTestId should accept text match arguments', () => { - const result: Array = queryAllByTestId('1'); + const result: Array = queryAllByTestId('1'); }); it('getByText should accept text match arguments', () => { @@ -1210,7 +1218,7 @@ describe('text matching API', () => { }); it('getAllByText should accept text match arguments', () => { - const result: Array = getAllByText('1'); + const result: Array = getAllByText('1'); }); it('queryByText should accept text match arguments', () => { @@ -1228,7 +1236,7 @@ describe('text matching API', () => { }); it('queryAllByText should accept text match arguments', () => { - const result: Array = queryAllByText('1'); + const result: Array = queryAllByText('1'); }); it('getByTitle should accept text match arguments', () => { @@ -1245,7 +1253,7 @@ describe('text matching API', () => { }); it('getAllByTitle should accept text match arguments', () => { - const result: Array = getAllByTitle('1'); + const result: Array = getAllByTitle('1'); }); it('queryByTitle should accept text match arguments', () => { @@ -1262,7 +1270,7 @@ describe('text matching API', () => { }); it('queryAllByTitle should accept text match arguments', () => { - const result: Array = queryAllByTitle('1'); + const result: Array = queryAllByTitle('1'); }); }); diff --git a/definitions/npm/@testing-library/react_v12.x.x/flow_v0.104.x-/react_v12.x.x.js b/definitions/npm/@testing-library/react_v12.x.x/flow_v0.104.x-/react_v12.x.x.js index c9c75e5611..abfa6e9e21 100644 --- a/definitions/npm/@testing-library/react_v12.x.x/flow_v0.104.x-/react_v12.x.x.js +++ b/definitions/npm/@testing-library/react_v12.x.x/flow_v0.104.x-/react_v12.x.x.js @@ -2,7 +2,7 @@ * A local copy from: * https://github.com/A11yance/aria-query/blob/2e6a3011a0d8987655f3a14853934fe3df38a8d8/flow/aria.js */ -declare module '@@aria-query' { + declare module '@@aria-query' { declare export type ARIAAbstractRole = | 'command' | 'composite' @@ -166,7 +166,7 @@ declare module '@testing-library/react' { // This type comes from react-dom_v17.x.x.js declare interface ReactDOMTestUtilsThenable { - then(resolve: () => mixed, reject?: () => mixed): mixed, + then(resolve: () => mixed, reject?: () => mixed): mixed; } // This type comes from react-dom_v17.x.x.js @@ -258,86 +258,102 @@ declare module '@testing-library/react' { ignore?: string | boolean |}; + // These two types must be updated kept in sync + declare export type UnionHTMLElement = + | HTMLElement + | HTMLInputElement + | HTMLAnchorElement + | HTMLButtonElement + | HTMLSelectElement; + + declare export type IntersectionHTMLElement = + & HTMLElement + & HTMLInputElement + & HTMLAnchorElement + & HTMLButtonElement + & HTMLSelectElement; + // End mixed html types + declare type QueryByBoundAttribute = ( text: Matcher, options?: MatcherOptions - ) => ?HTMLElement; + ) => ?IntersectionHTMLElement; declare type AllByBoundAttribute = ( text: Matcher, options?: MatcherOptions - ) => Array; + ) => Array; declare type FindAllByBoundAttribute = ( text: Matcher, options?: MatcherOptions, waitForElementOptions?: WaitForOptions - ) => Promise; + ) => Promise; declare type GetByBoundAttribute = ( text: Matcher, options?: MatcherOptions - ) => HTMLElement; + ) => IntersectionHTMLElement; declare type FindByBoundAttribute = ( text: Matcher, options?: MatcherOptions, waitForElementOptions?: WaitForOptions - ) => Promise; + ) => Promise; declare type QueryByText = ( text: Matcher, options?: SelectorMatcherOptions - ) => ?HTMLElement; + ) => ?IntersectionHTMLElement; declare type AllByText = ( text: Matcher, options?: SelectorMatcherOptions - ) => Array; + ) => Array; declare type FindAllByText = ( text: Matcher, options?: SelectorMatcherOptions, waitForElementOptions?: WaitForOptions - ) => Promise; + ) => Promise; declare type GetByText = ( text: Matcher, options?: SelectorMatcherOptions - ) => HTMLElement; + ) => IntersectionHTMLElement; declare type FindByText = ( text: Matcher, options?: SelectorMatcherOptions, waitForElementOptions?: WaitForOptions - ) => Promise; + ) => Promise; declare type AllByRole = ( role: ByRoleMatcher, options?: ByRoleOptions - ) => HTMLElement[]; + ) => IntersectionHTMLElement[]; declare type GetByRole = ( role: ByRoleMatcher, options?: ByRoleOptions - ) => HTMLElement; + ) => IntersectionHTMLElement; declare type QueryByRole = ( role: ByRoleMatcher, options?: ByRoleOptions - ) => HTMLElement | null; + ) => IntersectionHTMLElement | null; declare type FindByRole = ( role: ByRoleMatcher, options?: ByRoleOptions, waitForElementOptions?: WaitForOptions - ) => Promise; + ) => Promise; declare type FindAllByRole = ( role: ByRoleMatcher, options?: ByRoleOptions, waitForElementOptions?: WaitForOptions - ) => Promise; + ) => Promise; declare type GetsAndQueries = {| getByLabelText: GetByText, @@ -398,7 +414,7 @@ declare module '@testing-library/react' { |}; declare type FireEvent = ( - element: HTMLElement, + element: UnionHTMLElement, eventProperties?: TInit ) => boolean; @@ -475,7 +491,7 @@ declare module '@testing-library/react' { declare export function waitFor( callback: () => T | Promise, options?: {| - container?: HTMLElement, + container?: UnionHTMLElement, timeout?: number, interval?: number, mutationObserverOptions?: MutationObserverInit, @@ -485,7 +501,7 @@ declare module '@testing-library/react' { declare export function waitForElementToBeRemoved( callback: (() => T) | T, options?: {| - container?: HTMLElement, + container?: UnionHTMLElement, timeout?: number, interval?: number, mutationObserverOptions?: MutationObserverInit, @@ -493,12 +509,12 @@ declare module '@testing-library/react' { ): Promise; declare export function within( - element: HTMLElement, + element: UnionHTMLElement, queriesToBind?: GetsAndQueries | Array ): GetsAndQueries; declare export var fireEvent: {| - (element: HTMLElement, event: Event): void, + (element: UnionHTMLElement, event: Event): void, copy: FireEvent, cut: FireEvent, @@ -572,55 +588,55 @@ declare module '@testing-library/react' { |}; // dom-testing-library re-declares declare export function queryByTestId( - container: HTMLElement, + container: UnionHTMLElement, id: Matcher, options?: MatcherOptions - ): ?HTMLElement; + ): ?IntersectionHTMLElement; declare export function getByTestId( - container: HTMLElement, + container: UnionHTMLElement, id: Matcher, options?: MatcherOptions - ): HTMLElement; + ): IntersectionHTMLElement; declare export function queryByText( - container: HTMLElement, + container: UnionHTMLElement, text: Matcher, options?: MatcherOptions - ): ?HTMLElement; + ): ?IntersectionHTMLElement; declare export function getByText( - container: HTMLElement, + container: UnionHTMLElement, text: Matcher, options?: { selector?: string, ... } & MatcherOptions - ): HTMLElement; + ): IntersectionHTMLElement; declare export function queryByPlaceholderText( - container: HTMLElement, + container: UnionHTMLElement, text: Matcher, options?: MatcherOptions - ): ?HTMLElement; + ): ?IntersectionHTMLElement; declare export function getByPlaceholderText( - container: HTMLElement, + container: UnionHTMLElement, text: Matcher, options?: MatcherOptions - ): HTMLElement; + ): IntersectionHTMLElement; declare export function queryByLabelText( - container: HTMLElement, + container: UnionHTMLElement, text: Matcher, options?: MatcherOptions - ): ?HTMLElement; + ): ?IntersectionHTMLElement; declare export function getByLabelText( - container: HTMLElement, + container: UnionHTMLElement, text: Matcher, options?: { selector?: string, ... } & MatcherOptions - ): HTMLElement; + ): IntersectionHTMLElement; declare export function queryByAltText( - container: HTMLElement, + container: UnionHTMLElement, text: Matcher, options?: MatcherOptions - ): ?HTMLElement; + ): ?IntersectionHTMLElement; declare export function getByAltText( - container: HTMLElement, + container: UnionHTMLElement, text: Matcher, options?: MatcherOptions - ): HTMLElement; - declare export function getNodeText(node: HTMLElement): string; + ): IntersectionHTMLElement; + declare export function getNodeText(node: UnionHTMLElement): string; declare export var screen: Screen<>; } diff --git a/definitions/npm/@testing-library/react_v12.x.x/flow_v0.104.x-/test_react_v12.x.x.js b/definitions/npm/@testing-library/react_v12.x.x/flow_v0.104.x-/test_react_v12.x.x.js index f867400973..b55501628c 100644 --- a/definitions/npm/@testing-library/react_v12.x.x/flow_v0.104.x-/test_react_v12.x.x.js +++ b/definitions/npm/@testing-library/react_v12.x.x/flow_v0.104.x-/test_react_v12.x.x.js @@ -11,6 +11,7 @@ import { within, screen, getNodeText, + type IntersectionHTMLElement, } from '@testing-library/react'; import { describe, it } from 'flow-typed-test'; @@ -176,7 +177,7 @@ describe('render', () => { it('asFragment should return a document fragment', () => { // $FlowExpectedError[incompatible-type] - const a: HTMLElement = asFragment(); + const a: IntersectionHTMLElement = asFragment(); const b: DocumentFragment = asFragment(); }); @@ -193,277 +194,284 @@ describe('render', () => { }); it('getByAltText should return HTML element', () => { - const a: HTMLElement = getByAltText('1'); + const a: IntersectionHTMLElement = getByAltText('1'); }); it('getAllByAltText should return array of HTML element', () => { // $FlowExpectedError[incompatible-type] - const a: HTMLElement = getAllByAltText('1'); - const b: Array = getAllByAltText('2'); + const a: IntersectionHTMLElement = getAllByAltText('1'); + const b: Array = getAllByAltText('2'); }); it('queryByAltText should return maybe HTML element', () => { // $FlowExpectedError[incompatible-type] - const a: HTMLElement = queryByAltText('1'); - const b: ?HTMLElement = queryByAltText('2'); + const a: IntersectionHTMLElement = queryByAltText('1'); + const b: ?IntersectionHTMLElement = queryByAltText('2'); }); it('queryAllByAltText should return array of HTML element', () => { // $FlowExpectedError[incompatible-type] - const a: HTMLElement = queryAllByAltText('1'); - const b: Array = queryAllByAltText('2'); + const a: IntersectionHTMLElement = queryAllByAltText('1'); + const b: Array = queryAllByAltText('2'); }); it('findByAltText should return HTML element', () => { // $FlowExpectedError[incompatible-type] - const a: HTMLElement = findByAltText('1'); - const b: Promise = findByAltText('1'); + const a: IntersectionHTMLElement = findByAltText('1'); + const b: Promise = findByAltText('1'); }); it('findAllByAltText should return array of HTML element', () => { // $FlowExpectedError[incompatible-type-arg] - const a: Promise = findAllByAltText('1'); - const b: Promise> = findAllByAltText('2'); + const a: Promise = findAllByAltText('1'); + const b: Promise> = findAllByAltText('2'); }); it('getByDisplayValue should return HTML element', () => { - const a: HTMLElement = getByDisplayValue('1'); + const a: IntersectionHTMLElement = getByDisplayValue('1'); }); it('getAllByDisplayValue should return array of HTML element', () => { // $FlowExpectedError[incompatible-type] - const a: HTMLElement = getAllByDisplayValue('1'); - const b: Array = getAllByDisplayValue('2'); + const a: IntersectionHTMLElement = getAllByDisplayValue('1'); + const b: Array = getAllByDisplayValue('2'); }); it('queryByDisplayValue should return maybe HTML element', () => { // $FlowExpectedError[incompatible-type] - const a: HTMLElement = queryByDisplayValue('1'); - const b: ?HTMLElement = queryByDisplayValue('2'); + const a: IntersectionHTMLElement = queryByDisplayValue('1'); + const b: ?IntersectionHTMLElement = queryByDisplayValue('2'); }); it('queryAllByDisplayValue should return array of HTML element', () => { // $FlowExpectedError[incompatible-type] - const a: HTMLElement = queryAllByDisplayValue('1'); - const b: Array = queryAllByDisplayValue('2'); + const a: IntersectionHTMLElement = queryAllByDisplayValue('1'); + const b: Array = queryAllByDisplayValue('2'); }); it('findByDisplayValue should return HTML element', () => { // $FlowExpectedError[incompatible-type] - const a: HTMLElement = findByDisplayValue('1'); - const b: Promise = findByDisplayValue('1'); + const a: IntersectionHTMLElement = findByDisplayValue('1'); + const b: Promise = findByDisplayValue('1'); }); it('findAllByDisplayValue should return array of HTML element', () => { // $FlowExpectedError[incompatible-type-arg] - const a: Promise = findAllByDisplayValue('1'); - const b: Promise> = findAllByDisplayValue('2'); + const a: Promise = findAllByDisplayValue('1'); + const b: Promise> = findAllByDisplayValue('2'); }); it('getByLabelText should return HTML element', () => { - const a: HTMLElement = getByLabelText('1'); + const a: IntersectionHTMLElement = getByLabelText('1'); }); it('getAllByLabelText should return array of HTML element', () => { // $FlowExpectedError[incompatible-type] - const a: HTMLElement = getAllByLabelText('1'); - const b: Array = getAllByLabelText('2'); + const a: IntersectionHTMLElement = getAllByLabelText('1'); + const b: Array = getAllByLabelText('2'); }); it('queryByLabelText should return maybe HTML element', () => { // $FlowExpectedError[incompatible-type] - const a: HTMLElement = queryByLabelText('1'); - const b: ?HTMLElement = queryByLabelText('2'); + const a: IntersectionHTMLElement = queryByLabelText('1'); + const b: ?IntersectionHTMLElement = queryByLabelText('2'); }); it('queryAllByLabelText should return array of HTML element', () => { // $FlowExpectedError[incompatible-type] - const a: HTMLElement = queryAllByLabelText('1'); - const b: Array = queryAllByLabelText('2'); + const a: IntersectionHTMLElement = queryAllByLabelText('1'); + const b: Array = queryAllByLabelText('2'); }); it('findByLabelText should return HTML element', () => { // $FlowExpectedError[incompatible-type] - const a: HTMLElement = findByLabelText('1'); - const b: Promise = findByLabelText('1'); + const a: IntersectionHTMLElement = findByLabelText('1'); + const b: Promise = findByLabelText('1'); }); it('findAllByLabelText should return array of HTML element', () => { // $FlowExpectedError[incompatible-type-arg] - const a: Promise = findAllByLabelText('1'); - const b: Promise> = findAllByLabelText('2'); + const a: Promise = findAllByLabelText('1'); + const b: Promise> = findAllByLabelText('2'); }); it('getByPlaceholderText should return HTML element', () => { - const a: HTMLElement = getByPlaceholderText('1'); + const a: IntersectionHTMLElement = getByPlaceholderText('1'); }); it('getAllByPlaceholderText should return array of HTML element', () => { // $FlowExpectedError[incompatible-type] - const a: HTMLElement = getAllByPlaceholderText('1'); - const b: Array = getAllByPlaceholderText('2'); + const a: IntersectionHTMLElement = getAllByPlaceholderText('1'); + const b: Array = getAllByPlaceholderText('2'); }); it('queryByPlaceholderText should return maybe HTML element', () => { // $FlowExpectedError[incompatible-type] - const a: HTMLElement = queryByPlaceholderText('1'); - const b: ?HTMLElement = queryByPlaceholderText('2'); + const a: IntersectionHTMLElement = queryByPlaceholderText('1'); + const b: ?IntersectionHTMLElement = queryByPlaceholderText('2'); }); it('queryAllByPlaceholderText should return array of HTML element', () => { // $FlowExpectedError[incompatible-type] - const a: HTMLElement = queryAllByPlaceholderText('1'); - const b: Array = queryAllByPlaceholderText('2'); + const a: IntersectionHTMLElement = queryAllByPlaceholderText('1'); + const b: Array = queryAllByPlaceholderText('2'); }); it('findByPlaceholderText should return HTML element', () => { // $FlowExpectedError[incompatible-type] - const a: HTMLElement = findByPlaceholderText('1'); - const b: Promise = findByPlaceholderText('1'); + const a: IntersectionHTMLElement = findByPlaceholderText('1'); + const b: Promise = findByPlaceholderText('1'); }); it('findAllByPlaceholderText should return array of HTML element', () => { // $FlowExpectedError[incompatible-type-arg] - const a: Promise = findAllByPlaceholderText('1'); - const b: Promise> = findAllByPlaceholderText('2'); + const a: Promise = findAllByPlaceholderText('1'); + const b: Promise> = findAllByPlaceholderText('2'); }); it('getByRole should return HTML element', () => { // $FlowExpectedError[incompatible-type] const a: string = getByRole('button'); - const b: HTMLElement = getByRole('button'); + const b: IntersectionHTMLElement = getByRole('button'); }); it('getAllByRole should return array of HTML element', () => { // $FlowExpectedError[incompatible-type] - const a: HTMLElement = getAllByRole('button'); - const b: Array = getAllByRole('button'); + const a: IntersectionHTMLElement = getAllByRole('button'); + const b: Array = getAllByRole('button'); }); it('queryByRole should return maybe HTML element', () => { // $FlowExpectedError[incompatible-type] - const a: HTMLElement = queryByRole('button'); - const b: ?HTMLElement = queryByRole('button'); + const a: IntersectionHTMLElement = queryByRole('button'); + const b: ?IntersectionHTMLElement = queryByRole('button'); }); it('queryAllByRole should return array of HTML element', () => { // $FlowExpectedError[incompatible-type] - const a: HTMLElement = queryAllByRole('button'); - const b: Array = queryAllByRole('button'); + const a: IntersectionHTMLElement = queryAllByRole('button'); + const b: Array = queryAllByRole('button'); }); it('findByRole should return HTML element', () => { // $FlowExpectedError[incompatible-type] - const a: HTMLElement = findByRole('button'); - const b: Promise = findByRole('button'); + const a: IntersectionHTMLElement = findByRole('button'); + const b: Promise = findByRole('button'); }); it('findAllByRole should return array of HTML element', () => { // $FlowExpectedError[incompatible-type-arg] - const a: Promise = findAllByRole('button'); - const b: Promise> = findAllByRole('button'); + const a: Promise = findAllByRole('button'); + const b: Promise> = findAllByRole('button'); }); it('getByTestId should return HTML element', () => { - const a: HTMLElement = getByTestId('1'); + const a: IntersectionHTMLElement = getByTestId('1'); + }); + + it('getByTestId returns a mixed HTML type', () => { + const a = getByTestId('1'); + a.value; + a.disabled; + a.href; }); it('getAllByTestId should return array of HTML element', () => { // $FlowExpectedError[incompatible-type] - const a: HTMLElement = getAllByTestId('1'); - const b: Array = getAllByTestId('2'); + const a: IntersectionHTMLElement = getAllByTestId('1'); + const b: Array = getAllByTestId('2'); }); it('queryByTestId should return maybe HTML element', () => { // $FlowExpectedError[incompatible-type] - const a: HTMLElement = queryByTestId('1'); - const b: ?HTMLElement = queryByTestId('2'); + const a: IntersectionHTMLElement = queryByTestId('1'); + const b: ?IntersectionHTMLElement = queryByTestId('2'); }); it('queryAllByTestId should return array of HTML element', () => { // $FlowExpectedError[incompatible-type] - const a: HTMLElement = queryAllByTestId('1'); - const b: Array = queryAllByTestId('2'); + const a: IntersectionHTMLElement = queryAllByTestId('1'); + const b: Array = queryAllByTestId('2'); }); it('findByTestId should return HTML element', () => { // $FlowExpectedError[incompatible-type] - const a: HTMLElement = findByTestId('1'); - const b: Promise = findByTestId('1'); + const a: IntersectionHTMLElement = findByTestId('1'); + const b: Promise = findByTestId('1'); }); it('findAllByTestId should return array of HTML element', () => { // $FlowExpectedError[incompatible-type] - const a: HTMLElement = findAllByTestId('1'); - const b: Promise> = findAllByTestId('2'); + const a: IntersectionHTMLElement = findAllByTestId('1'); + const b: Promise> = findAllByTestId('2'); }); it('getByText should return HTML element', () => { - const a: HTMLElement = getByText('1'); + const a: IntersectionHTMLElement = getByText('1'); }); it('getAllByText should return array of HTML element', () => { // $FlowExpectedError[incompatible-type] - const a: HTMLElement = getAllByText('1'); - const b: Array = getAllByText('2'); + const a: IntersectionHTMLElement = getAllByText('1'); + const b: Array = getAllByText('2'); }); it('queryByText should return maybe HTML element', () => { // $FlowExpectedError[incompatible-type] - const a: HTMLElement = queryByText('1'); - const b: ?HTMLElement = queryByText('2'); + const a: IntersectionHTMLElement = queryByText('1'); + const b: ?IntersectionHTMLElement = queryByText('2'); }); it('queryAllByText should return array of HTML element', () => { // $FlowExpectedError[incompatible-type] - const a: HTMLElement = queryAllByText('1'); - const b: Array = queryAllByText('2'); + const a: IntersectionHTMLElement = queryAllByText('1'); + const b: Array = queryAllByText('2'); }); it('findByText should return HTML element', () => { // $FlowExpectedError[incompatible-type] - const a: HTMLElement = findByText('1'); - const b: Promise = findByText('1'); + const a: IntersectionHTMLElement = findByText('1'); + const b: Promise = findByText('1'); }); it('findAllByText should return array of HTML element', () => { // $FlowExpectedError[incompatible-type-arg] - const a: Promise = findAllByText('1'); - const b: Promise> = findAllByText('2'); + const a: Promise = findAllByText('1'); + const b: Promise> = findAllByText('2'); }); it('getByTitle should return HTML element', () => { - const a: HTMLElement = getByTitle('1'); + const a: IntersectionHTMLElement = getByTitle('1'); }); it('getAllByTitle should return array of HTML element', () => { // $FlowExpectedError[incompatible-type] - const a: HTMLElement = getAllByTitle('1'); - const b: Array = getAllByTitle('2'); + const a: IntersectionHTMLElement = getAllByTitle('1'); + const b: Array = getAllByTitle('2'); }); it('queryByTitle should return maybe HTML element', () => { // $FlowExpectedError[incompatible-type] - const a: HTMLElement = queryByTitle('1'); - const b: ?HTMLElement = queryByTitle('2'); + const a: IntersectionHTMLElement = queryByTitle('1'); + const b: ?IntersectionHTMLElement = queryByTitle('2'); }); it('queryAllByTitle should return array of HTML element', () => { // $FlowExpectedError[incompatible-type] - const a: HTMLElement = queryAllByTitle('1'); - const b: Array = queryAllByTitle('2'); + const a: IntersectionHTMLElement = queryAllByTitle('1'); + const b: Array = queryAllByTitle('2'); }); it('findByTitle should return HTML element', () => { // $FlowExpectedError[incompatible-type] - const a: HTMLElement = findByTitle('1'); - const b: Promise = findByTitle('1'); + const a: IntersectionHTMLElement = findByTitle('1'); + const b: Promise = findByTitle('1'); }); it('findAllByTitle should return array of HTML element', () => { // $FlowExpectedError[incompatible-type] - const a: HTMLElement = findAllByTitle('1'); - const b: Promise> = findAllByTitle('2'); + const a: IntersectionHTMLElement = findAllByTitle('1'); + const b: Promise> = findAllByTitle('2'); }); }); @@ -929,7 +937,7 @@ describe('text matching API', () => { }); it('getAllByAltText should accept text match arguments', () => { - const result: Array = getAllByAltText('1'); + const result: Array = getAllByAltText('1'); }); it('queryByAltText should accept text match arguments', () => { @@ -946,7 +954,7 @@ describe('text matching API', () => { }); it('queryAllByAltText should accept text match arguments', () => { - const result: Array = queryAllByAltText('1'); + const result: Array = queryAllByAltText('1'); }); it('getByDisplayValue should accept text match arguments', () => { @@ -971,7 +979,7 @@ describe('text matching API', () => { }); it('getAllByDisplayValue should accept text match arguments', () => { - const result: Array = getAllByDisplayValue('1'); + const result: Array = getAllByDisplayValue('1'); }); it('queryByDisplayValue should accept text match arguments', () => { @@ -996,7 +1004,7 @@ describe('text matching API', () => { }); it('queryAllByDisplayValue should accept text match arguments', () => { - const result: Array = queryAllByDisplayValue('1'); + const result: Array = queryAllByDisplayValue('1'); }); it('getByLabelText should accept text match arguments', () => { @@ -1014,7 +1022,7 @@ describe('text matching API', () => { }); it('getAllByLabelText should accept text match arguments', () => { - const result: Array = getAllByLabelText('1'); + const result: Array = getAllByLabelText('1'); }); it('queryByLabelText should accept text match arguments', () => { @@ -1041,7 +1049,7 @@ describe('text matching API', () => { }); it('queryAllByLabelText should accept text match arguments', () => { - const result: Array = queryAllByLabelText('1'); + const result: Array = queryAllByLabelText('1'); }); it('getByPlaceholderText should accept text match arguments', () => { @@ -1066,7 +1074,7 @@ describe('text matching API', () => { }); it('getAllByPlaceholderText should accept text match arguments', () => { - const result: Array = getAllByPlaceholderText('1'); + const result: Array = getAllByPlaceholderText('1'); }); it('queryByPlaceholderText should accept text match arguments', () => { @@ -1091,7 +1099,7 @@ describe('text matching API', () => { }); it('queryAllByPlaceholderText should accept text match arguments', () => { - const result: Array = queryAllByPlaceholderText('1'); + const result: Array = queryAllByPlaceholderText('1'); }); it('getByRole should accept by role arguments', () => { @@ -1104,7 +1112,7 @@ describe('text matching API', () => { }); it('getAllByRole should accept by role arguments', () => { - const result: Array = getAllByRole('button'); + const result: Array = getAllByRole('button'); }); it('queryByRole should accept by role arguments', () => { @@ -1117,7 +1125,7 @@ describe('text matching API', () => { }); it('queryAllByRole should accept by role arguments', () => { - const result: Array = queryAllByRole('button'); + const result: Array = queryAllByRole('button'); }); it('getByTestId should accept text match arguments', () => { @@ -1134,7 +1142,7 @@ describe('text matching API', () => { }); it('getAllByTestId should accept text match arguments', () => { - const result: Array = getAllByTestId('1'); + const result: Array = getAllByTestId('1'); }); it('queryByTestId should accept text match arguments', () => { @@ -1151,7 +1159,7 @@ describe('text matching API', () => { }); it('queryAllByTestId should accept text match arguments', () => { - const result: Array = queryAllByTestId('1'); + const result: Array = queryAllByTestId('1'); }); it('getByText should accept text match arguments', () => { @@ -1169,7 +1177,7 @@ describe('text matching API', () => { }); it('getAllByText should accept text match arguments', () => { - const result: Array = getAllByText('1'); + const result: Array = getAllByText('1'); }); it('queryByText should accept text match arguments', () => { @@ -1187,7 +1195,7 @@ describe('text matching API', () => { }); it('queryAllByText should accept text match arguments', () => { - const result: Array = queryAllByText('1'); + const result: Array = queryAllByText('1'); }); it('getByTitle should accept text match arguments', () => { @@ -1204,7 +1212,7 @@ describe('text matching API', () => { }); it('getAllByTitle should accept text match arguments', () => { - const result: Array = getAllByTitle('1'); + const result: Array = getAllByTitle('1'); }); it('queryByTitle should accept text match arguments', () => { @@ -1221,7 +1229,7 @@ describe('text matching API', () => { }); it('queryAllByTitle should accept text match arguments', () => { - const result: Array = queryAllByTitle('1'); + const result: Array = queryAllByTitle('1'); }); });