-
Notifications
You must be signed in to change notification settings - Fork 0
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
Update item name feature to handle HEAR rebate projects #187
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
fbe2a0c
to
9343464
Compare
|
||
test('HEAR rebates applicable to multiple appliances', () => { | ||
expect( | ||
itemName(['heat_pump_clothes_dryer', 'electric_stove'], msg, 'cooking'), |
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.
Should 'heat_pump_clothes_dryer' be included here?
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.
This is fine as-is, but I think introducing project
into this logic allows for a more general solution:
- At the top of
itemName
, compute the intersection of the Project's items and theitems
array. - If the result is one item, use the existing single-item logic.
- If the result is multiple items (as it will be in all the preexisting cases), use the existing
multipleItemsName
.
That would handle this HEAR case cleanly, as well as others I could imagine like a HEAR incentive that includes non-heat-pump dryers, heat pump dryers, and stoves. (Non-HP + HP dryer is already handled in the multi-item logic, so you'd get that for free without having to duplicate it in hearName
, for example.)
Approving in case you want to just roll with this for expediency, but I think the above is where we should end up eventually.
Going to merge this to fix the outstanding problem with RI; we can follow up with my suggestion later. |
## Description This is what I was talking about in #187. It ended up being more involved than I thought, because Jest couldn't handle the JSX in the file `projects.tsx`. I tried other values of the `jsx` setting in tsconfig.json, but then Jest couldn't handle the magical `jsx:...` imports in projects.tsx (understandable; that's done using Parcel magic). So I factored out the icons from projects.tsx into a new file, and now the unit test works fine. ## Test Plan `yarn test`. The unit test is unmodified but still passes. Look at RI's HEAR incentive for stoves/dryers, and make sure it shows up and has the correct headline.
## Description This is what I was talking about in #187. It ended up being more involved than I thought, because Jest couldn't handle the JSX in the file `projects.tsx`. I tried other values of the `jsx` setting in tsconfig.json, but then Jest couldn't handle the magical `jsx:...` imports in projects.tsx (understandable; that's done using Parcel magic). So I factored out the icons from projects.tsx into a new file, and now the unit test works fine. ## Test Plan `yarn test`. The unit test is unmodified but still passes. Look at RI's HEAR incentive for stoves/dryers, and make sure it shows up and has the correct headline. Make sure the icons in the projects dropdown are correct. The one in the dropdown button should be purple, and in the menu should be grey-700 (i.e. almost black).
Description
This fixes an issue in which HEAR rebate cards weren't showing up when the technologies they applied to were considered to be in multiple project categories, i.e. Rhode Island's rebates being applicable to stoves and clothes dryers
Test Plan
Zip code: 02903; hhsize 1, income 30000