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

Plans Next [Storybook]: Relocate stories from plans-grid-next package into Calypso #90826

Open
Tracked by #90824
oswian opened this issue May 17, 2024 · 2 comments
Open
Tracked by #90824

Comments

@oswian
Copy link
Contributor

oswian commented May 17, 2024

Our stories currently reside within the plans-grid-next package. These stories reference experiments and user flows which are Calypso focused. This doesn't align with the goal of the package, which is to become independent of Calypso so that it can be used in other environments eg. logged-out pages.

Considerations:

  • How can we maintain the same speed of development that our package-specific Storybook provides
    • ie. compile times, hot reloading etc
  • We have support for API mocking in our package-specific Storybook setup
    • How can we maintain this while not effecting other stories
@chriskmnds
Copy link
Contributor

chriskmnds commented May 17, 2024

We have support for API mocking in our package-specific Storybook setup

@oswian have we considered moving the fixtures out of plans-grid-next and closer to the data-store hooks? (So plans & site-plans fixtures to move under @a8c/data-stores:/src/plans).

Also, let's not just relocate there - but consider the existing mocks used for the tests there already (and reuse or perhaps extend those instead) e.g. in @a8c/data-stores:/src/plans/mock/next/store.

^ p.s. These are store/hook mocks apparently, not endpoint ones - would it be possible to mock these data-store hooks instead for Storybook, and not the raw API endpoints? Or is the other way (mocking the endpoints) better?

@chriskmnds
Copy link
Contributor

chriskmnds commented May 17, 2024

a wild idea would be to create a pricing-stories (or something) package and contain all the stories we work with there - including full pricing pages like seen on /start/plans. technically, there'd be no concern with whatever environment variables we want to introduce there.

if that even makes sense, then we'd keep stories in both plans-grid-next and pricing-stores - the former containing all the granular and raw/default parts (so "term selector", "features grid", "comparison grid", and lots more granular items - these could be closer to logged-out page variants), and the latter whatever we want. then could we export/import stories from plans-grid-next into pricing-stories - so process/dev-wise we'd still be testing through a single instance (pricing-stories) 🤔

I guess that's pretty wild

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

No branches or pull requests

2 participants