Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
beforeEach(() => {
simulate.focus(hh);
hh.value = '1';
simulate.change(hh);
});
it('should set focus state', () => {
beforeEach(() => {
simulate.focus(mm);
mm.value = '7';
simulate.change(mm);
});
it('should set focus state', () => {
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});
});
});
it('should be unchecked after click', function() {
simulate.change(toggle.querySelector('input'));
hasCssState(toggle, styles, {checked: false});
});
});
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'});
});
});
export function simulateKeyInput(
input: HTMLInputElement,
value: string
) {
input.value += value;
simulate.change(input);
}