@zohodesk/dot 1.0.0-temp-210.1 → 1.0.0-temp-211
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.
- package/.cli/propValidation_report.html +1 -1
- package/README.md +5 -0
- package/es/ActionButton/__tests__/ActionButton.spec.js +353 -2
- package/es/ActionButton/__tests__/__snapshots__/ActionButton.spec.js.snap +2633 -1
- package/es/Drawer/Drawer.js +2 -10
- package/es/Drawer/__tests__/Content.spec.js +24 -0
- package/es/Drawer/__tests__/Drawer.spec.js +130 -4
- package/es/Drawer/__tests__/Footer.spec.js +34 -0
- package/es/Drawer/__tests__/Header.spec.js +173 -0
- package/es/Drawer/__tests__/__snapshots__/Content.spec.js.snap +127 -0
- package/es/Drawer/__tests__/__snapshots__/Drawer.spec.js.snap +535 -2
- package/es/Drawer/__tests__/__snapshots__/Footer.spec.js.snap +1233 -0
- package/es/Drawer/__tests__/__snapshots__/Header.spec.js.snap +782 -0
- package/es/Drawer/props/defaultProps.js +1 -5
- package/es/Drawer/props/propTypes.js +1 -5
- package/es/FlipCard/__tests__/FlipCard.spec.js +606 -2
- package/es/FlipCard/__tests__/__snapshots__/FlipCard.spec.js.snap +6626 -1
- package/es/FreezeLayer/FreezeLayer.js +3 -11
- package/es/FreezeLayer/props/defaultProps.js +1 -5
- package/es/FreezeLayer/props/propTypes.js +1 -5
- package/es/Link/__tests__/Link.spec.js +123 -3
- package/es/Link/__tests__/__snapshots__/Link.spec.js.snap +142 -2
- package/es/dropdown/ToggleDropDown/ToggleDropDown.js +8 -2
- package/es/list/ListStencils/ListStencils.js +7 -2
- package/es/list/ListStencils/__tests__/ListStencils.spec.js +9 -0
- package/es/list/ListStencils/__tests__/__snapshots__/ListStencils.spec.js.snap +46 -0
- package/es/list/ListStencils/props/propTypes.js +3 -1
- package/lib/ActionButton/__tests__/ActionButton.spec.js +354 -1
- package/lib/ActionButton/__tests__/__snapshots__/ActionButton.spec.js.snap +2633 -1
- package/lib/Drawer/Drawer.js +2 -10
- package/lib/Drawer/__tests__/Content.spec.js +35 -0
- package/lib/Drawer/__tests__/Drawer.spec.js +132 -5
- package/lib/Drawer/__tests__/Footer.spec.js +41 -0
- package/lib/Drawer/__tests__/Header.spec.js +192 -0
- package/lib/Drawer/__tests__/__snapshots__/Content.spec.js.snap +127 -0
- package/lib/Drawer/__tests__/__snapshots__/Drawer.spec.js.snap +535 -2
- package/lib/Drawer/__tests__/__snapshots__/Footer.spec.js.snap +1233 -0
- package/lib/Drawer/__tests__/__snapshots__/Header.spec.js.snap +782 -0
- package/lib/Drawer/props/defaultProps.js +1 -5
- package/lib/Drawer/props/propTypes.js +1 -5
- package/lib/FlipCard/__tests__/FlipCard.spec.js +613 -1
- package/lib/FlipCard/__tests__/__snapshots__/FlipCard.spec.js.snap +6626 -1
- package/lib/FreezeLayer/FreezeLayer.js +3 -11
- package/lib/FreezeLayer/props/defaultProps.js +1 -5
- package/lib/FreezeLayer/props/propTypes.js +1 -5
- package/lib/Link/__tests__/Link.spec.js +130 -4
- package/lib/Link/__tests__/__snapshots__/Link.spec.js.snap +142 -2
- package/lib/dropdown/ToggleDropDown/ToggleDropDown.js +12 -6
- package/lib/list/ListStencils/ListStencils.js +8 -2
- package/lib/list/ListStencils/__tests__/ListStencils.spec.js +9 -0
- package/lib/list/ListStencils/__tests__/__snapshots__/ListStencils.spec.js.snap +46 -0
- package/lib/list/ListStencils/props/propTypes.js +3 -1
- package/package.json +6 -6
- package/result.json +1 -0
- package/unittest/index.html +45 -0
package/es/Drawer/Drawer.js
CHANGED
|
@@ -233,11 +233,7 @@ export default class Drawer extends React.Component {
|
|
|
233
233
|
subDrawerActive,
|
|
234
234
|
customClass,
|
|
235
235
|
needAutoZindex,
|
|
236
|
-
innerPortalName
|
|
237
|
-
onParentAnimateComplete,
|
|
238
|
-
onChildAnimateComplete,
|
|
239
|
-
postAnimateParentStyles,
|
|
240
|
-
postAnimateChildStyles
|
|
236
|
+
innerPortalName
|
|
241
237
|
} = this.props;
|
|
242
238
|
let zindexNumber = isActive ? this.getNextIndex() : '';
|
|
243
239
|
return /*#__PURE__*/React.createElement(ResponsiveReceiver, {
|
|
@@ -256,11 +252,7 @@ export default class Drawer extends React.Component {
|
|
|
256
252
|
palette: palette,
|
|
257
253
|
forwardRef: forwardRef,
|
|
258
254
|
customClass: customClass,
|
|
259
|
-
needAutoZindex: needAutoZindex
|
|
260
|
-
onParentAnimateComplete: onParentAnimateComplete,
|
|
261
|
-
onChildAnimateComplete: onChildAnimateComplete,
|
|
262
|
-
postAnimateParentStyles: postAnimateParentStyles,
|
|
263
|
-
postAnimateChildStyles: postAnimateChildStyles
|
|
255
|
+
needAutoZindex: needAutoZindex
|
|
264
256
|
}, /*#__PURE__*/React.createElement(Box, {
|
|
265
257
|
flexible: true
|
|
266
258
|
}, /*#__PURE__*/React.createElement(Container, {
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { render } from '@testing-library/react';
|
|
3
|
+
import { Content } from "../Drawer";
|
|
4
|
+
const paddingSizes = ['small', 'medium', 'large'];
|
|
5
|
+
const visibilityStates = [true, false];
|
|
6
|
+
describe('Content Component Snapshots', () => {
|
|
7
|
+
test.each(paddingSizes)('renders Content with paddingSize - %s', paddingSize => {
|
|
8
|
+
const {
|
|
9
|
+
asFragment
|
|
10
|
+
} = render( /*#__PURE__*/React.createElement(Content, {
|
|
11
|
+
paddingSize: paddingSize
|
|
12
|
+
}, "Content"));
|
|
13
|
+
expect(asFragment()).toMatchSnapshot();
|
|
14
|
+
});
|
|
15
|
+
test.each(paddingSizes.flatMap(paddingSize => visibilityStates.map(isVisible => [paddingSize, isVisible])))('renders Content with paddingSize - %s and isVisible - %s', (paddingSize, isVisible) => {
|
|
16
|
+
const {
|
|
17
|
+
asFragment
|
|
18
|
+
} = render( /*#__PURE__*/React.createElement(Content, {
|
|
19
|
+
paddingSize: paddingSize,
|
|
20
|
+
isVisible: isVisible
|
|
21
|
+
}, "Content"));
|
|
22
|
+
expect(asFragment()).toMatchSnapshot();
|
|
23
|
+
});
|
|
24
|
+
});
|
|
@@ -1,14 +1,64 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { render } from '@testing-library/react';
|
|
3
3
|
import Drawer from "../Drawer";
|
|
4
|
-
|
|
5
|
-
|
|
4
|
+
const sizes = ['small', 'xsmall', 'medium', 'xmedium', 'large', 'xlarge', 'xxlarge', 'default'];
|
|
5
|
+
const palettes = ['dark', 'default', 'darkLight', 'plain'];
|
|
6
|
+
const subDrawerSizes = ['xsmall', 'small', 'medium'];
|
|
7
|
+
describe('Drawer Component Snapshots', () => {
|
|
8
|
+
test('renders with default props', () => {
|
|
6
9
|
const {
|
|
7
10
|
asFragment
|
|
8
|
-
} = render( /*#__PURE__*/React.createElement(Drawer,
|
|
11
|
+
} = render( /*#__PURE__*/React.createElement(Drawer, {
|
|
12
|
+
isActive: true
|
|
13
|
+
}));
|
|
14
|
+
expect(asFragment()).toMatchSnapshot();
|
|
15
|
+
});
|
|
16
|
+
test.each(sizes)('renders Drawer with size - %s', size => {
|
|
17
|
+
const {
|
|
18
|
+
asFragment
|
|
19
|
+
} = render( /*#__PURE__*/React.createElement(Drawer, {
|
|
20
|
+
isActive: true,
|
|
21
|
+
size: size
|
|
22
|
+
}));
|
|
23
|
+
expect(asFragment()).toMatchSnapshot();
|
|
24
|
+
});
|
|
25
|
+
test.each(palettes)('renders Drawer with palette - %s', palette => {
|
|
26
|
+
const {
|
|
27
|
+
asFragment
|
|
28
|
+
} = render( /*#__PURE__*/React.createElement(Drawer, {
|
|
29
|
+
isActive: true,
|
|
30
|
+
palette: palette
|
|
31
|
+
}));
|
|
32
|
+
expect(asFragment()).toMatchSnapshot();
|
|
33
|
+
});
|
|
34
|
+
test.each(subDrawerSizes)('renders Drawer with subDrawerSize - %s', subDrawerSize => {
|
|
35
|
+
const {
|
|
36
|
+
asFragment
|
|
37
|
+
} = render( /*#__PURE__*/React.createElement(Drawer, {
|
|
38
|
+
isActive: true,
|
|
39
|
+
subDrawerSize: subDrawerSize,
|
|
40
|
+
subDrawerActive: true
|
|
41
|
+
}));
|
|
9
42
|
expect(asFragment()).toMatchSnapshot();
|
|
10
43
|
});
|
|
11
|
-
test('
|
|
44
|
+
test('renders with custom className', () => {
|
|
45
|
+
const {
|
|
46
|
+
asFragment
|
|
47
|
+
} = render( /*#__PURE__*/React.createElement(Drawer, {
|
|
48
|
+
isActive: true,
|
|
49
|
+
customClass: "custom-drawer"
|
|
50
|
+
}));
|
|
51
|
+
expect(asFragment()).toMatchSnapshot();
|
|
52
|
+
});
|
|
53
|
+
test('renders Drawer with subDrawerActive set to true', () => {
|
|
54
|
+
const {
|
|
55
|
+
asFragment
|
|
56
|
+
} = render( /*#__PURE__*/React.createElement(Drawer, {
|
|
57
|
+
subDrawerActive: true
|
|
58
|
+
}));
|
|
59
|
+
expect(asFragment()).toMatchSnapshot();
|
|
60
|
+
});
|
|
61
|
+
test('renders Drawer with isActive set to true', () => {
|
|
12
62
|
const {
|
|
13
63
|
asFragment
|
|
14
64
|
} = render( /*#__PURE__*/React.createElement(Drawer, {
|
|
@@ -16,4 +66,80 @@ describe('Drawer', () => {
|
|
|
16
66
|
}));
|
|
17
67
|
expect(asFragment()).toMatchSnapshot();
|
|
18
68
|
});
|
|
69
|
+
test('renders Drawer with needAutoZindex set to true', () => {
|
|
70
|
+
const {
|
|
71
|
+
asFragment
|
|
72
|
+
} = render( /*#__PURE__*/React.createElement(Drawer, {
|
|
73
|
+
needAutoZindex: true
|
|
74
|
+
}));
|
|
75
|
+
expect(asFragment()).toMatchSnapshot();
|
|
76
|
+
});
|
|
77
|
+
test('renders Drawer with needFocusScope set to true', () => {
|
|
78
|
+
const {
|
|
79
|
+
asFragment
|
|
80
|
+
} = render( /*#__PURE__*/React.createElement(Drawer, {
|
|
81
|
+
needFocusScope: true
|
|
82
|
+
}));
|
|
83
|
+
expect(asFragment()).toMatchSnapshot();
|
|
84
|
+
});
|
|
85
|
+
test('renders Drawer with flexible set to true', () => {
|
|
86
|
+
const {
|
|
87
|
+
asFragment
|
|
88
|
+
} = render( /*#__PURE__*/React.createElement(Drawer, {
|
|
89
|
+
flexible: true
|
|
90
|
+
}));
|
|
91
|
+
expect(asFragment()).toMatchSnapshot();
|
|
92
|
+
});
|
|
93
|
+
test('renders Drawer with isIconBold set to true', () => {
|
|
94
|
+
const {
|
|
95
|
+
asFragment
|
|
96
|
+
} = render( /*#__PURE__*/React.createElement(Drawer, {
|
|
97
|
+
isIconBold: true
|
|
98
|
+
}));
|
|
99
|
+
expect(asFragment()).toMatchSnapshot();
|
|
100
|
+
});
|
|
101
|
+
test('renders Drawer with isBoxIcon set to true', () => {
|
|
102
|
+
const {
|
|
103
|
+
asFragment
|
|
104
|
+
} = render( /*#__PURE__*/React.createElement(Drawer, {
|
|
105
|
+
isBoxIcon: true
|
|
106
|
+
}));
|
|
107
|
+
expect(asFragment()).toMatchSnapshot();
|
|
108
|
+
});
|
|
109
|
+
test('renders Drawer with needFreeze set to true', () => {
|
|
110
|
+
const {
|
|
111
|
+
asFragment
|
|
112
|
+
} = render( /*#__PURE__*/React.createElement(Drawer, {
|
|
113
|
+
needFreeze: true
|
|
114
|
+
}));
|
|
115
|
+
expect(asFragment()).toMatchSnapshot();
|
|
116
|
+
});
|
|
117
|
+
test('renders with customProps', () => {
|
|
118
|
+
const customProps = {
|
|
119
|
+
'aria-label': 'Custom Drawer',
|
|
120
|
+
'data-custom': 'customValue'
|
|
121
|
+
};
|
|
122
|
+
const {
|
|
123
|
+
asFragment
|
|
124
|
+
} = render( /*#__PURE__*/React.createElement(Drawer, {
|
|
125
|
+
isActive: true,
|
|
126
|
+
customProps: customProps
|
|
127
|
+
}));
|
|
128
|
+
expect(asFragment()).toMatchSnapshot();
|
|
129
|
+
});
|
|
130
|
+
test('renders Drawer with all options combined', () => {
|
|
131
|
+
const {
|
|
132
|
+
asFragment
|
|
133
|
+
} = render( /*#__PURE__*/React.createElement(Drawer, {
|
|
134
|
+
size: "medium",
|
|
135
|
+
palette: "default",
|
|
136
|
+
subDrawerActive: true,
|
|
137
|
+
subDrawerSize: "small",
|
|
138
|
+
customClass: "combined-drawer",
|
|
139
|
+
isActive: true,
|
|
140
|
+
needFreeze: true,
|
|
141
|
+
needAutoZindex: true
|
|
142
|
+
}));
|
|
143
|
+
expect(asFragment()).toMatchSnapshot();
|
|
144
|
+
});
|
|
19
145
|
});
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { render } from '@testing-library/react';
|
|
3
|
+
import { Footer } from "../Drawer";
|
|
4
|
+
const sizes = ['small', 'xsmall', 'medium', 'xmedium', 'large', 'xlarge', 'xxlarge', 'default'];
|
|
5
|
+
const variants = ['primary', 'secondary', 'tertiary', 'default'];
|
|
6
|
+
describe('Footer Component Snapshots', () => {
|
|
7
|
+
test.each(sizes)('renders Footer with size - %s', size => {
|
|
8
|
+
const {
|
|
9
|
+
asFragment
|
|
10
|
+
} = render( /*#__PURE__*/React.createElement(Footer, {
|
|
11
|
+
size: size
|
|
12
|
+
}, "Footer Content"));
|
|
13
|
+
expect(asFragment()).toMatchSnapshot();
|
|
14
|
+
});
|
|
15
|
+
test.each(variants)('renders Footer with variant - %s', variant => {
|
|
16
|
+
const {
|
|
17
|
+
asFragment
|
|
18
|
+
} = render( /*#__PURE__*/React.createElement(Footer, {
|
|
19
|
+
variant: variant
|
|
20
|
+
}, "Footer Content"));
|
|
21
|
+
expect(asFragment()).toMatchSnapshot();
|
|
22
|
+
});
|
|
23
|
+
test.each(sizes)('renders Footer with size - %s and all variants', size => {
|
|
24
|
+
variants.forEach(variant => {
|
|
25
|
+
const {
|
|
26
|
+
asFragment
|
|
27
|
+
} = render( /*#__PURE__*/React.createElement(Footer, {
|
|
28
|
+
size: size,
|
|
29
|
+
variant: variant
|
|
30
|
+
}, "Footer Content"));
|
|
31
|
+
expect(asFragment()).toMatchSnapshot();
|
|
32
|
+
});
|
|
33
|
+
});
|
|
34
|
+
});
|
|
@@ -0,0 +1,173 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { render, fireEvent } from '@testing-library/react';
|
|
3
|
+
import { Header } from "../Drawer";
|
|
4
|
+
const paddingSizes = ['small', 'medium', 'large']; // describe('Header Component', () => {
|
|
5
|
+
// describe('Snapshots', () => {
|
|
6
|
+
// test('renders with default props', () => {
|
|
7
|
+
// const { asFragment } = render(<Header />);
|
|
8
|
+
// expect(asFragment()).toMatchSnapshot();
|
|
9
|
+
// });
|
|
10
|
+
// test.each(paddingSizes)('renders Header with paddingSize - %s', (paddingSize) => {
|
|
11
|
+
// const { asFragment } = render(<Header paddingSize={paddingSize} />);
|
|
12
|
+
// expect(asFragment()).toMatchSnapshot();
|
|
13
|
+
// });
|
|
14
|
+
// test('renders Header with flexible set to true', () => {
|
|
15
|
+
// const { asFragment } = render(<Header flexible />);
|
|
16
|
+
// expect(asFragment()).toMatchSnapshot();
|
|
17
|
+
// });
|
|
18
|
+
// test('renders Header with isIconBold set to true', () => {
|
|
19
|
+
// const { asFragment } = render(<Header isIconBold />);
|
|
20
|
+
// expect(asFragment()).toMatchSnapshot();
|
|
21
|
+
// });
|
|
22
|
+
// test('renders Header with isBoxIcon set to true', () => {
|
|
23
|
+
// const { asFragment } = render(<Header isBoxIcon />);
|
|
24
|
+
// expect(asFragment()).toMatchSnapshot();
|
|
25
|
+
// });
|
|
26
|
+
// test('renders Header with custom className', () => {
|
|
27
|
+
// const { asFragment } = render(<Header className="custom-header" />);
|
|
28
|
+
// expect(asFragment()).toMatchSnapshot();
|
|
29
|
+
// });
|
|
30
|
+
// test('renders Header with title', () => {
|
|
31
|
+
// const { asFragment } = render(<Header title="Header Title" />);
|
|
32
|
+
// expect(asFragment()).toMatchSnapshot();
|
|
33
|
+
// });
|
|
34
|
+
// test('renders Header with closeTitle', () => {
|
|
35
|
+
// const { asFragment } = render(<Header closeTitle="Close Header" />);
|
|
36
|
+
// expect(asFragment()).toMatchSnapshot();
|
|
37
|
+
// });
|
|
38
|
+
// test('renders Header with iconName and iconSize', () => {
|
|
39
|
+
// const { asFragment } = render(<Header iconName="ZD-icon" iconSize="24" />);
|
|
40
|
+
// expect(asFragment()).toMatchSnapshot();
|
|
41
|
+
// });
|
|
42
|
+
// test('renders Header with getChildren function', () => {
|
|
43
|
+
// const { asFragment } = render(<Header getChildren={() => <div>Child Content</div>} />);
|
|
44
|
+
// expect(asFragment()).toMatchSnapshot();
|
|
45
|
+
// });
|
|
46
|
+
// test('renders Header with getTitleChildren function', () => {
|
|
47
|
+
// const { asFragment } = render(<Header getTitleChildren={() => <div>Title Child</div>} />);
|
|
48
|
+
// expect(asFragment()).toMatchSnapshot();
|
|
49
|
+
// });
|
|
50
|
+
// test('renders Header with dataId', () => {
|
|
51
|
+
// const { asFragment } = render(<Header dataId="header-id" />);
|
|
52
|
+
// expect(asFragment()).toMatchSnapshot();
|
|
53
|
+
// });
|
|
54
|
+
// });
|
|
55
|
+
// describe('Interactions', () => {
|
|
56
|
+
// test('calls onClose handler when close button is clicked', () => {
|
|
57
|
+
// const mockOnClose = jest.fn();
|
|
58
|
+
// const { getByRole } = render(<Header onClose={mockOnClose} />);
|
|
59
|
+
// const closeButton = getByRole('button', { name: /close/i });
|
|
60
|
+
// fireEvent.click(closeButton);
|
|
61
|
+
// expect(mockOnClose).toHaveBeenCalledTimes(1);
|
|
62
|
+
// });
|
|
63
|
+
// test('calls onIconClick handler when icon is clicked', () => {
|
|
64
|
+
// const mockOnIconClick = jest.fn();
|
|
65
|
+
// const { getByRole } = render(<Header iconName="ZD-icon" onIconClick={mockOnIconClick} />);
|
|
66
|
+
// const iconButton = getByRole('button');
|
|
67
|
+
// fireEvent.click(iconButton);
|
|
68
|
+
// expect(mockOnIconClick).toHaveBeenCalledTimes(1);
|
|
69
|
+
// });
|
|
70
|
+
// });
|
|
71
|
+
// });
|
|
72
|
+
|
|
73
|
+
describe('Header Component - Title Prop Combinations', () => {
|
|
74
|
+
test('renders with default props', () => {
|
|
75
|
+
const {
|
|
76
|
+
asFragment
|
|
77
|
+
} = render( /*#__PURE__*/React.createElement(Header, null));
|
|
78
|
+
expect(asFragment()).toMatchSnapshot();
|
|
79
|
+
});
|
|
80
|
+
test('renders Header with title only', () => {
|
|
81
|
+
const {
|
|
82
|
+
asFragment
|
|
83
|
+
} = render( /*#__PURE__*/React.createElement(Header, {
|
|
84
|
+
title: "Header Title"
|
|
85
|
+
}));
|
|
86
|
+
expect(asFragment()).toMatchSnapshot();
|
|
87
|
+
});
|
|
88
|
+
test('renders Header with title and close button', () => {
|
|
89
|
+
const mockOnClose = jest.fn();
|
|
90
|
+
const {
|
|
91
|
+
asFragment
|
|
92
|
+
} = render( /*#__PURE__*/React.createElement(Header, {
|
|
93
|
+
title: "Header Title",
|
|
94
|
+
onClose: mockOnClose
|
|
95
|
+
}));
|
|
96
|
+
expect(asFragment()).toMatchSnapshot();
|
|
97
|
+
});
|
|
98
|
+
test('renders Header with title and icon', () => {
|
|
99
|
+
const {
|
|
100
|
+
asFragment
|
|
101
|
+
} = render( /*#__PURE__*/React.createElement(Header, {
|
|
102
|
+
title: "Header Title",
|
|
103
|
+
iconName: "ZD-icon",
|
|
104
|
+
iconSize: "24"
|
|
105
|
+
}));
|
|
106
|
+
expect(asFragment()).toMatchSnapshot();
|
|
107
|
+
});
|
|
108
|
+
test('renders Header with title, icon, and close button', () => {
|
|
109
|
+
const mockOnClose = jest.fn();
|
|
110
|
+
const {
|
|
111
|
+
asFragment
|
|
112
|
+
} = render( /*#__PURE__*/React.createElement(Header, {
|
|
113
|
+
title: "Header Title",
|
|
114
|
+
iconName: "ZD-icon",
|
|
115
|
+
iconSize: "24",
|
|
116
|
+
onClose: mockOnClose
|
|
117
|
+
}));
|
|
118
|
+
expect(asFragment()).toMatchSnapshot();
|
|
119
|
+
});
|
|
120
|
+
test('renders Header with title and custom className', () => {
|
|
121
|
+
const {
|
|
122
|
+
asFragment
|
|
123
|
+
} = render( /*#__PURE__*/React.createElement(Header, {
|
|
124
|
+
title: "Header Title",
|
|
125
|
+
className: "custom-header"
|
|
126
|
+
}));
|
|
127
|
+
expect(asFragment()).toMatchSnapshot();
|
|
128
|
+
});
|
|
129
|
+
test('renders Header with title and getTitleChildren function', () => {
|
|
130
|
+
const {
|
|
131
|
+
asFragment
|
|
132
|
+
} = render( /*#__PURE__*/React.createElement(Header, {
|
|
133
|
+
title: "Header Title",
|
|
134
|
+
getTitleChildren: () => /*#__PURE__*/React.createElement("div", null, "Title Child")
|
|
135
|
+
}));
|
|
136
|
+
expect(asFragment()).toMatchSnapshot();
|
|
137
|
+
});
|
|
138
|
+
test('renders Header with title, icon, and getTitleChildren function', () => {
|
|
139
|
+
const {
|
|
140
|
+
asFragment
|
|
141
|
+
} = render( /*#__PURE__*/React.createElement(Header, {
|
|
142
|
+
title: "Header Title",
|
|
143
|
+
iconName: "ZD-icon",
|
|
144
|
+
iconSize: "24",
|
|
145
|
+
getTitleChildren: () => /*#__PURE__*/React.createElement("div", null, "Title Child")
|
|
146
|
+
}));
|
|
147
|
+
expect(asFragment()).toMatchSnapshot();
|
|
148
|
+
});
|
|
149
|
+
test('renders Header with title, close button, and getTitleChildren function', () => {
|
|
150
|
+
const mockOnClose = jest.fn();
|
|
151
|
+
const {
|
|
152
|
+
asFragment
|
|
153
|
+
} = render( /*#__PURE__*/React.createElement(Header, {
|
|
154
|
+
title: "Header Title",
|
|
155
|
+
onClose: mockOnClose,
|
|
156
|
+
getTitleChildren: () => /*#__PURE__*/React.createElement("div", null, "Title Child")
|
|
157
|
+
}));
|
|
158
|
+
expect(asFragment()).toMatchSnapshot();
|
|
159
|
+
});
|
|
160
|
+
test('renders Header with title, icon, close button, and getTitleChildren function', () => {
|
|
161
|
+
const mockOnClose = jest.fn();
|
|
162
|
+
const {
|
|
163
|
+
asFragment
|
|
164
|
+
} = render( /*#__PURE__*/React.createElement(Header, {
|
|
165
|
+
title: "Header Title",
|
|
166
|
+
iconName: "ZD-icon",
|
|
167
|
+
iconSize: "24",
|
|
168
|
+
onClose: mockOnClose,
|
|
169
|
+
getTitleChildren: () => /*#__PURE__*/React.createElement("div", null, "Title Child")
|
|
170
|
+
}));
|
|
171
|
+
expect(asFragment()).toMatchSnapshot();
|
|
172
|
+
});
|
|
173
|
+
});
|
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
|
2
|
+
|
|
3
|
+
exports[`Content Component Snapshots renders Content with paddingSize - large 1`] = `
|
|
4
|
+
<DocumentFragment>
|
|
5
|
+
<div
|
|
6
|
+
class="largeContentPadding grow basis shrinkOff scrolly"
|
|
7
|
+
data-id="CardContent"
|
|
8
|
+
data-scroll="true"
|
|
9
|
+
data-selector-id="cardContent"
|
|
10
|
+
data-test-id="CardContent"
|
|
11
|
+
>
|
|
12
|
+
Content
|
|
13
|
+
</div>
|
|
14
|
+
</DocumentFragment>
|
|
15
|
+
`;
|
|
16
|
+
|
|
17
|
+
exports[`Content Component Snapshots renders Content with paddingSize - large and isVisible - false 1`] = `
|
|
18
|
+
<DocumentFragment>
|
|
19
|
+
<div
|
|
20
|
+
class="largeContentPadding grow basis shrinkOff scrolly"
|
|
21
|
+
data-id="CardContent"
|
|
22
|
+
data-scroll="true"
|
|
23
|
+
data-selector-id="cardContent"
|
|
24
|
+
data-test-id="CardContent"
|
|
25
|
+
>
|
|
26
|
+
Content
|
|
27
|
+
</div>
|
|
28
|
+
</DocumentFragment>
|
|
29
|
+
`;
|
|
30
|
+
|
|
31
|
+
exports[`Content Component Snapshots renders Content with paddingSize - large and isVisible - true 1`] = `
|
|
32
|
+
<DocumentFragment>
|
|
33
|
+
<div
|
|
34
|
+
class="largeContentPadding grow basis shrinkOff scrolly"
|
|
35
|
+
data-id="CardContent"
|
|
36
|
+
data-scroll="true"
|
|
37
|
+
data-selector-id="cardContent"
|
|
38
|
+
data-test-id="CardContent"
|
|
39
|
+
>
|
|
40
|
+
Content
|
|
41
|
+
</div>
|
|
42
|
+
</DocumentFragment>
|
|
43
|
+
`;
|
|
44
|
+
|
|
45
|
+
exports[`Content Component Snapshots renders Content with paddingSize - medium 1`] = `
|
|
46
|
+
<DocumentFragment>
|
|
47
|
+
<div
|
|
48
|
+
class="mediumContentPadding grow basis shrinkOff scrolly"
|
|
49
|
+
data-id="CardContent"
|
|
50
|
+
data-scroll="true"
|
|
51
|
+
data-selector-id="cardContent"
|
|
52
|
+
data-test-id="CardContent"
|
|
53
|
+
>
|
|
54
|
+
Content
|
|
55
|
+
</div>
|
|
56
|
+
</DocumentFragment>
|
|
57
|
+
`;
|
|
58
|
+
|
|
59
|
+
exports[`Content Component Snapshots renders Content with paddingSize - medium and isVisible - false 1`] = `
|
|
60
|
+
<DocumentFragment>
|
|
61
|
+
<div
|
|
62
|
+
class="mediumContentPadding grow basis shrinkOff scrolly"
|
|
63
|
+
data-id="CardContent"
|
|
64
|
+
data-scroll="true"
|
|
65
|
+
data-selector-id="cardContent"
|
|
66
|
+
data-test-id="CardContent"
|
|
67
|
+
>
|
|
68
|
+
Content
|
|
69
|
+
</div>
|
|
70
|
+
</DocumentFragment>
|
|
71
|
+
`;
|
|
72
|
+
|
|
73
|
+
exports[`Content Component Snapshots renders Content with paddingSize - medium and isVisible - true 1`] = `
|
|
74
|
+
<DocumentFragment>
|
|
75
|
+
<div
|
|
76
|
+
class="mediumContentPadding grow basis shrinkOff scrolly"
|
|
77
|
+
data-id="CardContent"
|
|
78
|
+
data-scroll="true"
|
|
79
|
+
data-selector-id="cardContent"
|
|
80
|
+
data-test-id="CardContent"
|
|
81
|
+
>
|
|
82
|
+
Content
|
|
83
|
+
</div>
|
|
84
|
+
</DocumentFragment>
|
|
85
|
+
`;
|
|
86
|
+
|
|
87
|
+
exports[`Content Component Snapshots renders Content with paddingSize - small 1`] = `
|
|
88
|
+
<DocumentFragment>
|
|
89
|
+
<div
|
|
90
|
+
class="smallContentPadding grow basis shrinkOff scrolly"
|
|
91
|
+
data-id="CardContent"
|
|
92
|
+
data-scroll="true"
|
|
93
|
+
data-selector-id="cardContent"
|
|
94
|
+
data-test-id="CardContent"
|
|
95
|
+
>
|
|
96
|
+
Content
|
|
97
|
+
</div>
|
|
98
|
+
</DocumentFragment>
|
|
99
|
+
`;
|
|
100
|
+
|
|
101
|
+
exports[`Content Component Snapshots renders Content with paddingSize - small and isVisible - false 1`] = `
|
|
102
|
+
<DocumentFragment>
|
|
103
|
+
<div
|
|
104
|
+
class="smallContentPadding grow basis shrinkOff scrolly"
|
|
105
|
+
data-id="CardContent"
|
|
106
|
+
data-scroll="true"
|
|
107
|
+
data-selector-id="cardContent"
|
|
108
|
+
data-test-id="CardContent"
|
|
109
|
+
>
|
|
110
|
+
Content
|
|
111
|
+
</div>
|
|
112
|
+
</DocumentFragment>
|
|
113
|
+
`;
|
|
114
|
+
|
|
115
|
+
exports[`Content Component Snapshots renders Content with paddingSize - small and isVisible - true 1`] = `
|
|
116
|
+
<DocumentFragment>
|
|
117
|
+
<div
|
|
118
|
+
class="smallContentPadding grow basis shrinkOff scrolly"
|
|
119
|
+
data-id="CardContent"
|
|
120
|
+
data-scroll="true"
|
|
121
|
+
data-selector-id="cardContent"
|
|
122
|
+
data-test-id="CardContent"
|
|
123
|
+
>
|
|
124
|
+
Content
|
|
125
|
+
</div>
|
|
126
|
+
</DocumentFragment>
|
|
127
|
+
`;
|