@unimelb/pattern-lib-vue 15.2.0 → 15.2.1

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 +34 -0
  3. package/package.json +8 -4
package/README.md CHANGED
@@ -218,6 +218,40 @@ You can run visual snapshot testing using `yarn test:snapshots`. This compares y
218
218
 
219
219
  If you wish to update the snapshots with your changes run `yarn test:e2e:updatesnapshots`.
220
220
 
221
+ ### Visual Regression Tests
222
+
223
+ > [!IMPORTANT]
224
+ > These tests should be run `exclusively` on your `local` machine to detect visual regressions before merging your `pull-request`.
225
+
226
+ You can test your changes against live `production` sites to ensure nothing breaks.
227
+
228
+ - uses `TEST_PREVIEW_ID` located in `.env` - refer to `env.example`
229
+ - the list of production sites are located in `/e2e/tests/regression/pages.json`
230
+
231
+ #### Running regression tests
232
+
233
+ 1. update your regression snapshots
234
+
235
+ > [!TIP]
236
+ > Make sure to comment out `TEST_PREVIEW_ID` to use the `dev` branch as the `base` snapshots. Alternatively, you can use any `pull-request` id.
237
+
238
+ ```
239
+ yarn test:update:regression
240
+ ```
241
+
242
+ 2. set the `TEST_PREVIEW_ID` to your desired `pull-request` id
243
+ 3. run the regression tests to compare your `pull-request` againts the base snapshots
244
+
245
+ ```bash
246
+ yarn test:regression
247
+ ```
248
+
249
+ 4. view the report
250
+
251
+ ```bash
252
+ yarn test:report
253
+ ```
254
+
221
255
  ## Developer documentation
222
256
 
223
257
  - [Documenting stories](docs/docs.md) - how to customise the content of the README panel for each story
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": "15.2.0",
4
+ "version": "15.2.1",
5
5
  "repository": {
6
6
  "type": "git",
7
7
  "url": "https://github.com/unimelb/pattern-lib.git"
@@ -28,16 +28,18 @@
28
28
  "dev": "start-storybook -p 7002 -c .storybook",
29
29
  "dev:public": "start-storybook -p 7002 -h 0.0.0.0 -c .storybook",
30
30
  "start:lib": "webpack-dev-server --port 7003 --config targets/lib/webpack.config.js",
31
- "docker": "docker compose --profile dev up --abort-on-container-exit --remove-orphans",
32
- "docker:build": "cross-env MODE=build docker compose run --rm storybook",
31
+ "docker": "docker compose run --rm e2e",
33
32
  "lint": "run-s lint:js lint:css",
34
33
  "lint:css": "stylelint **/*.{css,vue} --fix",
35
34
  "lint:js": "eslint . --ext .js,.vue --fix",
36
35
  "start:snapshots": "server-test serve:test :5000 'jest -w=4 -c snapshots/jest.config.js'",
37
36
  "start:updatesnapshots": "server-test serve:test :5000 'jest -w=4 -c snapshots/jest.config.js -u'",
38
37
  "test": "jest",
38
+ "test:regression": "cross-env TYPE=regression run-s docker",
39
39
  "test:snapshots": "run-s build clean:snapshots start:snapshots",
40
40
  "test:updatesnapshots": "run-s build start:updatesnapshots",
41
+ "test:update:regression": "cross-env TYPE=regression UPDATE_SNAPSHOTS=true run-s docker",
42
+ "test:report": "playwright show-report",
41
43
  "generate": "plop --plopfile generator/index.js",
42
44
  "prepublish": "cross-env LOAD_EXTERNAL_ASSETS=true npm run build:vue",
43
45
  "serve:test": "serve .out/docs"
@@ -69,6 +71,7 @@
69
71
  "@babel/core": "^7.24.7",
70
72
  "@babel/eslint-parser": "^7.24.7",
71
73
  "@babel/preset-react": "^7.24.7",
74
+ "@playwright/test": "1.44.1",
72
75
  "@storybook/addon-notes": "^3.4.8",
73
76
  "@storybook/addon-options": "^3.4.8",
74
77
  "@storybook/addons": "^3.4.8",
@@ -184,7 +187,8 @@
184
187
  },
185
188
  "transformIgnorePatterns": [],
186
189
  "testPathIgnorePatterns": [
187
- "<rootDir>/snapshots/"
190
+ "<rootDir>/snapshots/",
191
+ "<rootDir>/e2e/"
188
192
  ]
189
193
  },
190
194
  "husky": {