From 4a2d567aea5997d13a7d0ee4357c2a8abc290e6a Mon Sep 17 00:00:00 2001 From: Artem Sapegin Date: Wed, 1 Apr 2020 01:00:14 +0200 Subject: [PATCH] [@testing-library/cypress] Add extended options for *ByRole queries (#43088) https://testing-library.com/docs/dom-testing-library/api-queries#byrole --- types/testing-library__cypress/index.d.ts | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/types/testing-library__cypress/index.d.ts b/types/testing-library__cypress/index.d.ts index 6f68ec231c..3c3b2c285d 100644 --- a/types/testing-library__cypress/index.d.ts +++ b/types/testing-library__cypress/index.d.ts @@ -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; + queryByRole(id: Matcher, options?: ByRoleOptions): Chainable; /** * 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; + queryAllByRole(id: Matcher, options?: ByRoleOptions): Chainable; /** * 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; + findByRole(id: Matcher, options?: ByRoleOptions): Chainable; /** * 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; + findAllByRole(id: Matcher, options?: ByRoleOptions): Chainable; } } }