Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(mocks): Edit SPA mock item ID format #1071

Merged
merged 3 commits into from
Jan 28, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion lib/lambda/search.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ describe("getSearchData Handler", () => {
const body = JSON.parse(res.body);
expect(body).toBeTruthy();
expect(body?.hits?.hits).toBeTruthy();
expect(body?.hits?.hits?.length).toEqual(16);
expect(body?.hits?.hits?.length).toEqual(17);
});

it("should handle errors during processing", async () => {
Expand Down
26 changes: 25 additions & 1 deletion mocks/data/items.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ export const EXISTING_ITEM_ID = "MD-00-0000";
export const NOT_FOUND_ITEM_ID = "MD-0004.R00.00";
export const NOT_EXISTING_ITEM_ID = "MD-11-0000";
export const TEST_ITEM_ID = "MD-0005.R01.00";
export const TEST_SPA_ITEM_ID = "MD-11-2020";
export const EXISTING_ITEM_TEMPORARY_EXTENSION_ID = "MD-0005.R01.TE00";
export const HI_TEST_ITEM_ID = "HI-0000.R00.00";
export const CAPITATED_INITIAL_ITEM_ID = "SS-2234.R00.00";
Expand Down Expand Up @@ -154,6 +155,29 @@ const items: Record<string, TestItemResult> = {
},
},
],
authority: "1915(c)",
},
},
[TEST_SPA_ITEM_ID]: {
_id: TEST_SPA_ITEM_ID,
found: true,
_source: {
id: TEST_SPA_ITEM_ID,
seatoolStatus: SEATOOL_STATUS.APPROVED,
actionType: "New",
state: "MD",
origin: "OneMAC",
changedDate: "2024-11-26T18:17:21.557Z",
changelog: [
{
_id: `${TEST_SPA_ITEM_ID}-001`,
_source: {
id: `${TEST_SPA_ITEM_ID}-0001`,
event: "new-medicaid-submission",
packageId: TEST_SPA_ITEM_ID,
},
},
],
authority: "Medicaid SPA",
},
},
Expand Down Expand Up @@ -501,7 +525,7 @@ const items: Record<string, TestItemResult> = {
},
};

export const TEST_MED_SPA_ITEM = items[TEST_ITEM_ID] as opensearch.main.ItemResult;
export const TEST_MED_SPA_ITEM = items[TEST_SPA_ITEM_ID] as opensearch.main.ItemResult;
export const TEST_CHIP_SPA_ITEM = items[WITHDRAWN_CHANGELOG_ITEM_ID] as opensearch.main.ItemResult;
export const TEST_1915B_ITEM = items[EXISTING_ITEM_APPROVED_NEW_ID] as opensearch.main.ItemResult;
export const TEST_1915C_ITEM = items[INITIAL_RELEASE_APPK_ITEM_ID] as opensearch.main.ItemResult;
Expand Down
4 changes: 2 additions & 2 deletions react-app/src/api/useGetPackageActions.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { Action } from "shared-types";
import {
errorApiPackageActionsHandler,
WITHDRAW_RAI_ITEM_C,
TEST_ITEM_ID,
TEST_SPA_ITEM_ID,
NOT_FOUND_ITEM_ID,
NOT_EXISTING_ITEM_ID,
setMockUsername,
Expand All @@ -25,7 +25,7 @@ describe("getPackageActions test", () => {
});

it("should return empty actions for package without actions", async () => {
const actions = await getPackageActions(TEST_ITEM_ID);
const actions = await getPackageActions(TEST_SPA_ITEM_ID);
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I changed this because the SPA item had actions apparently?

expect(actions).toEqual([]);
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import {
EXISTING_ITEM_APPROVED_NEW_ID,
NOT_FOUND_ITEM_ID,
VALID_ITEM_TEMPORARY_EXTENSION_ID,
TEST_ITEM_ID,
TEST_SPA_ITEM_ID,
} from "mocks";

const upload = uploadFiles<(typeof formSchemas)["temporary-extension"]>();
Expand All @@ -34,7 +34,7 @@ describe("Temporary Extension", () => {
// set the Item Id to TEST_ITEM_ID
await renderFormWithPackageSectionAsync(
<TemporaryExtensionForm />,
TEST_ITEM_ID,
TEST_SPA_ITEM_ID,
"Medicaid SPA",
);

Expand All @@ -50,7 +50,7 @@ describe("Temporary Extension", () => {
"Approved Initial or Renewal Waiver Number",
);
// grab second TEST_ITEM_ID (first one is in the breadcrumbs)
const approvedInitialAndRenewalValue = screen.getAllByText(TEST_ITEM_ID)[1];
const approvedInitialAndRenewalValue = screen.getAllByText(TEST_SPA_ITEM_ID)[1];

// ensure Approved Initial and Renewal label and value exist and are in correct order
expect(
Expand Down
Loading