fleet/frontend/components/queries/QueryPageSelectTargets/QueryPageSelectTargets.tests.jsx
Gabe Hernandez efb35b537a
add prettier and have it format all fleet application code (#625)
* 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
2021-04-12 14:32:25 +01:00

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"
);
});
});
});