diff options
author | François Freitag <mail@franek.fr> | 2021-05-16 17:56:50 +0200 |
---|---|---|
committer | François Freitag <mail@franek.fr> | 2021-06-05 11:22:25 +0200 |
commit | 70edda034201b9d7c3d38bb714dfb35324b2841c (patch) | |
tree | 7dbdc91f8b99d82c1e805d657c8fcbafce7a0ece /package.json | |
parent | 46dbc8fa988176e4a431cafcbae6674fb613c899 (diff) | |
download | nextcloud-server-70edda034201b9d7c3d38bb714dfb35324b2841c.tar.gz nextcloud-server-70edda034201b9d7c3d38bb714dfb35324b2841c.zip |
Port dav calendar settings page to Vue.js
- Drop reliance on deprecated global jQuery object.
- Allow testing user interactions.
- Use newer technology stack.
---
Test user interactions with the groupware dav settings
Add infrastructure to test Vue components:
- Use recommended libraries:
- https://vuejs.org/v2/guide/testing.html#Recommendations
- Use jest-dom for robust assertions on the DOM state
- Use user-event to be more representative of user actions
- Code is transpiled by Jest, with the help of vue-jest.
Ignore test files for no-unpublished-import. Prevent ESLint from
flagging:
```
/home/runner/work/server/server/apps/dav/src/views/CalDavSettings.spec.js
Error: 1:24 error "@testing-library/vue" is not published node/no-unpublished-import
Error: 2:23 error "@testing-library/user-event" is not published node/no-unpublished-import
```
Signed-off-by: François Freitag <mail@franek.fr>
Diffstat (limited to 'package.json')
-rw-r--r-- | package.json | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/package.json b/package.json index da90c030626..ff02f835319 100644 --- a/package.json +++ b/package.json @@ -98,6 +98,9 @@ "@nextcloud/browserslist-config": "^2.1.0", "@nextcloud/eslint-config": "^2.2.0", "@nextcloud/eslint-plugin": "^1.5.0", + "@testing-library/jest-dom": "^5.12.0", + "@testing-library/user-event": "^13.1.9", + "@testing-library/vue": "^5.6.2", "babel-eslint": "^10.1.0", "babel-jest": "^26.6.3", "babel-loader": "^8.2.2", @@ -120,6 +123,7 @@ "sass-loader": "^10.1.1", "style-loader": "^2.0.0", "url-loader": "^4.1.1", + "vue-jest": "^4.0.1", "vue-loader": "^15.9.7", "vue-template-compiler": "^2.6.12", "webpack": "^4.46.0", @@ -134,8 +138,16 @@ "node": ">=10.0.0" }, "jest": { + "moduleFileExtensions": [ + "js", + "vue" + ], + "setupFilesAfterEnv": [ + "<rootDir>/tests/jestSetup.js" + ], "transform": { - "^.+\\.js$": "<rootDir>/tests/jestBabelTransformer.js" + "^.+\\.js$": "<rootDir>/tests/jestBabelTransformer.js", + "^.+\\.vue$": "vue-jest" } } } |