mirror of
https://github.com/empayre/fleet.git
synced 2024-11-08 01:38:57 +00:00
efb35b537a
* 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
61 lines
1.4 KiB
JavaScript
61 lines
1.4 KiB
JavaScript
import React from "react";
|
|
import { mount } from "enzyme";
|
|
import { noop } from "lodash";
|
|
|
|
import QueryPageSelectTargets from "components/queries/QueryPageSelectTargets";
|
|
|
|
describe("QueryPageSelectTargets - component", () => {
|
|
const DEFAULT_CAMPAIGN = {
|
|
hosts_count: {
|
|
total: 0,
|
|
},
|
|
};
|
|
|
|
const defaultProps = {
|
|
campaign: DEFAULT_CAMPAIGN,
|
|
onFetchTargets: noop,
|
|
onRunQuery: noop,
|
|
onStopQuery: noop,
|
|
onTargetSelect: noop,
|
|
query: "select * from users",
|
|
queryIsRunning: false,
|
|
selectedTargets: [],
|
|
targetsCount: 0,
|
|
};
|
|
|
|
describe("rendering", () => {
|
|
const DefaultComponent = mount(
|
|
<QueryPageSelectTargets {...defaultProps} />
|
|
);
|
|
|
|
it("renders", () => {
|
|
expect(DefaultComponent.length).toEqual(
|
|
1,
|
|
"QueryPageSelectTargets did not render"
|
|
);
|
|
});
|
|
|
|
it("renders a SelectTargetsDropdown component", () => {
|
|
const SelectTargetsDropdown = DefaultComponent.find(
|
|
"SelectTargetsDropdown"
|
|
);
|
|
|
|
expect(SelectTargetsDropdown.length).toEqual(
|
|
1,
|
|
"SelectTargetsDropdown did not render"
|
|
);
|
|
});
|
|
|
|
it("renders a QueryProgressDetails component", () => {
|
|
const QueryProgressDetails = DefaultComponent.find(
|
|
"QueryProgressDetails"
|
|
);
|
|
|
|
expect(QueryProgressDetails.length).toEqual(
|
|
1,
|
|
"QueryProgressDetails did not render"
|
|
);
|
|
});
|
|
});
|
|
});
|