@unimelb/pattern-lib-vue 16.0.0-alpha.24 → 16.0.0-alpha.26

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. package/.out/vue.js +1 -1
  2. package/README.md +14 -6
  3. package/package.json +18 -21
package/README.md CHANGED
@@ -182,6 +182,20 @@ Pre-release builds can be created like this (using the git pre-push hook behind
182
182
 
183
183
  ## Testing
184
184
 
185
+ ### Component unit testing
186
+ To run the component units tests use `yarn test`. This runs the jest unit and accessibility tests.
187
+
188
+ ### Storybook end-to-end testing
189
+ To run the Storybook stories visual snapshots and story tests use `yarn test:e2e`.
190
+
191
+ ### Storybook visual snapshot testing
192
+
193
+ You can run the Storybook stories visual snapshot tests using `yarn test:snapshots`. This compares your changes against the baseline visual snapshot. To see the failed snapshot tests run `yarn test:report`.
194
+
195
+ If you wish to update the snapshots with your changes run `yarn test:update:snapshots`.
196
+
197
+ **Note:** the visual snapshot testing runs on Playwright and requires Docker to be up and running.
198
+
185
199
  ### Testing Pull-requests
186
200
 
187
201
  You can test `pull-requests` on live sites by using `?preview=test-xxx` where `xxx` is the pull-request `number`.
@@ -212,12 +226,6 @@ Recommended mobile devices for testing:
212
226
  - iPad 2
213
227
  - Galaxy s5
214
228
 
215
- ### Visual snapshot testing
216
-
217
- You can run visual snapshot testing using `yarn test:snapshots`. This compares your changes against the latest visual snapshot. Failed snapshot tests will show a visual diff comparison in `snapshots/__tests__/__image_snapshots__/__diff_output__`.
218
-
219
- If you wish to update the snapshots with your changes run `yarn test:e2e:updatesnapshots`.
220
-
221
229
  ### Visual Regression Tests
222
230
 
223
231
  > [!IMPORTANT]
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@unimelb/pattern-lib-vue",
3
3
  "description": "A complete design system for the University of Melbourne.",
4
- "version": "16.0.0-alpha.24",
4
+ "version": "16.0.0-alpha.26",
5
5
  "repository": {
6
6
  "type": "git",
7
7
  "url": "https://github.com/unimelb/pattern-lib.git"
@@ -24,26 +24,31 @@
24
24
  "build:lib:standard": "cross-env NODE_ENV=production webpack --config targets/lib/webpack.config.js",
25
25
  "build:lib:minify": "cross-env NODE_ENV=production MINIFY_CSS=true webpack --config targets/lib/webpack.minify.config.js",
26
26
  "build:vue": "cross-env NODE_ENV=production webpack --config targets/vue/webpack.config.js",
27
- "clean:snapshots": "rimraf snapshots/__tests__/__image_snapshots__/__diff_output__",
27
+ "prebuild:test": "rimraf _site-docker",
28
+ "build:test": "cross-env MOCK=true npm-run-all \"build -o _site-docker\"",
28
29
  "dev": "storybook dev -p 7002",
29
30
  "dev:public": "storybook dev -p 7002 -h 0.0.0.0",
30
31
  "start:lib": "webpack-dev-server --port 7003 --config targets/lib/webpack.config.js",
31
- "docker": "docker compose run --rm e2e",
32
32
  "docker:build": "cross-env MODE=build docker compose run --rm storybook",
33
33
  "lint": "run-s lint:js lint:css",
34
34
  "lint:css": "stylelint **/*.{css,vue} --fix",
35
35
  "lint:js": "eslint . --ext .js,.vue --fix",
36
- "start:snapshots": "server-test serve:test :5000 'jest -w=4 -c snapshots/jest.config.js'",
37
- "start:updatesnapshots": "server-test serve:test :5000 'jest -w=4 -c snapshots/jest.config.js -u'",
38
36
  "test": "jest",
37
+ "test:e2e": "cross-env EXCLUDE=regression run-s docker",
39
38
  "test:regression": "cross-env TYPE=regression run-s docker",
40
- "test:snapshots": "run-s build clean:snapshots start:snapshots",
41
- "test:updatesnapshots": "run-s build start:updatesnapshots",
42
- "test:update:regression": "cross-env TYPE=regression UPDATE_SNAPSHOTS=true run-s docker",
39
+ "test:snapshots": "cross-env TYPE=snapshot run-s docker",
40
+ "test:update:regression": "cross-env TYPE=regression UPDATE_SNAPSHOTS=all run-s docker",
41
+ "test:update:snapshots": "cross-env TYPE=snapshot UPDATE_SNAPSHOTS=all run-s docker",
42
+ "test:update:regression:changed": "cross-env TYPE=regression UPDATE_SNAPSHOTS=changed run-s docker",
43
+ "test:update:snapshots:changed": "cross-env TYPE=snapshot UPDATE_SNAPSHOTS=changed run-s docker",
43
44
  "test:report": "playwright show-report",
44
45
  "generate": "plop --plopfile generator/index.js",
45
46
  "prepublish": "cross-env LOAD_EXTERNAL_ASSETS=true npm run build:vue",
46
- "serve:test": "serve .out/docs"
47
+ "preplaywright": "npm-run-all build:test",
48
+ "playwright": "npx playwright test --grep-invert \"@snapshot|@regression\" --project chromium",
49
+ "playwright:ui": "npx playwright test --grep-invert \"@snapshot|@regression\" --project chromium --ui",
50
+ "predocker": "npm-run-all build:test",
51
+ "docker": "docker compose run --rm e2e"
47
52
  },
48
53
  "dependencies": {
49
54
  "@fontsource-variable/fraunces": "^5.0.21",
@@ -61,22 +66,23 @@
61
66
  "modern-normalize": "^1.1.0",
62
67
  "prop-types": "^15.8.1",
63
68
  "semver": "^5.6.0",
69
+ "serve-handler": "^6.1.6",
64
70
  "smoothscroll-polyfill": "^0.4.4",
65
71
  "throttle-debounce": "^2.1.0",
66
72
  "uuid": "^3.4.0",
67
73
  "v-scroll-lock": "^1.3.1",
68
74
  "vue": "^3.5.4",
69
75
  "vue-focus-lock": "1.4.0",
70
- "vue-progressive-image": "^4.0.0",
71
76
  "xss": "^1.0.15"
72
77
  },
73
78
  "devDependencies": {
79
+ "@axe-core/playwright": "^4.10.2",
74
80
  "@babel/core": "^7.24.8",
75
81
  "@babel/eslint-parser": "^7.24.7",
76
82
  "@babel/polyfill": "^7.12.1",
77
83
  "@babel/preset-env": "^7.24.8",
78
84
  "@babel/preset-react": "^7.24.7",
79
- "@playwright/test": "1.44.1",
85
+ "@playwright/test": "^1.53.0",
80
86
  "@storybook/addon-essentials": "^8.1.11",
81
87
  "@storybook/addon-interactions": "^8.1.11",
82
88
  "@storybook/addon-links": "^8.1.11",
@@ -94,7 +100,6 @@
94
100
  "@storybook/test": "^8.1.11",
95
101
  "@storybook/vue3": "^8.1.11",
96
102
  "@storybook/vue3-webpack5": "^8.1.11",
97
- "@types/jest": "^25.2.3",
98
103
  "@vue/babel-helper-vue-jsx-merge-props": "^1.4.0",
99
104
  "@vue/babel-plugin-transform-vue-jsx": "^1.4.0",
100
105
  "@vue/compiler-sfc": "^3.4.31",
@@ -128,14 +133,12 @@
128
133
  "file-loader": "^6.2.0",
129
134
  "highlight.js": "^11.10.0",
130
135
  "html-webpack-plugin": "^5.6.0",
136
+ "http-server": "^14.1.1",
131
137
  "husky": "^4.2.3",
132
138
  "inquirer-directory": "^2.2.0",
133
139
  "jest": "29.x",
134
140
  "jest-axe": "^3.1.1",
135
141
  "jest-environment-jsdom": "^29.7.0",
136
- "jest-image-snapshot": "^2.12.0",
137
- "jest-puppeteer": "^4.4.0",
138
- "jest-serializer-vue": "^2.0.2",
139
142
  "jest-transform-stub": "^2.0.0",
140
143
  "lint-staged": "^10.0.8",
141
144
  "marked": "^14.1.2",
@@ -156,7 +159,6 @@
156
159
  "postcss-reporter": "^7.1.0",
157
160
  "postcss-url": "^10.1.3",
158
161
  "prettier": "^3.3.2",
159
- "puppeteer": "^2.1.1",
160
162
  "raw-loader": "^0.5.1",
161
163
  "react": "18",
162
164
  "react-dom": "18",
@@ -181,7 +183,6 @@
181
183
  "vue-axe": "^1.0.7",
182
184
  "vue-html-loader": "^1.2.4",
183
185
  "vue-loader": "^17.4.2",
184
- "vue3-jest": "^27.0.0-alpha.1",
185
186
  "webpack": "^5.92.1",
186
187
  "webpack-bundle-analyzer": "^4.10.2",
187
188
  "webpack-cli": "^5.1.4",
@@ -208,9 +209,6 @@
208
209
  "^utils/(.*)$": "<rootDir>/utils/$1",
209
210
  "^static/(.*)$": "<rootDir>/static/$1"
210
211
  },
211
- "snapshotSerializers": [
212
- "<rootDir>/node_modules/jest-serializer-vue"
213
- ],
214
212
  "transform": {
215
213
  ".*\\.(vue)$": "@vue/vue3-jest",
216
214
  "^.+\\.js$": "<rootDir>/node_modules/babel-jest",
@@ -218,7 +216,6 @@
218
216
  },
219
217
  "transformIgnorePatterns": [],
220
218
  "testPathIgnorePatterns": [
221
- "<rootDir>/snapshots/",
222
219
  "<rootDir>/e2e/"
223
220
  ],
224
221
  "testEnvironmentOptions": {