fix: incorrect typing of "dom.getContainsSelector" (#28339)

* fix: incorrect typing of "dom.getContainsSelector"

- add missing "options" parameter

* added type test

* fix changelog

---------

Co-authored-by: Jennifer Shehane <jennifer@cypress.io>
Co-authored-by: Matt Schile <mschile@cypress.io>
This commit is contained in:
Damien Sorel
2024-02-05 20:56:11 +01:00
committed by GitHub
parent 61aeed3bb7
commit a85f4897fe
3 changed files with 8 additions and 2 deletions
+5 -1
View File
@@ -1,8 +1,12 @@
<!-- See the ../guides/writing-the-cypress-changelog.md for details on writing the changelog. -->
## 13.6.5
## 13.6.5
_Released 2/13/2024 (PENDING)_
**Bugfixes:**
- Fixed incorrect type definition of `dom.getContainsSelector`. Fixed in [#28339](https://github.com/cypress-io/cypress/pull/28339).
**Misc:**
- Improved accessibility of the Cypress App in some areas. Addressed in [#28774](https://github.com/cypress-io/cypress/pull/28774).
+1 -1
View File
@@ -758,7 +758,7 @@ declare namespace Cypress {
isInputType(element: JQuery | HTMLElement, type: string | string[]): boolean
stringify(element: JQuery | HTMLElement, form: string): string
getElements(element: JQuery): JQuery | HTMLElement[]
getContainsSelector(text: string, filter?: string): JQuery.Selector
getContainsSelector(text: string, filter?: string, options?: CaseMatchable): JQuery.Selector
getFirstDeepestElement(elements: HTMLElement[], index?: number): HTMLElement
getWindowByElement(element: JQuery | HTMLElement): JQuery | HTMLElement
getReasonIsHidden(element: JQuery | HTMLElement, options?: object): string
+2
View File
@@ -804,6 +804,7 @@ namespace CypressDomTests {
Cypress.dom.stringify(el, 'foo') // $ExpectType string
Cypress.dom.getElements(jel) // $ExpectType JQuery<HTMLElement> | HTMLElement[]
Cypress.dom.getContainsSelector('foo', 'bar') // $ExpectType string
Cypress.dom.getContainsSelector('foo', 'bar', { matchCase: true }) // $ExpectType string
Cypress.dom.getFirstDeepestElement([el], 1) // $ExpectType HTMLElement
Cypress.dom.getWindowByElement(el) // $ExpectType HTMLElement | JQuery<HTMLElement>
Cypress.dom.getReasonIsHidden(el) // $ExpectType string
@@ -839,6 +840,7 @@ namespace CypressDomTests {
Cypress.dom.stringify('', 'foo') // $ExpectError
Cypress.dom.getElements(el) // $ExpectError
Cypress.dom.getContainsSelector(el, 'bar') // $ExpectError
Cypress.dom.getContainsSelector('foo', 'bar', { invalid: false }) // $ExpectError
Cypress.dom.getFirstDeepestElement(el, 1) // $ExpectError
Cypress.dom.getWindowByElement('') // $ExpectError
Cypress.dom.getReasonIsHidden('') // $ExpectError