Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
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});
});
});
beforeEach(() => {
simulate.focus(hh);
simulate.click(hh);
simulate.click(stepperDecrement, {shiftKey: true});
});
it('hh input should have "12" value', () => {
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);
});
});
beforeEach(() => {
simulate.focus(mm);
simulate.click(mm);
simulate.click(stepperIncrement, {shiftKey: true});
});
it('hh input should have "14" value', () => {
it('should keep focus on mm segment on first input', () => {
simulate.focus(firstInputMM);
simulate.click(firstStepperUp);
expect(document.activeElement === firstInputMM).to.be.true;
});
});
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));
});
});
public clickOnItem(idx: number): void {
if (this.items) {
this.items[idx] && simulate.click(this.items![idx]);
}
}
beforeEach(() => {
simulate.focus(hh);
simulate.click(hh);
simulate.keyDown(hh, {keyCode: keycode('up')});
});
itDesktop('hh input should have "12" value', () => {
public clickDecrement(opts?: Modifiers) {
simulate.click(this.decrement, opts);
}
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));
});
});