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

tests(ui): add unit testing boilerplate and first tests #12047

Merged
merged 58 commits into from
Jan 31, 2022
Merged
Changes from 1 commit
Commits
Show all changes
58 commits
Select commit Hold shift + click to select a range
3826777
feat(unit): first attempt at setting up cct unit testing
Evertvdw Oct 21, 2021
ba2970b
Add image snapshot plugin
Evertvdw Oct 24, 2021
ba337c4
Move test/cypress folder to root of `ui`
Evertvdw Oct 24, 2021
19c0534
Update test syntax and eslint fix
Evertvdw Oct 24, 2021
7fd483b
chore(testing): Add tests for QAvatar
Evertvdw Oct 31, 2021
0eb31ea
fix(linting): make eslint validate and autofix js in .vue files
Evertvdw Oct 31, 2021
829d646
feat(testing): autocomplete custom commands in spec files
Evertvdw Oct 31, 2021
4620420
chore(testing): add first test of QMenu
Evertvdw Oct 31, 2021
511eae4
(chore): remove this eslint file as it is not used
Evertvdw Nov 6, 2021
a226097
(chore): add expect to globals so eslint does not complain
Evertvdw Nov 6, 2021
172fb7e
(testing): add tests for behavior of QMenu
Evertvdw Nov 6, 2021
320ea30
(chore): Add readme
Evertvdw Nov 6, 2021
2b7e7ad
(chore): undo changes to babel.config.js
Evertvdw Nov 6, 2021
d385090
(chore): extends cypress eslint plugin
Evertvdw Nov 6, 2021
4694ecc
(chore): refactor to move tests into __tests__ folder
Evertvdw Nov 6, 2021
3f72cbf
(testing): add more tests for Menu positioning
Evertvdw Nov 7, 2021
07af846
(chore): add list of components prioritized
Evertvdw Nov 8, 2021
15c65b9
Update README.md
Evertvdw Nov 8, 2021
994000f
(testing): add tests for transition and style of QMenu
Evertvdw Nov 10, 2021
bc1de40
(testing): Add Event tests
mett-development Nov 12, 2021
1690082
(testing): Update command types
Evertvdw Nov 15, 2021
72cb89d
(testing): Add method testss for QMenu
Evertvdw Nov 15, 2021
89e13ff
(testing): QMenu tests finished
Evertvdw Nov 18, 2021
6bc91c4
(chore): update readme
Evertvdw Nov 18, 2021
8f15636
(testing): First tests for QSelect
Evertvdw Nov 18, 2021
66a7ea4
fix(testing): add commands file to include AE commands typings
Evertvdw Nov 29, 2021
f33d9af
chore(testing): use AE for unit tests, clean up obsolete code
Evertvdw Nov 29, 2021
12b9201
chore(testing): Images were oddly sized, regenerate them
Evertvdw Nov 29, 2021
63d949e
chore(testing): use Cypress.vueWrapper instead of .vue() command
Evertvdw Nov 29, 2021
c39ce9b
testing(feat): test first content properties of select API
Evertvdw Dec 8, 2021
8b64971
testing(fix): fix autocompletion within spec files
Evertvdw Dec 8, 2021
d135ced
feat(testing): create a helper function to setup test boilerplate
Evertvdw Dec 15, 2021
6778ea7
chore: create separate tests for composables
Evertvdw Dec 15, 2021
b4826ab
fix: remove console.log used for testing
Evertvdw Dec 22, 2021
db3f321
feat: add additional tests for QSelect
Evertvdw Dec 22, 2021
ca3d3cf
feat(testing): Add isNotActionable command
Evertvdw Dec 22, 2021
59d6835
feat(testing): finish tests for props section `Options` of API
Evertvdw Dec 22, 2021
e5afe35
feat(testing): add boilerplate for slots
Evertvdw Dec 22, 2021
ad09c81
chore(testing): update AE to use cypress 9.2, update image snapshots
Evertvdw Dec 23, 2021
c6e93f4
chore(testing): refactor QMenu, split composable props
Evertvdw Dec 27, 2021
284f21a
feat(testing): WIP QSelect selection props, add slots to wrapper
Evertvdw Dec 27, 2021
f01d50b
chore(testing): Remove unused imports
Evertvdw Dec 27, 2021
391aa1d
chore(testing): do not check for null #11754
Evertvdw Dec 27, 2021
b4da5e2
feat(testing): add eslint plugin to show .only as error
Evertvdw Dec 27, 2021
f1abd81
feat(testing): finish Selection and Style sections of QSelect
Evertvdw Dec 27, 2021
577f75b
feat(testing): slot tests for QSelect
Evertvdw Jan 2, 2022
9582720
feat(testing): add tests for the events of QSelect
Evertvdw Jan 2, 2022
68a4792
chore(testing): refactor QAvatar tests
Evertvdw Jan 10, 2022
ac5b0c2
chore(testing): refactor QBadge to use API scaffolded tests
Evertvdw Jan 10, 2022
c53d701
feat(testing): add tests for Methods QSelect
Evertvdw Jan 14, 2022
57de1b7
feat(testing): cover edge cases for create-spec
Evertvdw Jan 14, 2022
2a2a9fd
chore(testing): create boilerplate for all components on shortlist
Evertvdw Jan 14, 2022
e0702ed
review: import plugin using ES syntax
Evertvdw Jan 17, 2022
c8ce424
review: add documentation for create-spec helper
Evertvdw Jan 17, 2022
c262865
chore(ui/test): adapt to latest release
IlCallo Jan 26, 2022
a678b01
chore: use eslint VSCode extension as formatter
IlCallo Jan 26, 2022
3ac10a1
fix: revert VSCode settings to prevent format fighting
Evertvdw Jan 27, 2022
47d51eb
chore(testing): remove image-snapshots, not working with `run-ct`.
Evertvdw Jan 29, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
(chore): Add readme
  • Loading branch information
Evertvdw authored and IlCallo committed Jan 26, 2022
commit 320ea307496d8363f2cc64a65c39d827a902e0fe
14 changes: 14 additions & 0 deletions ui/test/cypress/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# Unit testing Quasar components

This folder contains a testing harness for [Cypress component testing](https://docs.cypress.io/guides/component-testing/introduction).

## Additions/quirks needed for this to work
Here is a list of things I needed to do to make this work:

- Get a webpack config from quasar project. This is necessary for cypress to fire up it's server to serve up components. I used the `ui/dev` project for this.
- Because cypress looks for a `cypress.json` in that project folder I had to add that file in `ui/dev/cypress.json`
- The `.spec.js` files are part of the `scr/ui` and are handled by the `.eslintrc.js` file there. I had to add the `mocha` env to use `describe` etc. Also `expect` is added in globals to make use of that command inside .spec.js files.
- In general I added `.vscode/settings.json` to make it so that ESLint will autofix stuff on save so I don't go nuts.
- Had to add to `ui/tsconfig.json` include array to include the `commands.d.ts` which is necessary for autocomplete of custom commands when writing tests
- I added a visual snapshot testing package and configured that to include the snapshots made inside the folder of the component that is tested. However the screenshots are always place inside a `All Specs` folder in there. There is no option to change the name of that folder :(
- In `ui/test/cypress/support/unit.js` I have to import global quasar css, as well as the icons css. This file is run before every test suite as a global configuration of your tests.