@storybook/addon-interactions 7.0.0-alpha.4 → 7.0.0-alpha.5

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.
@@ -46,6 +46,14 @@ Demo.play = async ({
46
46
  }) => {
47
47
  await _testingLibrary.userEvent.click((0, _testingLibrary.within)(canvasElement).getByRole('button'));
48
48
  await (0, _jest.expect)(args.onSubmit).toHaveBeenCalledWith(_jest.expect.stringMatching(/([A-Z])\w+/gi));
49
+ await (0, _jest.expect)([{
50
+ name: 'John',
51
+ age: 42
52
+ }]).toEqual(_jest.expect.arrayContaining([_jest.expect.objectContaining({
53
+ name: 'John'
54
+ }), _jest.expect.objectContaining({
55
+ age: 42
56
+ })]));
49
57
  };
50
58
 
51
59
  const FindBy = args => {
@@ -128,7 +128,8 @@ const Node = _ref => {
128
128
 
129
129
  case Array.isArray(value):
130
130
  return /*#__PURE__*/_react.default.createElement(ArrayNode, _extends({}, props, {
131
- value: value
131
+ value: value,
132
+ callsById: callsById
132
133
  }));
133
134
 
134
135
  case typeof value === 'string':
@@ -264,7 +265,8 @@ exports.BooleanNode = BooleanNode;
264
265
 
265
266
  const ArrayNode = ({
266
267
  value,
267
- nested = false
268
+ nested = false,
269
+ callsById
268
270
  }) => {
269
271
  const colors = useThemeColors();
270
272
 
@@ -277,9 +279,10 @@ const ArrayNode = ({
277
279
  }
278
280
 
279
281
  const nodes = value.slice(0, 3).map(v => /*#__PURE__*/_react.default.createElement(Node, {
280
- key: v,
282
+ key: JSON.stringify(v),
281
283
  value: v,
282
- nested: true
284
+ nested: true,
285
+ callsById: callsById
283
286
  }));
284
287
  const nodelist = interleave(nodes, /*#__PURE__*/_react.default.createElement("span", null, ", "));
285
288
 
@@ -29,6 +29,14 @@ Demo.play = async ({
29
29
  }) => {
30
30
  await userEvent.click(within(canvasElement).getByRole('button'));
31
31
  await expect(args.onSubmit).toHaveBeenCalledWith(expect.stringMatching(/([A-Z])\w+/gi));
32
+ await expect([{
33
+ name: 'John',
34
+ age: 42
35
+ }]).toEqual(expect.arrayContaining([expect.objectContaining({
36
+ name: 'John'
37
+ }), expect.objectContaining({
38
+ age: 42
39
+ })]));
32
40
  };
33
41
 
34
42
  export const FindBy = args => {
@@ -114,7 +114,8 @@ export const Node = _ref => {
114
114
 
115
115
  case Array.isArray(value):
116
116
  return /*#__PURE__*/React.createElement(ArrayNode, _extends({}, props, {
117
- value: value
117
+ value: value,
118
+ callsById: callsById
118
119
  }));
119
120
 
120
121
  case typeof value === 'string':
@@ -232,7 +233,8 @@ export const BooleanNode = _ref4 => {
232
233
  };
233
234
  export const ArrayNode = ({
234
235
  value,
235
- nested = false
236
+ nested = false,
237
+ callsById
236
238
  }) => {
237
239
  const colors = useThemeColors();
238
240
 
@@ -245,9 +247,10 @@ export const ArrayNode = ({
245
247
  }
246
248
 
247
249
  const nodes = value.slice(0, 3).map(v => /*#__PURE__*/React.createElement(Node, {
248
- key: v,
250
+ key: JSON.stringify(v),
249
251
  value: v,
250
- nested: true
252
+ nested: true,
253
+ callsById: callsById
251
254
  }));
252
255
  const nodelist = interleave(nodes, /*#__PURE__*/React.createElement("span", null, ", "));
253
256
 
@@ -22,9 +22,10 @@ export declare const NumberNode: ({ value, ...props }: {
22
22
  export declare const BooleanNode: ({ value, ...props }: {
23
23
  value: boolean;
24
24
  }) => JSX.Element;
25
- export declare const ArrayNode: ({ value, nested }: {
25
+ export declare const ArrayNode: ({ value, nested, callsById, }: {
26
26
  value: any[];
27
27
  nested?: boolean;
28
+ callsById?: Map<Call['id'], Call>;
28
29
  }) => JSX.Element;
29
30
  export declare const ObjectNode: ({ showInspector, value, nested, }: {
30
31
  showInspector?: boolean;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@storybook/addon-interactions",
3
- "version": "7.0.0-alpha.4",
3
+ "version": "7.0.0-alpha.5",
4
4
  "description": "Automate, test and debug user interactions",
5
5
  "keywords": [
6
6
  "storybook-addons",
@@ -35,15 +35,15 @@
35
35
  },
36
36
  "dependencies": {
37
37
  "@devtools-ds/object-inspector": "^1.1.2",
38
- "@storybook/addons": "7.0.0-alpha.4",
39
- "@storybook/api": "7.0.0-alpha.4",
40
- "@storybook/client-logger": "7.0.0-alpha.4",
41
- "@storybook/components": "7.0.0-alpha.4",
42
- "@storybook/core-common": "7.0.0-alpha.4",
43
- "@storybook/core-events": "7.0.0-alpha.4",
38
+ "@storybook/addons": "7.0.0-alpha.5",
39
+ "@storybook/api": "7.0.0-alpha.5",
40
+ "@storybook/client-logger": "7.0.0-alpha.5",
41
+ "@storybook/components": "7.0.0-alpha.5",
42
+ "@storybook/core-common": "7.0.0-alpha.5",
43
+ "@storybook/core-events": "7.0.0-alpha.5",
44
44
  "@storybook/csf": "0.0.2--canary.4566f4d.1",
45
- "@storybook/instrumenter": "7.0.0-alpha.4",
46
- "@storybook/theming": "7.0.0-alpha.4",
45
+ "@storybook/instrumenter": "7.0.0-alpha.5",
46
+ "@storybook/theming": "7.0.0-alpha.5",
47
47
  "core-js": "^3.8.2",
48
48
  "global": "^4.4.0",
49
49
  "jest-mock": "^27.0.6",
@@ -70,7 +70,7 @@
70
70
  "publishConfig": {
71
71
  "access": "public"
72
72
  },
73
- "gitHead": "006ed54452dd7c37a8cbe91a84f5312182f7ca00",
73
+ "gitHead": "3dd46982823b34d9f37be917b6247631081feff7",
74
74
  "storybook": {
75
75
  "displayName": "Interactions",
76
76
  "unsupportedFrameworks": [