mirror of
https://github.com/fleetdm/fleet
synced 2026-04-21 13:37:30 +00:00
* add prettier and have it format all js code except website: : * trying running prettier check in CI * fix runs on in CI * change CI job name * fix prettier erros and fix CI
26 lines
712 B
JavaScript
26 lines
712 B
JavaScript
import React from "react";
|
|
import { mount } from "enzyme";
|
|
|
|
import ClickableTableRow from "./index";
|
|
|
|
const clickSpy = jest.fn();
|
|
const dblClickSpy = jest.fn();
|
|
|
|
const props = {
|
|
onClick: clickSpy,
|
|
onDoubleClick: dblClickSpy,
|
|
};
|
|
|
|
describe("ClickableTableRow - component", () => {
|
|
it("calls onDblClick when row is double clicked", () => {
|
|
const queryRow = mount(<ClickableTableRow {...props} />);
|
|
queryRow.find("tr").simulate("doubleclick");
|
|
expect(dblClickSpy).toHaveBeenCalled();
|
|
});
|
|
|
|
it("calls onSelect when row is clicked", () => {
|
|
const queryRow = mount(<ClickableTableRow {...props} />);
|
|
queryRow.find("tr").simulate("click");
|
|
expect(clickSpy).toHaveBeenCalled();
|
|
});
|
|
});
|