Skip to content

Commit

Permalink
testing & solarlint issues on CORE
Browse files Browse the repository at this point in the history
  • Loading branch information
taraepp committed Oct 21, 2024
1 parent b3bbecb commit f637b5f
Show file tree
Hide file tree
Showing 10 changed files with 933 additions and 258 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,9 @@ export interface IProjectStage {
title: string;
key: string;
status: string;
payload: IProjectSummary;
statusHash: any;
required: boolean;
navigateForward: (source: string, status: string) => void;
payload?: IProjectSummary;
statusHash?: any;
required?: boolean;
isOptional?: boolean;
navigateForward?: (source: string, status: string) => void;
}
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import React, { FC } from "react";
import React, { FC, ReactNode } from "react";
import { Table } from "antd";
import { IProjectStage } from "@mds/common/interfaces/projects/projectStage.interface";
import { ColumnsType } from "antd/es/table";

interface TableProjectStage extends IProjectStage {
link: string;
link?: Element | ReactNode;
}
interface ProjectStagesTableProps {
projectStages: TableProjectStage[];
Expand Down Expand Up @@ -45,10 +45,10 @@ export const ProjectStagesTable: FC<ProjectStagesTableProps> = ({ projectStages
if (text === "STATUS") {
label = text;
} else {
label =
record.key && record.stage_status
? `[${record.stage_status_hash[text]}]` || "N/A"
: "[Not submitted]";
label = "[Not submitted]";
if (record.key && record.stage_status) {
label = record.stage_status_hash[text] ? `[${record.stage_status_hash[text]}]` : "N/A";
}
}
return (
<div title="Stage Status">
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
import React from "react";
import { render } from "@testing-library/react";
import { ProjectOverviewTab } from "@/components/mine/Projects/ProjectOverviewTab";
import * as MOCK from "@/tests/mocks/dataMocks";
import { PROJECTS, STATIC_CONTENT } from "@mds/common/constants/reducerTypes";
import { BrowserRouter } from "react-router-dom";
import { ReduxWrapper } from "@/tests/utils/ReduxWrapper";

const initialState = {
[PROJECTS]: {
projects: MOCK.PROJECTS.records,
project: MOCK.PROJECT,
projectSummary: MOCK.PROJECT_SUMMARY,
informationRequirementsTable: MOCK.INFORMATION_REQUIREMENTS_TABLE,
},
[STATIC_CONTENT]: MOCK.BULK_STATIC_CONTENT_RESPONSE,
};

describe("ProjectOverviewTab", () => {
it("renders properly", () => {
const { container } = render(
<BrowserRouter>
<ReduxWrapper initialState={initialState}>
<ProjectOverviewTab />
</ReduxWrapper>
</BrowserRouter>
);
expect(container).toMatchSnapshot();
});
});

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
import React from "react";
import { render } from "@testing-library/react";
import { ProjectStagesTable } from "@/components/mine/Projects/ProjectStagesTable";
import * as MOCK from "@/tests/mocks/dataMocks";
import { ReduxWrapper } from "@/tests/utils/ReduxWrapper";

const projectStages = [
{
title: "REQUIRED STAGES",
key: "req-stages-id",
status: "STATUS",
isTitle: true,
},
{
key: "ps-519",
link: <div>link 1</div>,
status: "DFT",
statusHash: {
WDN: "Withdrawn",
UNR: "Under review",
SUB: "Submitted",
OHD: "On Hold",
DFT: "Draft",
COM: "Complete",
CHR: "Change Requested",
ASG: "Assigned",
},
title: "Project description",
},
{
key: "ps-null",
link: <div>link 2</div>,
status: null,
statusHash: {
UNR: "Under review",
SUB: "Submitted",
DFT: "Draft",
CHR: "Change Requested",
APV: "Approved",
},
title: "Final Application",
},
{
title: "OPTIONAL STAGES",
key: "opt-stages-id",
status: "STATUS",
isOptional: true,
isTitle: true,
},
{
isOptional: true,
key: "irt-0",
link: <div>link 3</div>,
status: null,
statusHash: {
UNR: "Under review",
SUB: "Submitted",
DFT: "Draft",
CHR: "Change Requested",
APV: "Approved",
},
title: "Final IRT",
},
];

describe("ProjectStagesTable", () => {
it("renders properly", () => {
const { container } = render(<ProjectStagesTable projectStages={projectStages} />);
expect(container).toMatchSnapshot();
});
});

This file was deleted.

Loading

0 comments on commit f637b5f

Please sign in to comment.