From a6123879a6aafba800ca64e2065c561cdbc7e38c Mon Sep 17 00:00:00 2001 From: Vjacheslav Trushkin Date: Thu, 17 Nov 2022 11:37:46 +0200 Subject: [PATCH] fix: copy in Vue 2 component --- components/vue2/package.json | 1 + components/vue2/src/iconify.ts | 2 +- components/vue2/src/offline.ts | 2 +- pnpm-lock.yaml | 122 +++++++++++++++++++++++++++++---- 4 files changed, 110 insertions(+), 17 deletions(-) diff --git a/components/vue2/package.json b/components/vue2/package.json index fd89da4..787e450 100644 --- a/components/vue2/package.json +++ b/components/vue2/package.json @@ -55,6 +55,7 @@ "@vue/vue2-jest": "^29.0.0", "babel-jest": "^29.0.2", "jest": "^29.0.2", + "jest-environment-jsdom": "^29.3.1", "rollup": "^2.79.0", "typescript": "^4.8.2", "vue": "^2.7.10" diff --git a/components/vue2/src/iconify.ts b/components/vue2/src/iconify.ts index c0dfd28..64a9c1b 100644 --- a/components/vue2/src/iconify.ts +++ b/components/vue2/src/iconify.ts @@ -334,7 +334,7 @@ export const Icon = Vue.extend({ // Render icon render(createElement: CreateElement): VNode { - const props = this.$attrs; + const props = Object.assign({}, this.$attrs); let context = this.$data; // Get icon data diff --git a/components/vue2/src/offline.ts b/components/vue2/src/offline.ts index b6712b9..9c40d41 100644 --- a/components/vue2/src/offline.ts +++ b/components/vue2/src/offline.ts @@ -71,7 +71,7 @@ export const Icon = Vue.extend({ // Render icon render(createElement: CreateElement): VNode { - const props = this.$attrs; + const props = Object.assign({}, this.$attrs); // Check icon const propsIcon = props.icon; diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 46d8811..1ee1c01 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -505,6 +505,7 @@ importers: '@vue/vue2-jest': ^29.0.0 babel-jest: ^29.0.2 jest: ^29.0.2 + jest-environment-jsdom: ^29.3.1 rollup: ^2.79.0 typescript: ^4.8.2 vue: ^2.7.10 @@ -521,6 +522,7 @@ importers: '@vue/vue2-jest': 29.0.0_o4upubcptionb3omousiciqllq babel-jest: 29.0.2_@babel+core@7.20.2 jest: 29.0.2 + jest-environment-jsdom: 29.3.1 rollup: 2.79.0 typescript: 4.8.2 vue: 2.7.10 @@ -5100,6 +5102,16 @@ packages: jest-mock: 29.0.2 dev: true + /@jest/environment/29.3.1: + resolution: {integrity: sha512-pMmvfOPmoa1c1QpfFW0nXYtNLpofqo4BrCIk6f2kW4JFeNlHV2t3vd+3iDLf31e2ot2Mec0uqZfmI+U0K2CFag==} + engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + dependencies: + '@jest/fake-timers': 29.3.1 + '@jest/types': 29.3.1 + '@types/node': 18.7.15 + jest-mock: 29.3.1 + dev: true + /@jest/expect-utils/29.0.2: resolution: {integrity: sha512-+wcQF9khXKvAEi8VwROnCWWmHfsJYCZAs5dmuMlJBKk57S6ZN2/FQMIlo01F29fJyT8kV/xblE7g3vkIdTLOjw==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} @@ -5129,6 +5141,18 @@ packages: jest-util: 29.0.2 dev: true + /@jest/fake-timers/29.3.1: + resolution: {integrity: sha512-iHTL/XpnDlFki9Tq0Q1GGuVeQ8BHZGIYsvCO5eN/O/oJaRzofG9Xndd9HuSDBI/0ZS79pg0iwn07OMTQ7ngF2A==} + engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + dependencies: + '@jest/types': 29.3.1 + '@sinonjs/fake-timers': 9.1.2 + '@types/node': 18.7.15 + jest-message-util: 29.3.1 + jest-mock: 29.3.1 + jest-util: 29.3.1 + dev: true + /@jest/globals/29.0.2: resolution: {integrity: sha512-4hcooSNJCVXuTu07/VJwCWW6HTnjLtQdqlcGisK6JST7z2ixa8emw4SkYsOk7j36WRc2ZUEydlUePnOIOTCNXg==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} @@ -5250,6 +5274,18 @@ packages: chalk: 4.1.2 dev: true + /@jest/types/29.3.1: + resolution: {integrity: sha512-d0S0jmmTpjnhCmNpApgX3jrUZgZ22ivKJRvL2lli5hpCRoNnp1f85r2/wpKfXuYu8E7Jjh1hGfhPyup1NM5AmA==} + engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + dependencies: + '@jest/schemas': 29.0.0 + '@types/istanbul-lib-coverage': 2.0.4 + '@types/istanbul-reports': 3.0.1 + '@types/node': 18.7.15 + '@types/yargs': 17.0.12 + chalk: 4.1.2 + dev: true + /@jridgewell/gen-mapping/0.1.1: resolution: {integrity: sha512-sQXCasFk+U8lWYEe66WxRDOE9PjVz4vSM51fTu3Hw+ClTpUSQb718772vH3pyS5pShp6lvQM7SxgIDXXXmOX7w==} engines: {node: '>=6.0.0'} @@ -16767,6 +16803,29 @@ packages: pretty-format: 29.0.2 dev: true + /jest-environment-jsdom/29.3.1: + resolution: {integrity: sha512-G46nKgiez2Gy4zvYNhayfMEAFlVHhWfncqvqS6yCd0i+a4NsSUD2WtrKSaYQrYiLQaupHXxCRi8xxVL2M9PbhA==} + engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + peerDependencies: + canvas: ^2.5.0 + peerDependenciesMeta: + canvas: + optional: true + dependencies: + '@jest/environment': 29.3.1 + '@jest/fake-timers': 29.3.1 + '@jest/types': 29.3.1 + '@types/jsdom': 20.0.0 + '@types/node': 18.7.15 + jest-mock: 29.3.1 + jest-util: 29.3.1 + jsdom: 20.0.0 + transitivePeerDependencies: + - bufferutil + - supports-color + - utf-8-validate + dev: true + /jest-environment-node/29.0.2: resolution: {integrity: sha512-4Fv8GXVCToRlMzDO94gvA8iOzKxQ7rhAbs8L+j8GPyTxGuUiYkV+63LecGeVdVhsL2KXih1sKnoqmH6tp89J7Q==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} @@ -16836,6 +16895,21 @@ packages: stack-utils: 2.0.5 dev: true + /jest-message-util/29.3.1: + resolution: {integrity: sha512-lMJTbgNcDm5z+6KDxWtqOFWlGQxD6XaYwBqHR8kmpkP+WWWG90I35kdtQHY67Ay5CSuydkTBbJG+tH9JShFCyA==} + engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + dependencies: + '@babel/code-frame': 7.18.6 + '@jest/types': 29.3.1 + '@types/stack-utils': 2.0.1 + chalk: 4.1.2 + graceful-fs: 4.2.10 + micromatch: 4.0.5 + pretty-format: 29.3.1 + slash: 3.0.0 + stack-utils: 2.0.5 + dev: true + /jest-mock/29.0.2: resolution: {integrity: sha512-giWXOIT23UCxHCN2VUfUJ0Q7SmiqQwfSFXlCaIhW5anITpNQ+3vuLPQdKt5wkuwM37GrbFyHIClce8AAK9ft9g==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} @@ -16844,6 +16918,15 @@ packages: '@types/node': 18.7.15 dev: true + /jest-mock/29.3.1: + resolution: {integrity: sha512-H8/qFDtDVMFvFP4X8NuOT3XRDzOUTz+FeACjufHzsOIBAxivLqkB1PoLCaJx9iPPQ8dZThHPp/G3WRWyMgA3JA==} + engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + dependencies: + '@jest/types': 29.3.1 + '@types/node': 18.7.15 + jest-util: 29.3.1 + dev: true + /jest-pnp-resolver/1.2.2_jest-resolve@29.0.2: resolution: {integrity: sha512-olV41bKSMm8BdnuMsewT4jqlZ8+3TCARAXjZGT9jcoSnrfUnRCqnMoF9XEeoWjbzObpqF9dRhHQj0Xb9QdF6/w==} engines: {node: '>=6'} @@ -16989,6 +17072,18 @@ packages: picomatch: 2.3.1 dev: true + /jest-util/29.3.1: + resolution: {integrity: sha512-7YOVZaiX7RJLv76ZfHt4nbNEzzTRiMW/IiOG7ZOKmTXmoGBxUDefgMAxQubu6WPVqP5zSzAdZG0FfLcC7HOIFQ==} + engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + dependencies: + '@jest/types': 29.3.1 + '@types/node': 18.7.15 + chalk: 4.1.2 + ci-info: 3.6.1 + graceful-fs: 4.2.10 + picomatch: 2.3.1 + dev: true + /jest-validate/29.0.2: resolution: {integrity: sha512-AeRKm7cEucSy7tr54r3LhiGIXYvOILUwBM1S7jQkKs6YelwAlWKsmZGVrQR7uwsd31rBTnR5NQkODi1Z+6TKIQ==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} @@ -17148,7 +17243,7 @@ packages: optional: true dependencies: abab: 2.0.6 - acorn: 8.8.0 + acorn: 8.8.1 acorn-globals: 6.0.0 cssom: 0.5.0 cssstyle: 2.3.0 @@ -17172,7 +17267,7 @@ packages: whatwg-encoding: 2.0.0 whatwg-mimetype: 3.0.0 whatwg-url: 11.0.0 - ws: 8.8.1 + ws: 8.11.0 xml-name-validator: 4.0.0 transitivePeerDependencies: - bufferutil @@ -20076,6 +20171,15 @@ packages: react-is: 18.2.0 dev: true + /pretty-format/29.3.1: + resolution: {integrity: sha512-FyLnmb1cYJV8biEIiRyzRFvs2lry7PPIvOqKVe1GCUEYg4YGmlx1qG9EJNMxArYm7piII4qb8UV1Pncq5dxmcg==} + engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + dependencies: + '@jest/schemas': 29.0.0 + ansi-styles: 5.2.0 + react-is: 18.2.0 + dev: true + /pretty-ms/3.2.0: resolution: {integrity: sha512-ZypexbfVUGTFxb0v+m1bUyy92DHe5SyYlnyY0msyms5zd3RwyvNgyxZZsXXgoyzlxjx5MiqtXUdhUfvQbe0A2Q==} engines: {node: '>=4'} @@ -24034,6 +24138,7 @@ packages: /w3c-hr-time/1.0.2: resolution: {integrity: sha512-z8P5DvDNjKDoFIHK7q8r8lackT6l+jo/Ye3HOle7l9nICP9lf1Ci25fy9vHd0JOWewkIFzXIEig3TdKT7JQ5fQ==} + deprecated: Use your platform's native performance.now() and performance.timeOrigin. dependencies: browser-process-hrtime: 1.0.0 dev: true @@ -24597,19 +24702,6 @@ packages: optional: true dev: true - /ws/8.8.1: - resolution: {integrity: sha512-bGy2JzvzkPowEJV++hF07hAD6niYSr0JzBNo/J29WsB57A2r7Wlc1UFcTR9IzrPvuNVO4B8LGqF8qcpsVOhJCA==} - engines: {node: '>=10.0.0'} - peerDependencies: - bufferutil: ^4.0.1 - utf-8-validate: ^5.0.2 - peerDependenciesMeta: - bufferutil: - optional: true - utf-8-validate: - optional: true - dev: true - /xdg-basedir/4.0.0: resolution: {integrity: sha512-PSNhEJDejZYV7h50BohL09Er9VaIefr2LMAf3OEmpCkjOi34eYyQYAXUTjEQtZJTKcF0E2UKTh+osDLsgNim9Q==} engines: {node: '>=8'}