Skip to content

Commit

Permalink
adding more coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
ailZhou committed Dec 4, 2024
1 parent 4081ce2 commit a9cdb27
Show file tree
Hide file tree
Showing 6 changed files with 30 additions and 12 deletions.
4 changes: 2 additions & 2 deletions services/app-api/forms/qm.ts
Original file line number Diff line number Diff line change
Expand Up @@ -279,7 +279,7 @@ export const qmReportTemplate: ReportTemplate = {
measureDisplay: "quality",
},
],
} as MeasurePageTemplate,
},
[MeasureTemplateName["LTSS-2"]]: {
id: "LTSS-2",
title: "LTSS-2: Comprehensive Person-Centered Plan and Update",
Expand Down Expand Up @@ -309,5 +309,5 @@ export const qmReportTemplate: ReportTemplate = {
sidebar: false,
elements: [],
},
},
} as Record<MeasureTemplateName, MeasurePageTemplate>,
};
5 changes: 5 additions & 0 deletions services/ui-src/src/components/report/Page.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ jest.mock("react-router-dom", () => ({
jest.mock("../../utils/state/useStore", () => ({
useStore: () => ({
setCurrentPageId: jest.fn(),
cmit: 960,
}),
}));
jest.mock("react-hook-form", () => ({
Expand Down Expand Up @@ -69,6 +70,10 @@ const elements: PageElement[] = [
{
type: ElementType.StatusTable,
},
{
type: ElementType.QualityMeasureTable,
measureDisplay: "quality",
},
];

describe("Page Component", () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,6 @@ export const QualityMeasureTableElement = () => {
const { cmit } = useStore();
const cmitInfo = CMIT_LIST.find((item) => item.cmit === cmit);

const onEdit = () => {};

// Build Rows
const rows = cmitInfo?.deliverySystem.map((system, index) => {
return (
Expand All @@ -30,7 +28,7 @@ export const QualityMeasureTableElement = () => {
<Text>CMIT# {cmit}</Text>
</Td>
<Td>
<Button variant="outline" onClick={() => onEdit()}>
<Button variant="outline" onClick={() => {}}>
Edit
</Button>
</Td>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ const testReport: Report = {
measureDisplay: "quality",
},
],
} as MeasurePageTemplate,
},
[MeasureTemplateName["LTSS-2"]]: {
id: "",
title: "",
Expand All @@ -95,7 +95,7 @@ const testReport: Report = {
type: PageType.Measure,
elements: [],
},
},
} as Record<MeasureTemplateName, MeasurePageTemplate>,
};

const mockUseParams = jest.fn();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ const testReport: Report = {
type: PageType.Measure,
elements: [],
},
},
} as Record<MeasureTemplateName, MeasurePageTemplate>,
};

describe("state/management/reportState: buildState", () => {
Expand Down
23 changes: 19 additions & 4 deletions services/ui-src/src/utils/testing/setupJest.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ import {
HcbsUserState,
UserContextShape,
AdminBannerState,
HcbsReportState,
Report,
} from "types";
import { mockBannerData } from "./mockBanner";
// GLOBALS
Expand Down Expand Up @@ -182,12 +184,25 @@ export const mockAdminUserStore: HcbsUserState = {
setShowLocalLogins: () => {},
};

export const mockReportStore: HcbsReportState = {
modalOpen: false,
cmit: 960,
setReport: () => {},
setCurrentPageId: () => {},
setModalOpen: () => {},
setModalComponent: () => {},
setAnswers: () => {},
setMeasure: () => {},
};

// BOUND STORE

export const mockUseStore: HcbsUserState & AdminBannerState = {
...mockStateUserStore,
...mockBannerStore,
};
export const mockUseStore: HcbsUserState & AdminBannerState & HcbsReportState =
{
...mockStateUserStore,
...mockBannerStore,
...mockReportStore,
};

export const mockUseAdminStore: HcbsUserState & AdminBannerState = {
...mockAdminUserStore,
Expand Down

0 comments on commit a9cdb27

Please sign in to comment.