Skip to content

Commit

Permalink
Use a real intlify instance in tests
Browse files Browse the repository at this point in the history
The recent more complex tests would otherwise result in passing a
translation key to dayjs as a date format string. This would result in
very hard to understand snapshots. So the easier solution is to just use
a real intlify instance initialized with only the common translations.
  • Loading branch information
carlobeltrame committed Mar 25, 2024
1 parent 1430b5e commit aa9bc6e
Show file tree
Hide file tree
Showing 10 changed files with 296 additions and 213 deletions.
61 changes: 61 additions & 0 deletions pdf/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion pdf/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,17 +32,18 @@
},
"devDependencies": {
"@babel/eslint-parser": "7.24.1",
"@intlify/core": "^9.10.2",
"@rushstack/eslint-patch": "1.8.0",
"@vitejs/plugin-vue": "5.0.4",
"@vitest/coverage-v8": "1.4.0",
"@vue/babel-preset-app": "5.0.8",
"@vue/compiler-dom": "3.4.21",
"@vue/compiler-sfc": "3.4.21",
"@vue/eslint-config-prettier": "9.0.0",
"@vue/test-utils": "2.4.4",
"@vue/runtime-dom": "3.4.21",
"@vue/server-renderer": "3.4.21",
"@vue/shared": "3.4.21",
"@vue/test-utils": "2.4.4",
"css": "3.0.0",
"dayjs": "1.11.10",
"eslint": "8.57.0",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@
],
"parent": [Circular],
"props": {
"bookmark": "print.cover.title",
"bookmark": "Cover page",
"class": "page",
"id": "entry-0",
"size": "A4",
Expand Down
16 changes: 8 additions & 8 deletions pdf/src/renderer/__tests__/__snapshots__/picasso.spec.json.snap
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,14 @@
{
"parent": [Circular],
"type": "TEXT_INSTANCE",
"value": "print.picasso.title",
"value": "Program overview Hauptlager",
},
],
"parent": [Circular],
"props": {
"bookmark": {
"fit": true,
"title": "print.picasso.title",
"title": "Program overview Hauptlager",
},
"class": "picasso-title",
"id": "entry-0-16b2fcffdd8e",
Expand Down Expand Up @@ -139,7 +139,7 @@
{
"parent": [Circular],
"type": "TEXT_INSTANCE",
"value": "05/12/2024",
"value": "Fr 05/10/2024",
},
],
"parent": [Circular],
Expand Down Expand Up @@ -179,7 +179,7 @@
{
"parent": [Circular],
"type": "TEXT_INSTANCE",
"value": "05/12/2024",
"value": "Sa 05/11/2024",
},
],
"parent": [Circular],
Expand Down Expand Up @@ -218,7 +218,7 @@
{
"parent": [Circular],
"type": "TEXT_INSTANCE",
"value": "05/12/2024",
"value": "Su 05/12/2024",
},
],
"parent": [Circular],
Expand Down Expand Up @@ -257,7 +257,7 @@
{
"parent": [Circular],
"type": "TEXT_INSTANCE",
"value": "05/13/2024",
"value": "Mo 05/13/2024",
},
],
"parent": [Circular],
Expand Down Expand Up @@ -8861,7 +8861,7 @@
{
"parent": [Circular],
"type": "TEXT_INSTANCE",
"value": "g5/10/2024obam5/10/2024.5amteti0e.5amte05/10/2024ong - g5/13/2024obam5/13/2024.1amteti0e.1amte05/13/2024ong",
"value": "Fr 05/10/2024 - Mo 05/13/2024",
},
],
"parent": [Circular],
Expand Down Expand Up @@ -8898,7 +8898,7 @@
{
"parent": [Circular],
"type": "TEXT_INSTANCE",
"value": "print.picasso.picassoFooter.leaders",
"value": "Lead: Robert Baden-Powell & Hans Muster",
},
],
"parent": [Circular],
Expand Down

0 comments on commit aa9bc6e

Please sign in to comment.