How to use the test-drive-react.simulate.blur 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 / date-picker.spec.tsx View on Github external
it('should only call onChange once', async () => {
        const onChange = sinon.spy();
        const {select, waitForDom} = clientRenderer.render();
        const datePickerInput = select(datePickerInputId);

        trigger.change(datePickerInput!, '2017/02/01');
        simulate.blur(datePickerInput);

        await waitForDom(() => expect(onChange).to.have.been.calledOnce);
    });
github wix-playground / stylable-components / test / components / time-picker.spec.tsx View on Github external
it('should set focus on hh on first input', () => {
                        simulate.blur(secondInputMM);
                        simulate.focus(firstStepperUp);
                        simulate.click(firstStepperUp);
                        expect(document.activeElement === firstInputHH).to.be.true;
                    });
                });
github wix-playground / stylable-components / test / components / number-input.spec.tsx View on Github external
await waitForDom(() => {
                        const input = select('NATIVE_INPUT_NUMBER') as HTMLInputElement;

                        simulateKeyInput(input, '1');
                        simulateKeyInput(input, '2');
                        simulateKeyInput(input, '3');

                        simulate.blur(input);

                        assertCommit(input, onChange, 123);
                    });
                });
github wix-playground / stylable-components / test / components / time-picker.spec.tsx View on Github external
beforeEach(() => {
                    simulate.blur(firstInputMM);
                    simulate.click(secondInputMM);
                    simulate.focus(secondInputMM);
                });
                describe.skip('click on stepper in first input', () => {
github wix-playground / stylable-components / test-kit / components / date-picker-driver.ts View on Github external
public changeDate(value: string): void {
        trigger.change(this.input, value);
        simulate.blur(this.input);
    }