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

Refactor logic for HEAR multi-item incentive names #188

Merged
merged 2 commits into from
Sep 28, 2024

Conversation

oyamauchi
Copy link
Member

@oyamauchi oyamauchi commented Sep 23, 2024

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 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.
Copy link

vercel bot commented Sep 23, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated (UTC)
embed-rewiringamerica-org ✅ Ready (Inspect) Visit Preview Sep 27, 2024 10:15pm

@oyamauchi
Copy link
Member Author

This Cypress failure is baffling -- it's an a11y check failure, claiming insufficient contrast on the text labels in some, but not all, of the project dropdown items (???) But it fails consistently, locally and on CI, so there must be something going on.

Comment on lines +198 to +200
const itemsToRender = incentiveItems.filter(item =>
PROJECTS[project].items.includes(item),
);
Copy link
Contributor

Choose a reason for hiding this comment

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

ah, yeah this makes more sense

@oyamauchi oyamauchi merged commit 1c6aa13 into main Sep 28, 2024
3 checks passed
@oyamauchi oyamauchi deleted the owen.names-refactor branch September 28, 2024 00:29
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.

2 participants