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

Migrate ProductOptionsProvider to Vitest #2156

Closed

Conversation

mrkldshv
Copy link
Contributor

Description

Part of Shopify/hydrogen#670.

Before submitting the PR, please make sure you do the following:

  • Read the Contributing Guidelines
  • Provide a description in this PR that addresses what the PR is solving, or reference the issue that it solves (e.g. fixes #123)
  • Update docs in this repository according to your change
  • Run yarn changeset add if this PR cause a version bump based on Keep a Changelog and adheres to Semantic Versioning

});
expect(
screen.getByText(JSON.stringify(VARIANTS.nodes))
).toBeInTheDocument();
});

it('provides setSelectedVariant callback', async () => {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Currently this test case is not passing because e.target.value on line 179 is null. Spend some time debugging it, but couldn't find the reason. Any guesses? @frehner

@mrkldshv
Copy link
Contributor Author

In general this PR is ready except that one failing test that's mentioned below.

@frehner
Copy link
Contributor

frehner commented Sep 17, 2022

Oh sorry, I've already migrated this over here and renamed it in the process.

Do you want to compare what I have to what you have and see if I missed something in my migration?

For the most part, the migration to Vitest is done - we've moved nearly everything over to hydrogen-ui (except Cart stuff, which is a separate work stream) and will eventually deprecate most of the components in the hydrogen package. The ones that are left, which are specific to Hydrogen-the-framework (e.g. <Link/>) will need to be migrated at that point.

@mrkldshv
Copy link
Contributor Author

No worries! I've checked the existing test, and I think I can submit PR with a few minor changes (e.g. refactor queryAll().length.toBe() to queryAll().toHaveLength()) if that's okay.

@frehner
Copy link
Contributor

frehner commented Sep 19, 2022

No worries! I've checked the existing test, and I think I can submit PR with a few minor changes (e.g. refactor queryAll().length.toBe() to queryAll().toHaveLength()) if that's okay.

That sounds great to me. 👍

And for this PR, you thinking to close it...?

@mrkldshv
Copy link
Contributor Author

Yeah, I guess this PR is not needed since we already have this test migrated. I'll close this PR, and open another one with small refactor changes.

@mrkldshv mrkldshv closed this Sep 19, 2022
@mrkldshv mrkldshv deleted the chore/product-options-provider branch September 19, 2022 16:17
@mrkldshv mrkldshv mentioned this pull request Sep 19, 2022
4 tasks
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