Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
const mockResize: any = jest.fn();
// Due to client rect call, let's reset width to 0
const rendered: any = mount(
);
const initialWidth: number = rendered.state().width;
rendered
.find(`.${managedClasses.pane_resizeHandle}`)
.simulate("keyDown", { shiftKey: true, keyCode: KeyCodes.arrowLeft });
expect(rendered.state().width).toBe(initialWidth - 10);
});
const mockResize: any = jest.fn();
// Due to client rect call, let's reset width to 0
const rendered: any = mount(
);
const initialWidth: number = rendered.state().width;
rendered
.find(`.${managedClasses.pane_resizeHandle}`)
.simulate("keyDown", { keyCode: KeyCodes.arrowLeft });
expect(rendered.state().width).toBe(initialWidth - 1);
});
.prop("active")
).toBe(false);
expect(
rendered
.find(Tab.displayName)
.at(1)
.prop("active")
).toBe(true);
expect(
rendered
.find(Tab.displayName)
.at(2)
.prop("active")
).toBe(false);
tab2.simulate("keydown", { keyCode: KeyCodes.arrowLeft });
expect(
rendered
.find(Tab.displayName)
.at(0)
.prop("tabIndex")
).toEqual(0);
expect(
rendered
.find(Tab.displayName)
.at(1)
.prop("tabIndex")
).toEqual(-1);
expect(
rendered
.find(Tab.displayName)
case KeyCodes.enter:
case KeyCodes.space:
if (e.target === e.currentTarget) {
this.toggleItems(dataLocation);
}
break;
case KeyCodes.arrowDown:
this.focusNextTreeItem(dataLocation);
break;
case KeyCodes.arrowUp:
this.focusPreviousTreeItem(dataLocation);
break;
case KeyCodes.arrowRight:
this.focusAndOpenTreeItems(dataLocation);
break;
case KeyCodes.arrowLeft:
this.focusAndCloseTreeItems(dataLocation);
break;
case KeyCodes.home:
this.focusFirstTreeItem();
break;
case KeyCodes.end:
this.focusLastTreeItem();
break;
default:
break;
}
}
};
};
.prop("active")
).toBe(true);
expect(
rendered
.find(Tab.displayName)
.at(1)
.prop("active")
).toBe(false);
expect(
rendered
.find(Tab.displayName)
.at(2)
.prop("active")
).toBe(false);
tab1.simulate("keydown", { keyCode: KeyCodes.arrowLeft });
expect(onUpdate).toBeCalledWith(id2);
expect(
rendered
.find(Tab.displayName)
.at(0)
.prop("tabIndex")
).toEqual(0);
expect(
rendered
.find(Tab.displayName)
.at(1)
.prop("tabIndex")
).toEqual(-1);
expect(