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

[Test] Setup integration tests #1323

Merged
merged 28 commits into from
Jul 3, 2024
Merged

Conversation

tiagofilipenunes
Copy link
Collaborator

@tiagofilipenunes tiagofilipenunes commented Jul 1, 2024

Simple POC to setup the integration library before starting to write integration tests.

Changes made:

  • Add jest-dom eslint plugin
  • Update testing-library packages
  • Update vitest and vite
  • Added examples of vitest.mock and vitest.hoisted - as mock calls are hoisted, you can use vitest.hoisted to run code before the mocks
  • vite-plugin-rewrite-all plugin was removed as part of updating vite as it is no longer used and has been deprecated
  • Added two customRenders - both with some providers added and one with the router added as well
  • Added wagmi wallet mock

Notes:

  • Currently tests are running with mode flag production because otherwise there's an error when loading the config. Alternatively, the config file can be mocked and this flag removed
  • Similar as above for the compiled abis - we currently compiled them before the tests and alternatively they can be mocked

- Update testing-library dom, jest-dom, react and user-event packages
- Add eslint jsdom plugin
- Update vitest
- afterEach instead of beforeEach for clean-up
- No need to mock the Tooltip as the issue was with .svg files not being parsed correctly
- Replace toBeTruthy and toBeNull with toBeInTheDocument as per jsdom lint rules
Copy link

cloudflare-workers-and-pages bot commented Jul 1, 2024

Deploying carbon-app-sei with  Cloudflare Pages  Cloudflare Pages

Latest commit: c2bb5fa
Status: ✅  Deploy successful!
Preview URL: https://cd242680.carbon-app-sei.pages.dev
Branch Preview URL: https://setup-integration-tests.carbon-app-sei.pages.dev

View logs

Copy link

cloudflare-workers-and-pages bot commented Jul 1, 2024

Deploying carbon-app with  Cloudflare Pages  Cloudflare Pages

Latest commit: c2bb5fa
Status: ✅  Deploy successful!
Preview URL: https://e56c4179.carbon-app-csq.pages.dev
Branch Preview URL: https://setup-integration-tests.carbon-app-csq.pages.dev

View logs

@tiagofilipenunes tiagofilipenunes marked this pull request as ready for review July 3, 2024 09:30
src/components/common/WarningMessageWithIcon.test.tsx Outdated Show resolved Hide resolved
src/libs/testing-library/index.tsx Show resolved Hide resolved
src/libs/testing-library/setup.ts Outdated Show resolved Hide resolved
src/libs/testing-library/utils.ts Show resolved Hide resolved
vite.config.ts Show resolved Hide resolved
Copy link
Collaborator

@GrandSchtroumpf GrandSchtroumpf left a comment

Choose a reason for hiding this comment

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

Great work !

@tiagofilipenunes tiagofilipenunes merged commit 2dfb637 into main Jul 3, 2024
2 checks passed
@tiagofilipenunes tiagofilipenunes deleted the setup-integration-tests branch July 3, 2024 14:23
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.

3 participants