Skip to content

Commit

Permalink
fix(cypress): type fill() command as non-chainable
Browse files Browse the repository at this point in the history
  • Loading branch information
ivangabriele committed Feb 29, 2024
1 parent 538615f commit d4b5c35
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/cypress/commands/fill/fillDatePicker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ export function fillDatePicker(
dateOrDateWithTimeTuple: Cypress.DateTuple | Cypress.DateWithTimeTuple | undefined,
_label: string,
force: boolean
): void {
) {
Cypress.log({
consoleProps: () => ({
'Applied to': fieldsetElement,
Expand Down
2 changes: 1 addition & 1 deletion src/cypress/commands/fill/fillDateRangePicker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ export function fillDateRangePicker(
dateOrDateWithTimeTupleRange: Cypress.DateRangeTuple | Cypress.DateWithTimeRangeTuple | undefined,
_label: string,
force: boolean
): void {
) {
Cypress.log({
consoleProps: () => ({
'Applied to': fieldsetElement,
Expand Down
2 changes: 1 addition & 1 deletion src/cypress/commands/fill/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ import { throwError } from '../../utils/throwError'

let TOTAL_RETRIES: number

export function fill(label: string, value: any, options: Partial<Cypress.FillOptions> = {}): void {
export function fill(label: string, value: any, options: Partial<Cypress.FillOptions> = {}) {
const controlledOptions = { ...DEFAULT_OPTIONS, ...options }
if (!TOTAL_RETRIES) {
TOTAL_RETRIES = controlledOptions.retries
Expand Down
7 changes: 4 additions & 3 deletions src/cypress/global.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,10 @@ declare namespace Cypress {
/**
* @description
* You can set the `retries` option to a number greater than 5 (default) to retry the action in case of failure.
* You can also set the `forced` option to `true` to force the action without waiting for the element to be visible.
* You can also set the `force` option to `true` to force the action without waiting for the element to be visible.
*
* ⚠️ In order to ensure backward compatibility, the `forced` option is set to `true` by default.
* ⚠️ In order to ensure backward compatibility, the `force` option is set to `true` by default.
* This will be changed to `false` in the next major version.
*
* @example
* ```ts
Expand All @@ -47,7 +48,7 @@ declare namespace Cypress {
* cy.fill('My Field', undefined)
* ```
*/
fill(label: string, value: any, options?: Partial<FillOptions>): Chainable<Element>
fill(label: string, value: any, options?: Partial<FillOptions>): void

forceCheck(options?: Partial<CheckOptions>): Chainable<JQuery<HTMLElement>>
forceClear(options?: Partial<ClearOptions>): Chainable<JQuery<HTMLElement>>
Expand Down

0 comments on commit d4b5c35

Please sign in to comment.