-
Notifications
You must be signed in to change notification settings - Fork 1
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
feat: [188623677] add environmental questionnaire for air #9242
base: main
Are you sure you want to change the base?
Conversation
web/src/components/tasks/environment-questionnaire/air/CheckAirPermits.tsx
Outdated
Show resolved
Hide resolved
71596a2
to
e2a2a00
Compare
e2a2a00
to
ff82192
Compare
ff82192
to
d48587f
Compare
@@ -80,7 +80,6 @@ describe("v152_add_land_to_environment_data", () => { | |||
it("adds land section to environment data", () => { | |||
const id = "biz-1"; | |||
const v151Business = generatev151Business({ | |||
taskProgress: { "waste-permitting": "IN_PROGRESS" }, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why did we remove this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jphechter I took it out because it's not necessary for the test that the waste task is in progress, it's not relevant to what we are trying to test. We just want to ensure that the land section gets added.
d48587f
to
023ec86
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have a question about the tests for the migration, but otherwise, this looks good to me.
it("migrates environment data when land task is COMPLETED", () => { | ||
const id = "biz-1"; | ||
const v152Business = generatev152Business({ | ||
taskProgress: { "land-permitting": "COMPLETED" }, | ||
environmentData: { | ||
land: generatev152LandData({ | ||
questionnaireData: generatev152LandQuestionnaireData({ | ||
takeOverExistingBiz: false, | ||
propertyAssessment: true, | ||
constructionActivities: true, | ||
siteImprovementWasteLands: false, | ||
noLand: false, | ||
}), | ||
submitted: true, | ||
}), | ||
}, | ||
id, | ||
}); | ||
const v152User = generatev152UserData({ | ||
businesses: { "biz-1": v152Business }, | ||
}); | ||
|
||
const v153User = migrate_v152_to_v153(v152User); | ||
|
||
expect(v153User.businesses[id].environmentData?.land?.questionnaireData).toEqual({ | ||
takeOverExistingBiz: false, | ||
propertyAssessment: true, | ||
constructionActivities: true, | ||
siteImprovementWasteLands: false, | ||
noLand: false, | ||
}); | ||
expect(v153User.businesses[id].environmentData?.land?.submitted).toEqual(true); | ||
expect(v153User.businesses[id].taskProgress["land-permitting"]).toEqual("COMPLETED"); | ||
}); | ||
|
||
it("migrates environment data when land task is IN_PROGRESS", () => { | ||
const id = "biz-1"; | ||
const v152Business = generatev152Business({ | ||
taskProgress: { "land-permitting": "IN_PROGRESS" }, | ||
environmentData: { | ||
land: generatev152LandData({ | ||
questionnaireData: generatev152LandQuestionnaireData({ | ||
takeOverExistingBiz: false, | ||
propertyAssessment: true, | ||
constructionActivities: true, | ||
siteImprovementWasteLands: false, | ||
noLand: false, | ||
}), | ||
submitted: false, | ||
}), | ||
}, | ||
id, | ||
}); | ||
const v152User = generatev152UserData({ | ||
businesses: { "biz-1": v152Business }, | ||
}); | ||
|
||
const v153User = migrate_v152_to_v153(v152User); | ||
|
||
expect(v153User.businesses[id].environmentData?.land?.questionnaireData).toEqual({ | ||
takeOverExistingBiz: false, | ||
propertyAssessment: true, | ||
constructionActivities: true, | ||
siteImprovementWasteLands: false, | ||
noLand: false, | ||
}); | ||
expect(v153User.businesses[id].environmentData?.land?.submitted).toEqual(false); | ||
expect(v153User.businesses[id].taskProgress["land-permitting"]).toEqual("IN_PROGRESS"); | ||
}); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm a little confused what the point of these tests are. Based on the v153
migration, it looks like the only thing we're doing is adding a key to environmentData
. I'm reading these tests as though this is indicating some conditional logic should be happening. Are we missing functionality in the migration, or are these tests supposed to be checking for something else?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jphechter I added these tests as a suggestion from Aaron on the previous migration. The intention was to check that the existing data within environmentData
gets transferred over properly to the new version regardless of its state. In hindsight, they are a bit exhaustive, but that was the reason for their addition.
Description
Ticket
This pull request resolves #188623677.
Approach
environmentData
Steps to Test
All other businesses
for industryNotes
Code author checklist
userData
(includingprofileData
,formationData
etc), then I added a new migration filecmsCollections.ts
(see CMS Additions in Engineering Reference/FAQ on the engineering documentation site).env
values in both.env-template
and in Bitwarden