@helpscout/cyan
Version:
Cypress-like Testing for React + JSDOM
87 lines (86 loc) • 2.51 kB
TypeScript
/**
* Checks a DOM element. Typically used for `<input />`.
*
* @returns {Cyan} The Cyan instance.
*
* @example
* cy.get('input[type=checkbox]').check()
*/
declare function check(): any;
/**
* Clear the value of a DOM element. Typically used for `<input />`.
*
* @returns {Cyan} The Cyan instance.
*
* @example
* cy.get('input[type=text]').clear()
*/
declare function clear(): any;
/**
* Triggers an Event for a DOM element.
*
* @param {string} event The name of the event.
* @returns {Cyan} The Cyan instance.
*
* @example
* cy.get('textarea').trigger('focus')
*/
declare function trigger(event: any): any;
/**
* Types characters/commands into a DOM element. Typically used for `<input />`.
*
* @param {string} value The characters/commands to type.
* @returns {Cyan} The Cyan instance.
*
* @example
* cy.get('input[type=text]').type('Hello')
*/
declare function type(value: any): any;
/**
* Unchecks a DOM element. Typically used for `<input />`.
*
* @returns {Cyan} The Cyan instance.
*
* @example
* cy.get('input[type=checkbox]').uncheck()
*/
declare function uncheck(): any;
declare function hover(): any;
/**
* @module Cyan
* @name events
*
* @description Triggers an Event for a DOM element.
*
* Supported events include:
*
* ```
* 'copy', 'cut', 'paste', 'compositionEnd', 'compositionStart',
* 'compositionUpdate', 'keyDown', 'keyPress', 'keyUp', 'focus', 'blur',
* 'focusIn', 'focusOut', 'change', 'hover', 'input', 'invalid', 'submit',
* 'click', 'contextMenu', 'dblClick', 'drag', 'dragEnd', 'dragEnter',
* 'dragExit', 'dragLeave', 'dragOver', 'dragStart', 'drop', 'mouseDown',
* 'mouseEnter', 'mouseLeave', 'mouseMove', 'mouseOut', 'mouseOver',
* 'mouseUp', 'select', 'touchCancel', 'touchEnd', 'touchMove', 'touchStart',
* 'scroll', 'wheel', 'abort', 'canPlay', 'canPlayThrough', 'durationChange',
* 'emptied', 'encrypted', 'ended', 'loadedData', 'loadedMetadata',
* 'loadStart', 'pause', 'play', 'playing', 'progress', 'rateChange',
* 'seeked', 'seeking', 'stalled', 'suspend', 'timeUpdate', 'volumeChange',
* 'waiting', 'load', 'error', 'animationStart', 'animationEnd',
* 'animationIteration', 'transitionEnd', 'doubleClick'
* ```
*
* @returns {Cyan} The Cyan instance.
*
* @example
* cy.get('textarea').hover()
*/
declare const commands: {
check: typeof check;
clear: typeof clear;
hover: typeof hover;
trigger: typeof trigger;
type: typeof type;
uncheck: typeof uncheck;
};
export default commands;