How to use the test-drive-react.simulate.change 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(hh);
                hh.value = '1';
                simulate.change(hh);
            });
            it('should set focus state', () => {
github wix-playground / stylable-components / test / components / time-picker.spec.tsx View on Github external
beforeEach(() => {
                simulate.focus(mm);
                mm.value = '7';
                simulate.change(mm);
            });
            it('should set focus state', () => {
github wix-playground / stylable-components / test / components / toggle.spec.tsx View on Github external
it('pressing space on focused input should trigger onChange', function() {
            const input = renderer.select('TOGGLE_INPUT');
            simulate.focus(input);
            simulate.change(input);
            expect(onChange).to.have.been.calledOnce;
            expect(onChange).to.have.been.calledWithExactly({value: true});
        });
    });
github wix-playground / stylable-components / test / components / toggle.spec.tsx View on Github external
it('should be unchecked after click', function() {
                simulate.change(toggle.querySelector('input'));
                hasCssState(toggle, styles, {checked: false});
            });
        });
github wix-playground / stylable-components / test / components / auto-complete.spec.tsx View on Github external
it('invokes the onChange when text is entered to label', () => {
        const onChange = sinon.spy();
        const {select} = clientRenderer.render();

        select(autoComp, autoCompInput)!.value = 'abc';
        simulate.change(select(autoComp, autoCompInput));

        return bodyWaitForDom(() => {
            expect(onChange).to.have.been.calledOnce;
            expect(onChange).to.have.been.calledWithMatch({value: 'abc'});
        });
    });
github wix-playground / stylable-components / test / utils / simulate-key-input.ts View on Github external
export function simulateKeyInput(
    input: HTMLInputElement,
    value: string
) {
    input.value += value;
    simulate.change(input);
}