[@testing-library/cypress] Add extended options for *ByRole queries (#43088)

https://testing-library.com/docs/dom-testing-library/api-queries#byrole
This commit is contained in:
Artem Sapegin
2020-03-31 16:00:14 -07:00
committed by GitHub
parent 2f23492c1b
commit 4a2d567aea
+6 -4
View File
@@ -14,6 +14,7 @@ import {
configure,
Matcher,
MatcherOptions as DTLMatcherOptions,
ByRoleOptions as DTLByRoleOptions,
SelectorMatcherOptions as DTLSelectorMatcherOptions,
} from '@testing-library/dom';
@@ -23,6 +24,7 @@ export interface CTLMatcherOptions {
}
export type MatcherOptions = DTLMatcherOptions | CTLMatcherOptions;
export type ByRoleOptions = DTLByRoleOptions | CTLMatcherOptions;
export type SelectorMatcherOptions = DTLSelectorMatcherOptions | CTLMatcherOptions;
declare global {
@@ -403,7 +405,7 @@ declare global {
* @see https://github.com/testing-library/cypress-testing-library#usage
* @see https://github.com/testing-library/dom-testing-library#table-of-contents
*/
queryByRole(id: Matcher, options?: MatcherOptions): Chainable<JQuery>;
queryByRole(id: Matcher, options?: ByRoleOptions): Chainable<JQuery>;
/**
* dom-testing-library helpers for Cypress
@@ -416,7 +418,7 @@ declare global {
* @see https://github.com/testing-library/cypress-testing-library#usage
* @see https://github.com/testing-library/dom-testing-library#table-of-contents
*/
queryAllByRole(id: Matcher, options?: MatcherOptions): Chainable<JQuery>;
queryAllByRole(id: Matcher, options?: ByRoleOptions): Chainable<JQuery>;
/**
* dom-testing-library helpers for Cypress
@@ -429,7 +431,7 @@ declare global {
* @see https://github.com/testing-library/cypress-testing-library#usage
* @see https://github.com/testing-library/dom-testing-library#table-of-contents
*/
findByRole(id: Matcher, options?: MatcherOptions): Chainable<JQuery>;
findByRole(id: Matcher, options?: ByRoleOptions): Chainable<JQuery>;
/**
* dom-testing-library helpers for Cypress
@@ -442,7 +444,7 @@ declare global {
* @see https://github.com/testing-library/cypress-testing-library#usage
* @see https://github.com/testing-library/dom-testing-library#table-of-contents
*/
findAllByRole(id: Matcher, options?: MatcherOptions): Chainable<JQuery>;
findAllByRole(id: Matcher, options?: ByRoleOptions): Chainable<JQuery>;
}
}
}