From 14464cc33cabde9b859aab8f86ac1d09989806ac Mon Sep 17 00:00:00 2001 From: Nick McCurdy Date: Fri, 20 Nov 2020 17:28:01 -0500 Subject: [PATCH 1/2] fix(types): allow all elements --- types/index.d.ts | 2 +- types/test.ts | 32 ++++++++++++++++---------------- 2 files changed, 17 insertions(+), 17 deletions(-) diff --git a/types/index.d.ts b/types/index.d.ts index 1ad877a..7b954bb 100644 --- a/types/index.d.ts +++ b/types/index.d.ts @@ -10,7 +10,7 @@ import { export interface CTLMatcherOptions { timeout?: number - container?: HTMLElement | JQuery + container?: Element | JQuery } export type MatcherOptions = DTLMatcherOptions | CTLMatcherOptions diff --git a/types/test.ts b/types/test.ts index 28f3bf9..51f8374 100644 --- a/types/test.ts +++ b/types/test.ts @@ -5,24 +5,24 @@ import '@testing-library/cypress/add-commands' configure({testIdAttribute: 'data-myown-testid'}) // findBy* -cy.findByPlaceholderText('foo') // $ExpectType Chainable> -cy.findByText('foo') // $ExpectType Chainable> -cy.findByLabelText('foo') // $ExpectType Chainable> -cy.findByAltText('foo') // $ExpectType Chainable> -cy.findByTestId('foo') // $ExpectType Chainable> -cy.findByTitle('foo') // $ExpectType Chainable> -cy.findByDisplayValue('foo') // $ExpectType Chainable> -cy.findByRole('foo') // $ExpectType Chainable> +cy.findByPlaceholderText('foo') // $ExpectType Chainable> +cy.findByText('foo') // $ExpectType Chainable> +cy.findByLabelText('foo') // $ExpectType Chainable> +cy.findByAltText('foo') // $ExpectType Chainable> +cy.findByTestId('foo') // $ExpectType Chainable> +cy.findByTitle('foo') // $ExpectType Chainable> +cy.findByDisplayValue('foo') // $ExpectType Chainable> +cy.findByRole('foo') // $ExpectType Chainable> // findAllBy* -cy.findAllByPlaceholderText('foo') // $ExpectType Chainable> -cy.findAllByText('foo') // $ExpectType Chainable> -cy.findAllByLabelText('foo') // $ExpectType Chainable> -cy.findAllByAltText('foo') // $ExpectType Chainable> -cy.findAllByTestId('foo') // $ExpectType Chainable> -cy.findAllByTitle('foo') // $ExpectType Chainable> -cy.findAllByDisplayValue('foo') // $ExpectType Chainable> -cy.findAllByRole('foo') // $ExpectType Chainable> +cy.findAllByPlaceholderText('foo') // $ExpectType Chainable> +cy.findAllByText('foo') // $ExpectType Chainable> +cy.findAllByLabelText('foo') // $ExpectType Chainable> +cy.findAllByAltText('foo') // $ExpectType Chainable> +cy.findAllByTestId('foo') // $ExpectType Chainable> +cy.findAllByTitle('foo') // $ExpectType Chainable> +cy.findAllByDisplayValue('foo') // $ExpectType Chainable> +cy.findAllByRole('foo') // $ExpectType Chainable> // configure cy.configureCypressTestingLibrary({testIdAttribute: 'data-myawesome-testid'}) // $ExpectType Chainable From 2739a2d4b4a3ee59942f1b06f170a39df3dcc2be Mon Sep 17 00:00:00 2001 From: Nick McCurdy Date: Tue, 15 Dec 2020 03:52:56 -0500 Subject: [PATCH 2/2] chore: fix incorrect type test --- types/test.ts | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/types/test.ts b/types/test.ts index 51f8374..28f3bf9 100644 --- a/types/test.ts +++ b/types/test.ts @@ -5,24 +5,24 @@ import '@testing-library/cypress/add-commands' configure({testIdAttribute: 'data-myown-testid'}) // findBy* -cy.findByPlaceholderText('foo') // $ExpectType Chainable> -cy.findByText('foo') // $ExpectType Chainable> -cy.findByLabelText('foo') // $ExpectType Chainable> -cy.findByAltText('foo') // $ExpectType Chainable> -cy.findByTestId('foo') // $ExpectType Chainable> -cy.findByTitle('foo') // $ExpectType Chainable> -cy.findByDisplayValue('foo') // $ExpectType Chainable> -cy.findByRole('foo') // $ExpectType Chainable> +cy.findByPlaceholderText('foo') // $ExpectType Chainable> +cy.findByText('foo') // $ExpectType Chainable> +cy.findByLabelText('foo') // $ExpectType Chainable> +cy.findByAltText('foo') // $ExpectType Chainable> +cy.findByTestId('foo') // $ExpectType Chainable> +cy.findByTitle('foo') // $ExpectType Chainable> +cy.findByDisplayValue('foo') // $ExpectType Chainable> +cy.findByRole('foo') // $ExpectType Chainable> // findAllBy* -cy.findAllByPlaceholderText('foo') // $ExpectType Chainable> -cy.findAllByText('foo') // $ExpectType Chainable> -cy.findAllByLabelText('foo') // $ExpectType Chainable> -cy.findAllByAltText('foo') // $ExpectType Chainable> -cy.findAllByTestId('foo') // $ExpectType Chainable> -cy.findAllByTitle('foo') // $ExpectType Chainable> -cy.findAllByDisplayValue('foo') // $ExpectType Chainable> -cy.findAllByRole('foo') // $ExpectType Chainable> +cy.findAllByPlaceholderText('foo') // $ExpectType Chainable> +cy.findAllByText('foo') // $ExpectType Chainable> +cy.findAllByLabelText('foo') // $ExpectType Chainable> +cy.findAllByAltText('foo') // $ExpectType Chainable> +cy.findAllByTestId('foo') // $ExpectType Chainable> +cy.findAllByTitle('foo') // $ExpectType Chainable> +cy.findAllByDisplayValue('foo') // $ExpectType Chainable> +cy.findAllByRole('foo') // $ExpectType Chainable> // configure cy.configureCypressTestingLibrary({testIdAttribute: 'data-myawesome-testid'}) // $ExpectType Chainable