How to use the test-drive-react.simulate.keyDown function in test-drive-react

To help you get started, we’ve selected a few test-drive-react examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github wix-playground / stylable-components / test / components / time-picker.spec.tsx View on Github external
beforeEach(() => {
                simulate.focus(ampm);
                simulate.keyDown(ampm, {keyCode: keycode('space')});
            });
            it('onChange should be callen with "16:55"', () => {
github wix-playground / stylable-components / test / components / date-picker.spec.tsx View on Github external
it('should appear when the Enter key is pressed and the openOnFocus property is set to false', async () => {
            const {waitForDom} = clientRenderer.render();

            simulate.focus(bodySelect(datePickerInputId));

            await waitForDom(() => expect(bodySelect(datePickerDropdownId)).to.be.absent());

            simulate.keyDown(bodySelect(datePickerInputId), {keyCode: keycode('enter')});

            await waitForDom(() => expect(bodySelect(datePickerDropdownId)).to.be.present());
        });
github wix-playground / stylable-components / test / components / time-picker.spec.tsx View on Github external
beforeEach(() => {
                simulate.focus(mm);
                simulate.click(mm);
                simulate.keyDown(mm, {keyCode: keycode('backspace')});
                simulate.keyDown(mm, {keyCode: keycode('backspace')});
            });
            it('hh input should have "13" value', () => {
github wix-playground / stylable-components / test-kit / components / number-input-driver.ts View on Github external
public pressEnter() {
        simulate.keyDown(this.nativeInput, {keyCode: KeyCodes.enter});
    }
github wix-playground / stylable-components / test-kit / components / slider-driver.ts View on Github external
public keyDown(key: string, opts?: object) {
        simulate.keyDown(this.handle, {
            keyCode: keycode(key),
            ...opts
        });
    }
github wix-playground / stylable-components / test-kit / components / selection-list-driver.ts View on Github external
public keyDown(eventData: object): void {
        simulate.keyDown(this.root, eventData);
    }
github wix-playground / stylable-components / test-kit / components / number-input-driver.ts View on Github external
public pressEsc() {
        simulate.keyDown(this.nativeInput, {keyCode: KeyCodes.esc});
    }
github wix-playground / stylable-components / test-kit / components / number-input-driver.ts View on Github external
public pressUpKey(opts?: Modifiers) {
        simulate.keyDown(this.nativeInput, {keyCode: KeyCodes.up, ...opts});
    }
github wix-playground / stylable-components / test-kit / components / number-input-driver.ts View on Github external
public pressDownKey(opts?: Modifiers) {
        simulate.keyDown(this.nativeInput, {keyCode: KeyCodes.down, ...opts});
    }
github wix-playground / stylable-components / test-kit / components / date-picker-driver.ts View on Github external
public keyPress(keyCode: number): void {
        simulate.keyDown(this.input, {keyCode});
    }