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

Upgrade testing suite to support DOM testing #1322

Merged
merged 4 commits into from
Jan 24, 2022
Merged

Conversation

arb000r
Copy link
Collaborator

@arb000r arb000r commented Jan 20, 2022

Description

Currently we don't have proper utils for testing DOM behaviour. A part of proper testing practice of the UI is to test what the users 'actually see' rather than the implementation details of what goes on behind the scenes.

So we test behaviour rather than implementation. @testing-library/vue adds a bunch of helpful buddies which make testing our component outputs a squeezy breeze.

Unfortunately, for vue3 support we had to rely on the @next branch for above library which meant that we needed to upgrade a bunch of our existing test packages.

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Dependency changes
  • Code refactor / cleanup
  • Documentation or wording changes
  • Other

How should this be tested?

Should be able to run unit tests as was before

Visual context

CLI usage. No visual context applicable.

Checklist:

  • I have performed a self-review of my own code
  • I have requested at least 2 reviews (If the PR is significant enough, use best judgement here)
  • I have commented my code where relevant, particularly in hard-to-understand areas
  • If package-lock.json has changes, it was intentional.
  • The base of this PR is master if hotfix, develop if not

@vercel
Copy link

vercel bot commented Jan 20, 2022

This pull request is being automatically deployed with Vercel (learn more).
To see the status of your deployments, click below or on the icon next to each commit.

kovan – ./

🔍 Inspect: https://vercel.com/balancer/kovan/ErCpgbKxM3SCPtgtqkrKc1Wbmego
✅ Preview: Canceled

[Deployment for 1f72580 canceled]

app – ./

🔍 Inspect: https://vercel.com/balancer/app/CwiDHJvm3ppRRp3gFED9QBxWfjQS
✅ Preview: Canceled

[Deployment in progress for 1f72580]

beta-app – ./

🔍 Inspect: https://vercel.com/balancer/beta-app/bBhUz1gQH4LKVxZp86pAWrXwdgLe
✅ Preview: https://beta-app-git-add-dom-testing-utils-balancer.vercel.app

beta-kovan – ./

🔍 Inspect: https://vercel.com/balancer/beta-kovan/5SSc5NUzyN2iKCm44n217yVLZCaK
✅ Preview: https://beta-kovan-git-add-dom-testing-utils-balancer.vercel.app

polygon – ./

🔍 Inspect: https://vercel.com/balancer/polygon/GdjSg8EYjkvcfFP3F69hft85JKKd
✅ Preview: Canceled

[Deployment for 1f72580 canceled]

beta-polygon – ./

🔍 Inspect: https://vercel.com/balancer/beta-polygon/6FvdtYqi3XoJW9oxhnex5hNftk3d
✅ Preview: https://beta-polygon-git-add-dom-testing-utils-balancer.vercel.app

beta-arbitrum – ./

🔍 Inspect: https://vercel.com/balancer/beta-arbitrum/49DBLQ2WCwNC92t96aXAWTU88Fy5
✅ Preview: https://beta-arbitrum-git-add-dom-testing-utils-balancer.vercel.app

arbitrum – ./

🔍 Inspect: https://vercel.com/balancer/arbitrum/8kc6942ez9XhbDGwFJa2SeXwt5tH
✅ Preview: Canceled

[Deployment for 1f72580 canceled]

Comment on lines +4 to +6
'ts-jest': {
isolatedModules: true
}
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

ts jest is slow. this speeds it up

@@ -8,7 +8,7 @@
"scripts": {
"serve": "vue-cli-service serve",
"build": "vue-cli-service build",
"test:unit": "vue-cli-service test:unit --passWithNoTests",
"test:unit": "vue-cli-service test:unit --cache --passWithNoTests --runInBand",
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

--runInBand and --cache to speed up ts-jest too

Copy link
Collaborator

@garethfuller garethfuller left a comment

Choose a reason for hiding this comment

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

Looks fine to me. A little concerned about the lock diff. I'll defer to @timjrobinson's review since he has worked the most with our existing test suite.

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.

4 participants