add adapter to storyshot test with enzyme

This commit is contained in:
Norbert de Langen 2023-01-08 00:09:11 +01:00
parent 11a758c629
commit 6a3b9adb40
No known key found for this signature in database
GPG Key ID: FD0E78AF9A837762
3 changed files with 100 additions and 7 deletions

View File

@ -65,6 +65,7 @@
"@storybook/vue3": "7.0.0-beta.20",
"babel-loader": "^8.3.0",
"enzyme": "^3.11.0",
"enzyme-adapter-react-16": "^1.15.5",
"enzyme-to-json": "^3.6.1",
"jest-preset-angular": "^8.3.2",
"jest-vue-preprocessor": "^1.7.1",

View File

@ -1,7 +1,11 @@
import path from 'path';
import { mount } from 'enzyme';
import { mount, configure } from 'enzyme';
// @ts-expect-error (Converted from ts-ignore)
import Adapter from 'enzyme-adapter-react-16';
import initStoryshots from '../src';
configure({ adapter: new Adapter() });
initStoryshots({
framework: 'react',
configPath: path.join(__dirname, 'exported_metadata'),

View File

@ -5768,6 +5768,7 @@ __metadata:
babel-loader: ^8.3.0
core-js: ^3.8.2
enzyme: ^3.11.0
enzyme-adapter-react-16: ^1.15.5
enzyme-to-json: ^3.6.1
glob: ^7.1.6
jest-preset-angular: ^8.3.2
@ -10190,6 +10191,25 @@ __metadata:
languageName: node
linkType: hard
"airbnb-prop-types@npm:^2.16.0":
version: 2.16.0
resolution: "airbnb-prop-types@npm:2.16.0"
dependencies:
array.prototype.find: ^2.1.1
function.prototype.name: ^1.1.2
is-regex: ^1.1.0
object-is: ^1.1.2
object.assign: ^4.1.0
object.entries: ^1.1.2
prop-types: ^15.7.2
prop-types-exact: ^1.2.0
react-is: ^16.13.1
peerDependencies:
react: ^0.14 || ^15.0.0 || ^16.0.0-alpha
checksum: c3666777bf9ee3a077ce79a02fcf79b7cf3123b11a626750826912e1f0f44772177e6667176558e10384f4501556f5e7eeb198231e9f61794864465167c8ee33
languageName: node
linkType: hard
"ajv-formats@npm:2.1.1, ajv-formats@npm:^2.1.1":
version: 2.1.1
resolution: "ajv-formats@npm:2.1.1"
@ -10603,6 +10623,18 @@ __metadata:
languageName: node
linkType: hard
"array.prototype.find@npm:^2.1.1":
version: 2.2.1
resolution: "array.prototype.find@npm:2.2.1"
dependencies:
call-bind: ^1.0.2
define-properties: ^1.1.4
es-abstract: ^1.20.4
es-shim-unscopables: ^1.0.0
checksum: 09211690d57a114a0d7de39dbd812f7844322aaed74aaa353ff2b7ee9f5a416581ca72a4c0c1cdf520cf5bad62aa33f8ca7d972afa83204ebedcb72582f08a49
languageName: node
linkType: hard
"array.prototype.flat@npm:^1.2.3, array.prototype.flat@npm:^1.2.5":
version: 1.3.1
resolution: "array.prototype.flat@npm:1.3.1"
@ -14706,7 +14738,45 @@ __metadata:
languageName: node
linkType: hard
"enzyme-shallow-equal@npm:^1.0.1":
"enzyme-adapter-react-16@npm:^1.15.5":
version: 1.15.7
resolution: "enzyme-adapter-react-16@npm:1.15.7"
dependencies:
enzyme-adapter-utils: ^1.14.1
enzyme-shallow-equal: ^1.0.5
has: ^1.0.3
object.assign: ^4.1.4
object.values: ^1.1.5
prop-types: ^15.8.1
react-is: ^16.13.1
react-test-renderer: ^16.0.0-0
semver: ^5.7.0
peerDependencies:
enzyme: ^3.0.0
react: ^16.0.0-0
react-dom: ^16.0.0-0
checksum: 7cb69fcdc4bf2390ffe440cfa906c698b90d533032180b5b6ddf5ace1edac0e09a687b7f36706e1bba3b02a91585d8d5bd0317c237b5f5eab00bdb5512f330ee
languageName: node
linkType: hard
"enzyme-adapter-utils@npm:^1.14.1":
version: 1.14.1
resolution: "enzyme-adapter-utils@npm:1.14.1"
dependencies:
airbnb-prop-types: ^2.16.0
function.prototype.name: ^1.1.5
has: ^1.0.3
object.assign: ^4.1.4
object.fromentries: ^2.0.5
prop-types: ^15.8.1
semver: ^5.7.1
peerDependencies:
react: 0.13.x || 0.14.x || ^15.0.0-0 || ^16.0.0-0
checksum: f07423c9181ed22fda4d761ec54aca6d9fb65d8b95da48c1471d39892f8af3d3fa54c971ed73a16acbc9a483ccda3a58f97a590bf95b4d5f77f99ae37c1ac8bb
languageName: node
linkType: hard
"enzyme-shallow-equal@npm:^1.0.1, enzyme-shallow-equal@npm:^1.0.5":
version: 1.0.5
resolution: "enzyme-shallow-equal@npm:1.0.5"
dependencies:
@ -18958,7 +19028,7 @@ __metadata:
languageName: node
linkType: hard
"is-regex@npm:^1.0.3, is-regex@npm:^1.0.4, is-regex@npm:^1.0.5, is-regex@npm:^1.1.4":
"is-regex@npm:^1.0.3, is-regex@npm:^1.0.4, is-regex@npm:^1.0.5, is-regex@npm:^1.1.0, is-regex@npm:^1.1.4":
version: 1.1.4
resolution: "is-regex@npm:1.1.4"
dependencies:
@ -23535,7 +23605,7 @@ __metadata:
languageName: node
linkType: hard
"object-is@npm:^1.0.1, object-is@npm:^1.0.2, object-is@npm:^1.1.5":
"object-is@npm:^1.0.1, object-is@npm:^1.0.2, object-is@npm:^1.1.2, object-is@npm:^1.1.5":
version: 1.1.5
resolution: "object-is@npm:1.1.5"
dependencies:
@ -23584,7 +23654,7 @@ __metadata:
languageName: node
linkType: hard
"object.fromentries@npm:^2.0.6":
"object.fromentries@npm:^2.0.5, object.fromentries@npm:^2.0.6":
version: 2.0.6
resolution: "object.fromentries@npm:2.0.6"
dependencies:
@ -25435,6 +25505,17 @@ __metadata:
languageName: node
linkType: hard
"prop-types-exact@npm:^1.2.0":
version: 1.2.0
resolution: "prop-types-exact@npm:1.2.0"
dependencies:
has: ^1.0.3
object.assign: ^4.1.0
reflect.ownkeys: ^0.2.0
checksum: 71e186c5b982f72b8226f052b710ef6b87fff7275fcf5834b4913fa5b6c325c44be111488786fd3c4e422fb4bb4e91f3c7f35445366c9a4585405d3b02872587
languageName: node
linkType: hard
"prop-types@npm:^15.6.2, prop-types@npm:^15.7.2, prop-types@npm:^15.8.1":
version: 15.8.1
resolution: "prop-types@npm:15.8.1"
@ -26135,7 +26216,7 @@ __metadata:
languageName: node
linkType: hard
"react-test-renderer@npm:^16":
"react-test-renderer@npm:^16, react-test-renderer@npm:^16.0.0-0":
version: 16.14.0
resolution: "react-test-renderer@npm:16.14.0"
dependencies:
@ -26425,6 +26506,13 @@ __metadata:
languageName: node
linkType: hard
"reflect.ownkeys@npm:^0.2.0":
version: 0.2.0
resolution: "reflect.ownkeys@npm:0.2.0"
checksum: 169f20287ad33b76fc8b6932734b3e1469ee59f31d8357858e96718a6f71fa60d7a13f2fc4e9191e47c2a51e4183151290f3a35315ba461190d87b0593725557
languageName: node
linkType: hard
"refractor@npm:^3.6.0":
version: 3.6.0
resolution: "refractor@npm:3.6.0"
@ -27612,7 +27700,7 @@ __metadata:
languageName: node
linkType: hard
"semver@npm:2 || 3 || 4 || 5, semver@npm:^5.3.0, semver@npm:^5.4.1, semver@npm:^5.5.0, semver@npm:^5.6.0":
"semver@npm:2 || 3 || 4 || 5, semver@npm:^5.3.0, semver@npm:^5.4.1, semver@npm:^5.5.0, semver@npm:^5.6.0, semver@npm:^5.7.0, semver@npm:^5.7.1":
version: 5.7.1
resolution: "semver@npm:5.7.1"
bin: