How to use the test-drive-react.simulate.click 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 / auto-complete.spec.tsx View on Github external
it('calls the onOpenStateChange event when selecting an item', async () => {
        const onOpenStateChange = sinon.spy();
        const {select, waitForDom} = clientRenderer.render(
            
        );

        await waitForDom(() => expect(select(autoComp)).to.be.present());
        simulate.click(bodySelect('LIST')!.children[0]);
        await bodyWaitForDom(() => {
            expect(onOpenStateChange).to.have.been.calledOnce;
            expect(onOpenStateChange).to.have.been.calledWithMatch({value: false});
        });
    });
github wix-playground / stylable-components / test / components / time-picker.spec.tsx View on Github external
beforeEach(() => {
                simulate.focus(hh);
                simulate.click(hh);
                simulate.click(stepperDecrement, {shiftKey: true});
            });
            it('hh input should have "12" value', () => {
github wix-playground / stylable-components / test / components / drop-down.spec.tsx View on Github external
it('renders a dropdown, opens it with a click, selects an item', async () => {
        const {select, waitForDom} = clientRenderer.render();

        await waitForDom(() => expect(select(dropDownDemo, list)).to.be.absent());

        simulate.click(select(dropDownDemo, input));

        await waitForDom(() => expect(select(dropDownDemo, list)).to.be.present());

        simulate.click(select(dropDownDemo, list)!.children![0].children[0]);

        return waitForDom(() => {
            expect(select(dropDownDemo, list)).to.be.absent();
            expect(select(dropDownDemo)).to.have.text(items[0].label);
        });
    });
github wix-playground / stylable-components / test / components / time-picker.spec.tsx View on Github external
beforeEach(() => {
                simulate.focus(mm);
                simulate.click(mm);
                simulate.click(stepperIncrement, {shiftKey: true});
            });
            it('hh input should have "14" value', () => {
github wix-playground / stylable-components / test / components / time-picker.spec.tsx View on Github external
it('should keep focus on mm segment on first input', () => {
                simulate.focus(firstInputMM);
                simulate.click(firstStepperUp);
                expect(document.activeElement === firstInputMM).to.be.true;
            });
        });
github wix-playground / stylable-components / test / components / number-input.spec.tsx View on Github external
await waitForDom(() => {
                    const fixture = select('FIXTURE');
                    const numberInput = select('NATIVE_INPUT_NUMBER');

                    simulate.click(fixture);
                    simulate.click(fixture);
                    simulate.click(fixture);

                    expect(numberInput).to.have.value(String(initialValue));
                });
            });
github wix-playground / stylable-components / test-kit / components / drop-down-driver.ts View on Github external
public clickOnItem(idx: number): void {
        if (this.items) {
            this.items[idx] && simulate.click(this.items![idx]);
        }
    }
github wix-playground / stylable-components / test / components / time-picker.spec.tsx View on Github external
beforeEach(() => {
                simulate.focus(hh);
                simulate.click(hh);
                simulate.keyDown(hh, {keyCode: keycode('up')});
            });
            itDesktop('hh input should have "12" value', () => {
github wix-playground / stylable-components / test-kit / components / number-input-driver.ts View on Github external
public clickDecrement(opts?: Modifiers) {
        simulate.click(this.decrement, opts);
    }
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;
                    const increment = select('STEPPER_INCREMENT');

                    input.value = String(newValue);

                    simulate.click(increment);

                    expect(input).to.have.value(String(newValue + 1));

                });
            });