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

POC: integration tests #2422

Merged
merged 19 commits into from
Dec 6, 2022
Merged

POC: integration tests #2422

merged 19 commits into from
Dec 6, 2022

Conversation

kwasniew
Copy link
Contributor

@kwasniew kwasniew commented Nov 14, 2022

About the changes

POC for frontent UI unit tests that test at similar level to Cypress but can be written in unit test framework and run in jsdom.
This example verifies if we can show ChangeRequest banner and if we get Change Request dialog on toggle switch.

Basic idea:

  • setup msw returning required data (better option would be to Dependency Inject but it requires bigger refactoring)
  • prepare context for rendering (providers for routing, theme, access etc.)
  • invoke UI actions as you'd in cypress - we can build page object abstraction etc. but that's not the point of this PR

Important files

Discussion points

This PR also fixed SWR for enterprise and bring useEnterpriseSWR hook that is drop in replacement for SWR observing changes on isOSS

@kwasniew kwasniew marked this pull request as draft November 14, 2022 14:56
@vercel
Copy link

vercel bot commented Nov 14, 2022

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

Name Status Preview Comments Updated
unleash-monorepo-frontend ✅ Ready (Inspect) Visit Preview 💬 Add your feedback Dec 6, 2022 at 2:17PM (UTC)
1 Ignored Deployment
Name Status Preview Comments Updated
unleash-docs ⬜️ Ignored (Inspect) Dec 6, 2022 at 2:17PM (UTC)

@kwasniew kwasniew marked this pull request as ready for review December 2, 2022 15:11
@kwasniew kwasniew changed the title DRAFT: integration tests POC: integration tests Dec 2, 2022
Copy link
Member

@nunogois nunogois left a comment

Choose a reason for hiding this comment

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

LGTM 👍

@kwasniew kwasniew merged commit c4f3ada into main Dec 6, 2022
@kwasniew kwasniew deleted the integration-testing branch December 6, 2022 14:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

None yet

2 participants