Commit 7f778306 authored by Rafal Augustyniak's avatar Rafal Augustyniak
Browse files

add tests to experimentation packages

parent 920a28ba
Showing with 110 additions and 1 deletion
+110 -1
......@@ -104,7 +104,7 @@ const EnhancedTableHead: React.FC<EnhancedTableHeadProps> = ({
interface Column {
id: string;
header: string;
sortable: boolean;
sortable?: boolean;
}
interface ListViewProps {
......
// Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`List Experiments workflow renders correctly 1`] = `
"<PageLayout heading={[undefined]} error=\\"\\">
<ButtonGroup buttons={{...}} />
<ListView columns={{...}} items={[undefined]} onRowSelection={[Function: onRowSelection]} />
</PageLayout>"
`;
// Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`View Experiment Run workflow renders correctly 1`] = `
"<PageLayout heading={[undefined]} error=\\"\\">
<styled.form />
</PageLayout>"
`;
import React from "react";
import { shallow } from "enzyme";
import ListExperiments from "../list-experiments";
jest.mock("react-router-dom", () => {
return {
...jest.requireActual("react-router-dom"),
useNavigate: jest.fn(),
};
});
describe("List Experiments workflow", () => {
let component;
beforeAll(() => {
const links = [
{
displayName: "button_1",
path: "/path1",
},
];
const columns = [
{
id: "column_1",
header: "column 1",
},
{
id: "column_2",
header: "column 2",
},
];
component = shallow(<ListExperiments columns={columns} links={links} />);
});
it("renders correctly", () => {
expect(component.debug()).toMatchSnapshot();
});
});
import React from "react";
import { shallow } from "enzyme";
import ViewExperimentRun from "../view-experiment-run";
jest.mock("react-router-dom", () => {
return {
...jest.requireActual("react-router-dom"),
useNavigate: jest.fn(),
};
});
describe("View Experiment Run workflow", () => {
let component;
beforeAll(() => {
component = shallow(<ViewExperimentRun />);
});
it("renders correctly", () => {
expect(component.debug()).toMatchSnapshot();
});
});
// Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`Start Experiment workflow renders correctly 1`] = `
"<PageLayout heading={[undefined]} error={[undefined]}>
<ExperimentDetails upstreamClusterTypeSelectionEnabled={true} onStart={[Function: onStart]} />
<Dialog title=\\"Experiment Start Confirmation\\" content=\\"Are you sure you want to start an experiment? The experiment will start immediately and you will be moved to experiment details view page.\\" open={false} onClose={[Function: onClose]} buttons={{...}} />
</PageLayout>"
`;
import React from "react";
import { shallow } from "enzyme";
import StartExperiment from "../start-experiment";
jest.mock("react-router-dom", () => {
return {
...jest.requireActual("react-router-dom"),
useNavigate: jest.fn(),
};
});
describe("Start Experiment workflow", () => {
let component;
beforeAll(() => {
component = shallow(<StartExperiment upstreamClusterTypeSelectionEnabled />);
});
it("renders correctly", () => {
expect(component.debug()).toMatchSnapshot();
});
});
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment