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

feat: [188623677] add environmental questionnaire for air #9242

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

SirSamuelJoseph
Copy link
Contributor

@SirSamuelJoseph SirSamuelJoseph commented Dec 6, 2024

Description

  • Added env task for the air media area!

Ticket

This pull request resolves #188623677.

Approach

  • this builds off the work done for environmental questionnaire for waste and land
  • added migration v153 which adds air to environmentData

Steps to Test

  • Onboard as a new business
  • Select All other businesses for industry
  • You should now see the Air Task under step 3 of the roadmap

Notes

Code author checklist

  • I have rebased this branch from the latest main branch
  • I have performed a self-review of my code
  • I have created and/or updated relevant documentation on the engineering documentation website
  • I have not used any relative imports
  • I have pruned any instances of unused code
  • I have not added any markdown to labels, titles and button text in config
  • If I added/updated any values in userData (including profileData, formationData etc), then I added a new migration file
  • I have checked for and removed instances of unused config from CMS
  • If I added any new collections to the CMS config, then I updated the search tool and cmsCollections.ts (see CMS Additions in Engineering Reference/FAQ on the engineering documentation site)
  • I have updated relevant .env values in both .env-template and in Bitwarden

@somabadri somabadri force-pushed the eco-air-waste-permit-task branch 9 times, most recently from 71596a2 to e2a2a00 Compare January 13, 2025 19:07
@somabadri somabadri changed the title feat: [#188623677] Add air waste task feat: [188623677] add environmental questionnaire for air Jan 13, 2025
@somabadri somabadri force-pushed the eco-air-waste-permit-task branch from e2a2a00 to ff82192 Compare January 13, 2025 19:57
@somabadri somabadri marked this pull request as ready for review January 13, 2025 19:59
@somabadri somabadri self-assigned this Jan 13, 2025
@somabadri somabadri force-pushed the eco-air-waste-permit-task branch from ff82192 to d48587f Compare January 13, 2025 20:38
@@ -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" },
Copy link
Contributor

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?

Copy link
Contributor

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.

@somabadri somabadri force-pushed the eco-air-waste-permit-task branch from d48587f to 023ec86 Compare January 14, 2025 19:56
Copy link
Contributor

@jphechter jphechter left a 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.

Comment on lines +10 to +78
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");
});
Copy link
Contributor

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?

Copy link
Contributor

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants