-
Notifications
You must be signed in to change notification settings - Fork 39
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[MDS-6129] streamline status actions (#3245)
* wip * implement disabled fields. * update disabled fields implementation. * update test snapshot. * update tests. * update logic. * update unit tests snapshot. * fix cypress test * add tests * update test.
- Loading branch information
1 parent
901195a
commit 2ed8d13
Showing
33 changed files
with
5,856 additions
and
180 deletions.
There are no files selected for viewing
20 changes: 20 additions & 0 deletions
20
migrations/sql/V2024.09.09.08.00__add_project_summary_status_code.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
INSERT INTO | ||
project_summary_status_code ( | ||
project_summary_status_code, | ||
description, | ||
alias_description, | ||
display_order, | ||
active_ind, | ||
create_user, | ||
update_user | ||
) | ||
VALUES | ||
( | ||
'CHR', | ||
'Change Requested', | ||
'Change Requested', | ||
210, | ||
true, | ||
'system-mds', | ||
'system-mds' | ||
); |
50 changes: 50 additions & 0 deletions
50
services/common/src/components/projectSummary/Agent.spec.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
import React from "react"; | ||
import { render } from "@testing-library/react"; | ||
import { ReduxWrapper } from "@mds/common/tests/utils/ReduxWrapper"; | ||
import { PROJECTS, STATIC_CONTENT, AUTHENTICATION } from "@mds/common/constants/reducerTypes"; | ||
import { FORM } from "../.."; | ||
import FormWrapper from "../forms/FormWrapper"; | ||
import * as MOCK from "@mds/common/tests/mocks/dataMocks"; | ||
import { Agent } from "./Agent"; | ||
|
||
const initialState = { | ||
form: { | ||
[FORM.ADD_EDIT_PROJECT_SUMMARY]: { | ||
values: { | ||
status_code: "DFT", | ||
agent: { | ||
credential_id: 1000, | ||
party_type_code: null, | ||
address: { address_type_code: "CAN", sub_division_code: "BC" }, | ||
}, | ||
is_agent: true, | ||
}, | ||
}, | ||
}, | ||
[PROJECTS]: { | ||
projectSummary: MOCK.PROJECT_SUMMARY, | ||
}, | ||
[STATIC_CONTENT]: { | ||
provinceOptions: MOCK.BULK_STATIC_CONTENT_RESPONSE.provinceOptions, | ||
}, | ||
[AUTHENTICATION]: { | ||
systemFlag: "core", | ||
}, | ||
}; | ||
|
||
describe("Agent Component", () => { | ||
it("should render the component with expected fields", () => { | ||
const { container } = render( | ||
<ReduxWrapper initialState={initialState}> | ||
<FormWrapper | ||
name={FORM.ADD_EDIT_PROJECT_SUMMARY} | ||
initialValues={initialState} | ||
onSubmit={() => {}} | ||
> | ||
<Agent /> | ||
</FormWrapper> | ||
</ReduxWrapper> | ||
); | ||
expect(container).toMatchSnapshot(); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
42 changes: 42 additions & 0 deletions
42
services/common/src/components/projectSummary/Applicant.spec.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
import React from "react"; | ||
import { render } from "@testing-library/react"; | ||
import { ReduxWrapper } from "@mds/common/tests/utils/ReduxWrapper"; | ||
import { PROJECTS, STATIC_CONTENT, AUTHENTICATION } from "@mds/common/constants/reducerTypes"; | ||
import { FORM } from "../.."; | ||
import FormWrapper from "../forms/FormWrapper"; | ||
import * as MOCK from "@mds/common/tests/mocks/dataMocks"; | ||
import Applicant from "./Applicant"; | ||
|
||
const initialState = { | ||
form: { | ||
[FORM.ADD_EDIT_PROJECT_SUMMARY]: { | ||
values: {}, | ||
}, | ||
}, | ||
[PROJECTS]: { | ||
projectSummary: MOCK.PROJECT_SUMMARY, | ||
}, | ||
[STATIC_CONTENT]: { | ||
provinceOptions: MOCK.BULK_STATIC_CONTENT_RESPONSE.provinceOptions, | ||
}, | ||
[AUTHENTICATION]: { | ||
systemFlag: "ms", | ||
}, | ||
}; | ||
|
||
describe("Applicant Component", () => { | ||
it("should render the component with expected fields", () => { | ||
const { container } = render( | ||
<ReduxWrapper initialState={initialState}> | ||
<FormWrapper | ||
name={FORM.ADD_EDIT_PROJECT_SUMMARY} | ||
initialValues={initialState} | ||
onSubmit={() => {}} | ||
> | ||
<Applicant /> | ||
</FormWrapper> | ||
</ReduxWrapper> | ||
); | ||
expect(container).toMatchSnapshot(); | ||
}); | ||
}); |
Oops, something went wrong.