@lumx/react 3.3.1-alpha.0 → 3.3.1
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/_internal/ClickAwayProvider.js.map +1 -1
- package/_internal/types.d.ts +0 -2
- package/index.d.ts +2 -0
- package/index.js +347 -75
- package/index.js.map +1 -1
- package/package.json +23 -19
- package/src/components/autocomplete/Autocomplete.test.tsx +55 -142
- package/src/components/autocomplete/AutocompleteMultiple.test.tsx +37 -75
- package/src/components/autocomplete/__mockData__/index.ts +6 -1
- package/src/components/badge/Badge.test.tsx +20 -64
- package/src/components/button/Button.test.tsx +44 -121
- package/src/components/button/ButtonGroup.test.tsx +16 -39
- package/src/components/button/IconButton.stories.tsx +7 -0
- package/src/components/button/IconButton.test.tsx +37 -78
- package/src/components/button/IconButton.tsx +8 -1
- package/src/components/checkbox/Checkbox.test.tsx +62 -67
- package/src/components/chip/Chip.test.tsx +89 -139
- package/src/components/chip/ChipGroup.test.tsx +27 -10
- package/src/components/date-picker/DatePicker.test.tsx +15 -23
- package/src/components/date-picker/DatePickerControlled.test.tsx +24 -20
- package/src/components/date-picker/DatePickerField.test.tsx +43 -27
- package/src/components/dialog/Dialog.test.tsx +36 -35
- package/src/components/divider/Divider.test.tsx +23 -69
- package/src/components/dropdown/Dropdown.test.tsx +30 -61
- package/src/components/expansion-panel/ExpansionPanel.test.tsx +12 -8
- package/src/components/flag/Flag.test.tsx +28 -53
- package/src/components/generic-block/GenericBlock.test.tsx +93 -89
- package/src/components/grid-column/GridColumn.stories.tsx +3 -3
- package/src/components/icon/Icon.test.tsx +80 -64
- package/src/components/index.ts +0 -2
- package/src/components/inline-list/InlineList.test.tsx +30 -17
- package/src/components/input-helper/InputHelper.test.tsx +21 -81
- package/src/components/input-label/InputLabel.test.tsx +19 -61
- package/src/components/lightbox/Lightbox.test.tsx +3 -2
- package/src/components/link/Link.test.tsx +47 -31
- package/src/components/link-preview/LinkPreview.test.tsx +51 -51
- package/src/components/message/Message.test.tsx +31 -52
- package/src/components/mosaic/Mosaic.test.tsx +56 -72
- package/src/components/notification/Notification.test.tsx +51 -82
- package/src/components/popover/Popover.tsx +7 -9
- package/src/components/progress-tracker/ProgressTracker.test.tsx +20 -33
- package/src/components/progress-tracker/ProgressTrackerProvider.test.tsx +61 -36
- package/src/components/progress-tracker/ProgressTrackerStep.test.tsx +19 -109
- package/src/components/progress-tracker/ProgressTrackerStepPanel.test.tsx +21 -58
- package/src/components/progress-tracker/ProgressTrackerStepPanel.tsx +1 -1
- package/src/components/radio-button/RadioButton.test.tsx +78 -92
- package/src/components/radio-button/RadioGroup.test.tsx +13 -59
- package/src/components/select/Select.test.tsx +115 -284
- package/src/components/select/SelectMultiple.stories.tsx +105 -2
- package/src/components/select/SelectMultiple.test.tsx +126 -322
- package/src/components/select/WithSelectContext.tsx +10 -4
- package/src/components/side-navigation/SideNavigation.test.tsx +22 -35
- package/src/components/side-navigation/SideNavigationItem.test.tsx +72 -139
- package/src/components/switch/Switch.test.tsx +70 -149
- package/src/components/table/Table.test.tsx +2 -0
- package/src/components/table/TableBody.test.tsx +18 -8
- package/src/components/table/TableCell.test.tsx +34 -9
- package/src/components/table/TableHeader.test.tsx +18 -8
- package/src/components/table/TableRow.test.tsx +28 -8
- package/src/components/tabs/Tab.test.tsx +27 -96
- package/src/components/tabs/TabList.test.tsx +21 -56
- package/src/components/tabs/TabPanel.test.tsx +20 -55
- package/src/components/tabs/TabPanel.tsx +1 -1
- package/src/components/tabs/TabProvider.test.tsx +158 -37
- package/src/components/tabs/test-utils.ts +39 -0
- package/src/components/text-field/TextField.stories.tsx +14 -5
- package/src/components/text-field/TextField.test.tsx +54 -8
- package/src/components/text-field/TextField.tsx +49 -5
- package/src/components/tooltip/Tooltip.test.tsx +134 -75
- package/src/components/tooltip/useInjectTooltipRef.tsx +9 -2
- package/src/components/uploader/Uploader.test.tsx +60 -48
- package/src/components/user-block/UserBlock.test.tsx +69 -13
- package/src/hooks/useFocusTrap.ts +2 -2
- package/src/testing/utils/commonTestsSuiteRTL.ts +18 -8
- package/src/testing/utils/index.ts +0 -1
- package/src/utils/flattenChildren.ts +5 -0
- package/src/components/autocomplete/__snapshots__/Autocomplete.test.tsx.snap +0 -213
- package/src/components/autocomplete/__snapshots__/AutocompleteMultiple.test.tsx.snap +0 -88
- package/src/components/badge/__snapshots__/Badge.test.tsx.snap +0 -11
- package/src/components/button/ButtonRoot.test.tsx +0 -203
- package/src/components/button/__snapshots__/Button.test.tsx.snap +0 -96
- package/src/components/button/__snapshots__/ButtonGroup.test.tsx.snap +0 -22
- package/src/components/button/__snapshots__/ButtonRoot.test.tsx.snap +0 -160
- package/src/components/button/__snapshots__/IconButton.test.tsx.snap +0 -83
- package/src/components/checkbox/__snapshots__/Checkbox.test.tsx.snap +0 -141
- package/src/components/chip/__snapshots__/Chip.test.tsx.snap +0 -12
- package/src/components/chip/__snapshots__/ChipGroup.test.tsx.snap +0 -29
- package/src/components/date-picker/__snapshots__/DatePicker.test.tsx.snap +0 -22
- package/src/components/date-picker/__snapshots__/DatePickerControlled.test.tsx.snap +0 -597
- package/src/components/date-picker/__snapshots__/DatePickerField.test.tsx.snap +0 -43
- package/src/components/divider/__snapshots__/Divider.test.tsx.snap +0 -9
- package/src/components/dropdown/__snapshots__/Dropdown.test.tsx.snap +0 -35
- package/src/components/icon/__snapshots__/Icon.test.tsx.snap +0 -49
- package/src/components/input-helper/__snapshots__/InputHelper.test.tsx.snap +0 -9
- package/src/components/input-label/__snapshots__/InputLabel.test.tsx.snap +0 -10
- package/src/components/link/__snapshots__/Link.test.tsx.snap +0 -29
- package/src/components/message/__snapshots__/Message.test.tsx.snap +0 -15
- package/src/components/notification/__snapshots__/Notification.test.tsx.snap +0 -34
- package/src/components/progress-tracker/__snapshots__/ProgressTracker.test.tsx.snap +0 -41
- package/src/components/progress-tracker/__snapshots__/ProgressTrackerStep.test.tsx.snap +0 -141
- package/src/components/progress-tracker/__snapshots__/ProgressTrackerStepPanel.test.tsx.snap +0 -25
- package/src/components/radio-button/__snapshots__/RadioButton.test.tsx.snap +0 -113
- package/src/components/radio-button/__snapshots__/RadioGroup.test.tsx.snap +0 -26
- package/src/components/select/__snapshots__/Select.test.tsx.snap +0 -43
- package/src/components/select/__snapshots__/SelectMultiple.test.tsx.snap +0 -87
- package/src/components/side-navigation/__snapshots__/SideNavigation.test.tsx.snap +0 -7
- package/src/components/side-navigation/__snapshots__/SideNavigationItem.test.tsx.snap +0 -30
- package/src/components/switch/__snapshots__/Switch.test.tsx.snap +0 -179
- package/src/components/tabs/__snapshots__/Tab.test.tsx.snap +0 -62
- package/src/components/tabs/__snapshots__/TabList.test.tsx.snap +0 -22
- package/src/components/tabs/__snapshots__/TabPanel.test.tsx.snap +0 -25
- package/src/components/tabs/test.mocks.ts +0 -33
- package/src/components/text-field/__snapshots__/TextField.test.tsx.snap +0 -42
- package/src/components/tooltip/__snapshots__/Tooltip.test.tsx.snap +0 -233
- package/src/components/uploader/__snapshots__/Uploader.test.tsx.snap +0 -14
- package/src/testing/utils/commonTestsSuite.ts +0 -71
- package/src/utils/flattenChildren.test.tsx +0 -58
|
@@ -1,203 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
|
|
3
|
-
import { mount } from 'enzyme';
|
|
4
|
-
import 'jest-enzyme';
|
|
5
|
-
|
|
6
|
-
import { commonTestsSuite, Wrapper } from '@lumx/react/testing/utils';
|
|
7
|
-
|
|
8
|
-
import { ColorPalette, Emphasis, Size, Theme } from '@lumx/react';
|
|
9
|
-
import {
|
|
10
|
-
BUTTON_CLASSNAME,
|
|
11
|
-
BUTTON_WRAPPER_CLASSNAME,
|
|
12
|
-
ButtonRoot,
|
|
13
|
-
ButtonRootProps,
|
|
14
|
-
} from '@lumx/react/components/button/ButtonRoot';
|
|
15
|
-
import { getBasicClass } from '@lumx/react/utils/className';
|
|
16
|
-
|
|
17
|
-
type SetupProps = Partial<ButtonRootProps>;
|
|
18
|
-
|
|
19
|
-
/**
|
|
20
|
-
* Mounts the component and returns common DOM elements / data needed in multiple tests further down.
|
|
21
|
-
*/
|
|
22
|
-
const setup = (propsOverride: SetupProps = {}) => {
|
|
23
|
-
const props: any = { ...propsOverride };
|
|
24
|
-
const wrapper: Wrapper = mount(<ButtonRoot {...props} />);
|
|
25
|
-
|
|
26
|
-
return {
|
|
27
|
-
button: wrapper.find(`.${BUTTON_CLASSNAME}`),
|
|
28
|
-
buttonWrapper: wrapper.find(`.${BUTTON_WRAPPER_CLASSNAME}`),
|
|
29
|
-
props,
|
|
30
|
-
wrapper,
|
|
31
|
-
};
|
|
32
|
-
};
|
|
33
|
-
|
|
34
|
-
describe(`<${ButtonRoot.displayName}>`, () => {
|
|
35
|
-
// 1. Test render via snapshot (default states of component).
|
|
36
|
-
describe('Snapshots and structure', () => {
|
|
37
|
-
it('should render button with label', () => {
|
|
38
|
-
const props: Partial<ButtonRootProps> = {
|
|
39
|
-
children: 'Label',
|
|
40
|
-
};
|
|
41
|
-
const { button, buttonWrapper, wrapper } = setup(props);
|
|
42
|
-
expect(wrapper).toMatchSnapshot();
|
|
43
|
-
|
|
44
|
-
expect(buttonWrapper).not.toExist();
|
|
45
|
-
|
|
46
|
-
expect(button).toExist();
|
|
47
|
-
expect(button.type()).toEqual('button');
|
|
48
|
-
|
|
49
|
-
expect(button.contains(props.children)).toBe(true);
|
|
50
|
-
});
|
|
51
|
-
|
|
52
|
-
it('should render button with wrapper and label', () => {
|
|
53
|
-
const props: Partial<ButtonRootProps> = {
|
|
54
|
-
children: 'Label',
|
|
55
|
-
hasBackground: true,
|
|
56
|
-
};
|
|
57
|
-
const { button, buttonWrapper, wrapper } = setup(props);
|
|
58
|
-
expect(wrapper).toMatchSnapshot();
|
|
59
|
-
|
|
60
|
-
expect(buttonWrapper).toExist();
|
|
61
|
-
|
|
62
|
-
expect(button).toExist();
|
|
63
|
-
expect(button.type()).toEqual('button');
|
|
64
|
-
|
|
65
|
-
expect(button.contains(props.children)).toBe(true);
|
|
66
|
-
});
|
|
67
|
-
|
|
68
|
-
it('should render anchor button with label', () => {
|
|
69
|
-
const props: Partial<ButtonRootProps> = {
|
|
70
|
-
children: 'Label',
|
|
71
|
-
href: 'example.com',
|
|
72
|
-
target: '_blank',
|
|
73
|
-
};
|
|
74
|
-
const { button, buttonWrapper, wrapper } = setup(props);
|
|
75
|
-
expect(wrapper).toMatchSnapshot();
|
|
76
|
-
|
|
77
|
-
expect(buttonWrapper).not.toExist();
|
|
78
|
-
|
|
79
|
-
expect(button).toExist();
|
|
80
|
-
expect(button.type()).toEqual('a');
|
|
81
|
-
expect(button.contains(props.children)).toBe(true);
|
|
82
|
-
|
|
83
|
-
const actualProps = button.props() as Partial<ButtonRootProps>;
|
|
84
|
-
expect(actualProps.href).toEqual(props.href);
|
|
85
|
-
expect(actualProps.target).toEqual(props.target);
|
|
86
|
-
});
|
|
87
|
-
|
|
88
|
-
it('should render anchor button with wrapper and label', () => {
|
|
89
|
-
const props: Partial<ButtonRootProps> = {
|
|
90
|
-
children: 'Label',
|
|
91
|
-
hasBackground: true,
|
|
92
|
-
href: 'example.com',
|
|
93
|
-
target: '_blank',
|
|
94
|
-
};
|
|
95
|
-
const { button, buttonWrapper, wrapper } = setup(props);
|
|
96
|
-
expect(wrapper).toMatchSnapshot();
|
|
97
|
-
|
|
98
|
-
expect(buttonWrapper).toExist();
|
|
99
|
-
|
|
100
|
-
expect(button).toExist();
|
|
101
|
-
expect(button.type()).toEqual('a');
|
|
102
|
-
expect(button.contains(props.children)).toBe(true);
|
|
103
|
-
|
|
104
|
-
const actualProps = button.props() as Partial<ButtonRootProps>;
|
|
105
|
-
expect(actualProps.href).toEqual(props.href);
|
|
106
|
-
expect(actualProps.target).toEqual(props.target);
|
|
107
|
-
});
|
|
108
|
-
|
|
109
|
-
it('should render custom link', () => {
|
|
110
|
-
const CustomLink: React.FC = ({ children, ...props }) =>
|
|
111
|
-
React.createElement('a', { ...props, style: { color: 'red' } }, children);
|
|
112
|
-
const { wrapper } = setup({ href: 'foo', linkAs: CustomLink });
|
|
113
|
-
expect(wrapper).toMatchSnapshot();
|
|
114
|
-
});
|
|
115
|
-
});
|
|
116
|
-
|
|
117
|
-
// 2. Test defaultProps value and important props custom values.
|
|
118
|
-
describe('Props', () => {
|
|
119
|
-
it('should use default color', () => {
|
|
120
|
-
const props: Partial<ButtonRootProps> = {};
|
|
121
|
-
const { button, wrapper } = setup(props);
|
|
122
|
-
expect(wrapper).toMatchSnapshot();
|
|
123
|
-
|
|
124
|
-
expect(button).toExist();
|
|
125
|
-
expect(button).toHaveClassName(
|
|
126
|
-
getBasicClass({ prefix: BUTTON_CLASSNAME, type: 'color', value: ColorPalette.dark }),
|
|
127
|
-
);
|
|
128
|
-
});
|
|
129
|
-
|
|
130
|
-
it('should not have default color in low or medium emphasis', () => {
|
|
131
|
-
const props: Partial<ButtonRootProps> = {
|
|
132
|
-
emphasis: Emphasis.low,
|
|
133
|
-
};
|
|
134
|
-
const { button, wrapper } = setup(props);
|
|
135
|
-
expect(wrapper).toMatchSnapshot();
|
|
136
|
-
|
|
137
|
-
expect(button).not.toHaveClassName(
|
|
138
|
-
getBasicClass({ prefix: BUTTON_CLASSNAME, type: 'color', value: ColorPalette.primary }),
|
|
139
|
-
);
|
|
140
|
-
});
|
|
141
|
-
|
|
142
|
-
it('should use given props', () => {
|
|
143
|
-
// Props used for the button.
|
|
144
|
-
const buttonProps: Partial<ButtonRootProps> = {
|
|
145
|
-
color: ColorPalette.red,
|
|
146
|
-
emphasis: Emphasis.high,
|
|
147
|
-
size: Size.s,
|
|
148
|
-
theme: Theme.dark,
|
|
149
|
-
variant: 'icon',
|
|
150
|
-
};
|
|
151
|
-
// Props used for the button wrapper.
|
|
152
|
-
const buttonWrapperProps: Partial<ButtonRootProps> = {
|
|
153
|
-
variant: buttonProps.variant,
|
|
154
|
-
};
|
|
155
|
-
const { button, buttonWrapper, wrapper } = setup({
|
|
156
|
-
...buttonProps,
|
|
157
|
-
hasBackground: true,
|
|
158
|
-
});
|
|
159
|
-
expect(wrapper).toMatchSnapshot();
|
|
160
|
-
|
|
161
|
-
// The button wrapper classes.
|
|
162
|
-
for (const [type, value] of Object.entries(buttonProps)) {
|
|
163
|
-
expect(button).toHaveClassName(getBasicClass({ prefix: BUTTON_CLASSNAME, type, value }));
|
|
164
|
-
}
|
|
165
|
-
|
|
166
|
-
// The button wrapper classes.
|
|
167
|
-
for (const [type, value] of Object.entries(buttonWrapperProps)) {
|
|
168
|
-
expect(buttonWrapper).toHaveClassName(getBasicClass({ prefix: BUTTON_WRAPPER_CLASSNAME, type, value }));
|
|
169
|
-
}
|
|
170
|
-
});
|
|
171
|
-
|
|
172
|
-
it('should be full width', () => {
|
|
173
|
-
const buttonProps: Partial<ButtonRootProps> = {
|
|
174
|
-
fullWidth: true,
|
|
175
|
-
emphasis: Emphasis.high,
|
|
176
|
-
theme: Theme.light,
|
|
177
|
-
};
|
|
178
|
-
|
|
179
|
-
const { wrapper, button } = setup(buttonProps);
|
|
180
|
-
expect(wrapper).toMatchSnapshot();
|
|
181
|
-
|
|
182
|
-
expect(button).toHaveClassName(getBasicClass({ prefix: BUTTON_CLASSNAME, type: 'fullWidth', value: true }));
|
|
183
|
-
});
|
|
184
|
-
});
|
|
185
|
-
|
|
186
|
-
// 3. Test events.
|
|
187
|
-
describe('Events', () => {
|
|
188
|
-
// Nothing to do here.
|
|
189
|
-
});
|
|
190
|
-
|
|
191
|
-
// 4. Test conditions (i.e. things that display or not in the UI based on props).
|
|
192
|
-
describe('Conditions', () => {
|
|
193
|
-
// Tested in step 1.
|
|
194
|
-
});
|
|
195
|
-
|
|
196
|
-
// 5. Test state.
|
|
197
|
-
describe('State', () => {
|
|
198
|
-
// Nothing to do here.
|
|
199
|
-
});
|
|
200
|
-
|
|
201
|
-
// Common tests suite.
|
|
202
|
-
commonTestsSuite(setup, { className: 'button', prop: 'button' }, { className: BUTTON_CLASSNAME });
|
|
203
|
-
});
|
|
@@ -1,96 +0,0 @@
|
|
|
1
|
-
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
|
2
|
-
|
|
3
|
-
exports[`<Button> Props should forward any CSS class 1`] = `
|
|
4
|
-
<ButtonRoot
|
|
5
|
-
className="component component--is-tested"
|
|
6
|
-
emphasis="high"
|
|
7
|
-
size="m"
|
|
8
|
-
theme="light"
|
|
9
|
-
variant="button"
|
|
10
|
-
/>
|
|
11
|
-
`;
|
|
12
|
-
|
|
13
|
-
exports[`<Button> Props should use the given props for class names 1`] = `
|
|
14
|
-
<ButtonRoot
|
|
15
|
-
className="lumx-button--has-left-icon lumx-button--has-right-icon"
|
|
16
|
-
emphasis="high"
|
|
17
|
-
size="m"
|
|
18
|
-
theme="light"
|
|
19
|
-
variant="button"
|
|
20
|
-
>
|
|
21
|
-
<Icon
|
|
22
|
-
icon="M7.41,8.58L12,13.17L16.59,8.58L18,10L12,16L6,10L7.41,8.58Z"
|
|
23
|
-
/>
|
|
24
|
-
<Icon
|
|
25
|
-
icon="M19,13H13V19H11V13H5V11H11V5H13V11H19V13Z"
|
|
26
|
-
/>
|
|
27
|
-
</ButtonRoot>
|
|
28
|
-
`;
|
|
29
|
-
|
|
30
|
-
exports[`<Button> Snapshots and structure should render button with label 1`] = `
|
|
31
|
-
<ButtonRoot
|
|
32
|
-
className=""
|
|
33
|
-
emphasis="high"
|
|
34
|
-
size="m"
|
|
35
|
-
theme="light"
|
|
36
|
-
variant="button"
|
|
37
|
-
>
|
|
38
|
-
<span>
|
|
39
|
-
Label
|
|
40
|
-
</span>
|
|
41
|
-
</ButtonRoot>
|
|
42
|
-
`;
|
|
43
|
-
|
|
44
|
-
exports[`<Button> Snapshots and structure should render button with label and icons 1`] = `
|
|
45
|
-
<ButtonRoot
|
|
46
|
-
className="lumx-button--has-left-icon lumx-button--has-right-icon"
|
|
47
|
-
emphasis="high"
|
|
48
|
-
size="m"
|
|
49
|
-
theme="light"
|
|
50
|
-
variant="button"
|
|
51
|
-
>
|
|
52
|
-
<Icon
|
|
53
|
-
icon="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"
|
|
54
|
-
/>
|
|
55
|
-
<span>
|
|
56
|
-
Label
|
|
57
|
-
</span>
|
|
58
|
-
<Icon
|
|
59
|
-
icon="M7.41,8.58L12,13.17L16.59,8.58L18,10L12,16L6,10L7.41,8.58Z"
|
|
60
|
-
/>
|
|
61
|
-
</ButtonRoot>
|
|
62
|
-
`;
|
|
63
|
-
|
|
64
|
-
exports[`<Button> Snapshots and structure should render button with label and left icon 1`] = `
|
|
65
|
-
<ButtonRoot
|
|
66
|
-
className="lumx-button--has-left-icon"
|
|
67
|
-
emphasis="high"
|
|
68
|
-
size="m"
|
|
69
|
-
theme="light"
|
|
70
|
-
variant="button"
|
|
71
|
-
>
|
|
72
|
-
<Icon
|
|
73
|
-
icon="M7.41,8.58L12,13.17L16.59,8.58L18,10L12,16L6,10L7.41,8.58Z"
|
|
74
|
-
/>
|
|
75
|
-
<span>
|
|
76
|
-
Label
|
|
77
|
-
</span>
|
|
78
|
-
</ButtonRoot>
|
|
79
|
-
`;
|
|
80
|
-
|
|
81
|
-
exports[`<Button> Snapshots and structure should render button with label and right icon 1`] = `
|
|
82
|
-
<ButtonRoot
|
|
83
|
-
className="lumx-button--has-right-icon"
|
|
84
|
-
emphasis="high"
|
|
85
|
-
size="m"
|
|
86
|
-
theme="light"
|
|
87
|
-
variant="button"
|
|
88
|
-
>
|
|
89
|
-
<span>
|
|
90
|
-
Label
|
|
91
|
-
</span>
|
|
92
|
-
<Icon
|
|
93
|
-
icon="M7.41,8.58L12,13.17L16.59,8.58L18,10L12,16L6,10L7.41,8.58Z"
|
|
94
|
-
/>
|
|
95
|
-
</ButtonRoot>
|
|
96
|
-
`;
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
|
2
|
-
|
|
3
|
-
exports[`<ButtonGroup> Snapshots and structure should render correctly a group button 1`] = `
|
|
4
|
-
<div
|
|
5
|
-
className="lumx-button-group"
|
|
6
|
-
>
|
|
7
|
-
<Button
|
|
8
|
-
emphasis="high"
|
|
9
|
-
size="m"
|
|
10
|
-
theme="light"
|
|
11
|
-
>
|
|
12
|
-
Label
|
|
13
|
-
</Button>
|
|
14
|
-
<IconButton
|
|
15
|
-
emphasis="high"
|
|
16
|
-
icon="M19,13H13V19H11V13H5V11H11V5H13V11H19V13Z"
|
|
17
|
-
label="Add"
|
|
18
|
-
size="m"
|
|
19
|
-
theme="light"
|
|
20
|
-
/>
|
|
21
|
-
</div>
|
|
22
|
-
`;
|
|
@@ -1,160 +0,0 @@
|
|
|
1
|
-
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
|
2
|
-
|
|
3
|
-
exports[`<ButtonRoot> Props should be full width 1`] = `
|
|
4
|
-
<ButtonRoot
|
|
5
|
-
emphasis="high"
|
|
6
|
-
fullWidth={true}
|
|
7
|
-
theme="light"
|
|
8
|
-
>
|
|
9
|
-
<button
|
|
10
|
-
className="lumx-button lumx-button--color-primary lumx-button--emphasis-high lumx-button--theme-light lumx-button--is-full-width"
|
|
11
|
-
type="button"
|
|
12
|
-
/>
|
|
13
|
-
</ButtonRoot>
|
|
14
|
-
`;
|
|
15
|
-
|
|
16
|
-
exports[`<ButtonRoot> Props should not have default color in low or medium emphasis 1`] = `
|
|
17
|
-
<ButtonRoot
|
|
18
|
-
emphasis="low"
|
|
19
|
-
>
|
|
20
|
-
<button
|
|
21
|
-
className="lumx-button lumx-button--color-dark lumx-button--emphasis-low"
|
|
22
|
-
type="button"
|
|
23
|
-
/>
|
|
24
|
-
</ButtonRoot>
|
|
25
|
-
`;
|
|
26
|
-
|
|
27
|
-
exports[`<ButtonRoot> Props should use default color 1`] = `
|
|
28
|
-
<ButtonRoot>
|
|
29
|
-
<button
|
|
30
|
-
className="lumx-button lumx-button--color-dark"
|
|
31
|
-
type="button"
|
|
32
|
-
/>
|
|
33
|
-
</ButtonRoot>
|
|
34
|
-
`;
|
|
35
|
-
|
|
36
|
-
exports[`<ButtonRoot> Props should use given props 1`] = `
|
|
37
|
-
<ButtonRoot
|
|
38
|
-
color="red"
|
|
39
|
-
emphasis="high"
|
|
40
|
-
hasBackground={true}
|
|
41
|
-
size="s"
|
|
42
|
-
theme="dark"
|
|
43
|
-
variant="icon"
|
|
44
|
-
>
|
|
45
|
-
<div
|
|
46
|
-
className="lumx-button-wrapper lumx-button-wrapper--variant-icon"
|
|
47
|
-
>
|
|
48
|
-
<ButtonRoot
|
|
49
|
-
color="red"
|
|
50
|
-
emphasis="high"
|
|
51
|
-
hasBackground={false}
|
|
52
|
-
size="s"
|
|
53
|
-
theme="dark"
|
|
54
|
-
variant="icon"
|
|
55
|
-
>
|
|
56
|
-
<button
|
|
57
|
-
className="lumx-button lumx-button--color-red lumx-button--emphasis-high lumx-button--size-s lumx-button--theme-dark lumx-button--variant-icon"
|
|
58
|
-
type="button"
|
|
59
|
-
/>
|
|
60
|
-
</ButtonRoot>
|
|
61
|
-
</div>
|
|
62
|
-
</ButtonRoot>
|
|
63
|
-
`;
|
|
64
|
-
|
|
65
|
-
exports[`<ButtonRoot> Snapshots and structure should render anchor button with label 1`] = `
|
|
66
|
-
<ButtonRoot
|
|
67
|
-
href="example.com"
|
|
68
|
-
target="_blank"
|
|
69
|
-
>
|
|
70
|
-
<a
|
|
71
|
-
className="lumx-button lumx-button--color-dark"
|
|
72
|
-
href="example.com"
|
|
73
|
-
target="_blank"
|
|
74
|
-
>
|
|
75
|
-
Label
|
|
76
|
-
</a>
|
|
77
|
-
</ButtonRoot>
|
|
78
|
-
`;
|
|
79
|
-
|
|
80
|
-
exports[`<ButtonRoot> Snapshots and structure should render anchor button with wrapper and label 1`] = `
|
|
81
|
-
<ButtonRoot
|
|
82
|
-
hasBackground={true}
|
|
83
|
-
href="example.com"
|
|
84
|
-
target="_blank"
|
|
85
|
-
>
|
|
86
|
-
<div
|
|
87
|
-
className="lumx-button-wrapper"
|
|
88
|
-
>
|
|
89
|
-
<ButtonRoot
|
|
90
|
-
color="dark"
|
|
91
|
-
hasBackground={false}
|
|
92
|
-
href="example.com"
|
|
93
|
-
target="_blank"
|
|
94
|
-
>
|
|
95
|
-
<a
|
|
96
|
-
className="lumx-button lumx-button--color-dark"
|
|
97
|
-
href="example.com"
|
|
98
|
-
target="_blank"
|
|
99
|
-
>
|
|
100
|
-
Label
|
|
101
|
-
</a>
|
|
102
|
-
</ButtonRoot>
|
|
103
|
-
</div>
|
|
104
|
-
</ButtonRoot>
|
|
105
|
-
`;
|
|
106
|
-
|
|
107
|
-
exports[`<ButtonRoot> Snapshots and structure should render button with label 1`] = `
|
|
108
|
-
<ButtonRoot>
|
|
109
|
-
<button
|
|
110
|
-
className="lumx-button lumx-button--color-dark"
|
|
111
|
-
type="button"
|
|
112
|
-
>
|
|
113
|
-
Label
|
|
114
|
-
</button>
|
|
115
|
-
</ButtonRoot>
|
|
116
|
-
`;
|
|
117
|
-
|
|
118
|
-
exports[`<ButtonRoot> Snapshots and structure should render button with wrapper and label 1`] = `
|
|
119
|
-
<ButtonRoot
|
|
120
|
-
hasBackground={true}
|
|
121
|
-
>
|
|
122
|
-
<div
|
|
123
|
-
className="lumx-button-wrapper"
|
|
124
|
-
>
|
|
125
|
-
<ButtonRoot
|
|
126
|
-
color="dark"
|
|
127
|
-
hasBackground={false}
|
|
128
|
-
>
|
|
129
|
-
<button
|
|
130
|
-
className="lumx-button lumx-button--color-dark"
|
|
131
|
-
type="button"
|
|
132
|
-
>
|
|
133
|
-
Label
|
|
134
|
-
</button>
|
|
135
|
-
</ButtonRoot>
|
|
136
|
-
</div>
|
|
137
|
-
</ButtonRoot>
|
|
138
|
-
`;
|
|
139
|
-
|
|
140
|
-
exports[`<ButtonRoot> Snapshots and structure should render custom link 1`] = `
|
|
141
|
-
<ButtonRoot
|
|
142
|
-
href="foo"
|
|
143
|
-
linkAs={[Function]}
|
|
144
|
-
>
|
|
145
|
-
<CustomLink
|
|
146
|
-
className="lumx-button lumx-button--color-dark"
|
|
147
|
-
href="foo"
|
|
148
|
-
>
|
|
149
|
-
<a
|
|
150
|
-
className="lumx-button lumx-button--color-dark"
|
|
151
|
-
href="foo"
|
|
152
|
-
style={
|
|
153
|
-
{
|
|
154
|
-
"color": "red",
|
|
155
|
-
}
|
|
156
|
-
}
|
|
157
|
-
/>
|
|
158
|
-
</CustomLink>
|
|
159
|
-
</ButtonRoot>
|
|
160
|
-
`;
|
|
@@ -1,83 +0,0 @@
|
|
|
1
|
-
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
|
2
|
-
|
|
3
|
-
exports[`<IconButton> Props should forward any CSS class 1`] = `
|
|
4
|
-
<Tooltip
|
|
5
|
-
placement="bottom"
|
|
6
|
-
>
|
|
7
|
-
<ButtonRoot
|
|
8
|
-
className="component component--is-tested"
|
|
9
|
-
emphasis="high"
|
|
10
|
-
size="m"
|
|
11
|
-
theme="light"
|
|
12
|
-
variant="icon"
|
|
13
|
-
>
|
|
14
|
-
<Icon />
|
|
15
|
-
</ButtonRoot>
|
|
16
|
-
</Tooltip>
|
|
17
|
-
`;
|
|
18
|
-
|
|
19
|
-
exports[`<IconButton> Props should use default props 1`] = `
|
|
20
|
-
<Tooltip
|
|
21
|
-
placement="bottom"
|
|
22
|
-
>
|
|
23
|
-
<ButtonRoot
|
|
24
|
-
emphasis="high"
|
|
25
|
-
size="m"
|
|
26
|
-
theme="light"
|
|
27
|
-
variant="icon"
|
|
28
|
-
>
|
|
29
|
-
<Icon />
|
|
30
|
-
</ButtonRoot>
|
|
31
|
-
</Tooltip>
|
|
32
|
-
`;
|
|
33
|
-
|
|
34
|
-
exports[`<IconButton> Snapshots and structure should render icon button 1`] = `
|
|
35
|
-
<Tooltip
|
|
36
|
-
placement="bottom"
|
|
37
|
-
>
|
|
38
|
-
<ButtonRoot
|
|
39
|
-
emphasis="high"
|
|
40
|
-
size="m"
|
|
41
|
-
theme="light"
|
|
42
|
-
variant="icon"
|
|
43
|
-
>
|
|
44
|
-
<Icon />
|
|
45
|
-
</ButtonRoot>
|
|
46
|
-
</Tooltip>
|
|
47
|
-
`;
|
|
48
|
-
|
|
49
|
-
exports[`<IconButton> Snapshots and structure should render icon button with an image 1`] = `
|
|
50
|
-
<Tooltip
|
|
51
|
-
placement="bottom"
|
|
52
|
-
>
|
|
53
|
-
<ButtonRoot
|
|
54
|
-
emphasis="high"
|
|
55
|
-
size="m"
|
|
56
|
-
theme="light"
|
|
57
|
-
variant="icon"
|
|
58
|
-
>
|
|
59
|
-
<img
|
|
60
|
-
alt=""
|
|
61
|
-
src="http://foo.com"
|
|
62
|
-
/>
|
|
63
|
-
</ButtonRoot>
|
|
64
|
-
</Tooltip>
|
|
65
|
-
`;
|
|
66
|
-
|
|
67
|
-
exports[`<IconButton> Snapshots and structure should render icon button with an image if both props are set 1`] = `
|
|
68
|
-
<Tooltip
|
|
69
|
-
placement="bottom"
|
|
70
|
-
>
|
|
71
|
-
<ButtonRoot
|
|
72
|
-
emphasis="high"
|
|
73
|
-
size="m"
|
|
74
|
-
theme="light"
|
|
75
|
-
variant="icon"
|
|
76
|
-
>
|
|
77
|
-
<img
|
|
78
|
-
alt=""
|
|
79
|
-
src="http://foo.com"
|
|
80
|
-
/>
|
|
81
|
-
</ButtonRoot>
|
|
82
|
-
</Tooltip>
|
|
83
|
-
`;
|
|
@@ -1,141 +0,0 @@
|
|
|
1
|
-
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
|
2
|
-
|
|
3
|
-
exports[`<Checkbox> Props should use the given props 1`] = `
|
|
4
|
-
<div
|
|
5
|
-
className="lumx-checkbox lumx-checkbox--is-unchecked lumx-checkbox--theme-light"
|
|
6
|
-
>
|
|
7
|
-
<div
|
|
8
|
-
className="lumx-checkbox__input-wrapper"
|
|
9
|
-
>
|
|
10
|
-
<input
|
|
11
|
-
aria-describedby="fixedId-helper"
|
|
12
|
-
className="lumx-checkbox__input-native"
|
|
13
|
-
id="fixedId"
|
|
14
|
-
onChange={[Function]}
|
|
15
|
-
tabIndex={0}
|
|
16
|
-
type="checkbox"
|
|
17
|
-
/>
|
|
18
|
-
<div
|
|
19
|
-
className="lumx-checkbox__input-placeholder"
|
|
20
|
-
>
|
|
21
|
-
<div
|
|
22
|
-
className="lumx-checkbox__input-background"
|
|
23
|
-
/>
|
|
24
|
-
<div
|
|
25
|
-
className="lumx-checkbox__input-indicator"
|
|
26
|
-
>
|
|
27
|
-
<Icon
|
|
28
|
-
icon="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"
|
|
29
|
-
/>
|
|
30
|
-
</div>
|
|
31
|
-
</div>
|
|
32
|
-
</div>
|
|
33
|
-
<div
|
|
34
|
-
className="lumx-checkbox__content"
|
|
35
|
-
>
|
|
36
|
-
<InputLabel
|
|
37
|
-
className="lumx-checkbox__label"
|
|
38
|
-
htmlFor="fixedId"
|
|
39
|
-
theme="light"
|
|
40
|
-
>
|
|
41
|
-
Test label
|
|
42
|
-
</InputLabel>
|
|
43
|
-
<InputHelper
|
|
44
|
-
className="lumx-checkbox__helper"
|
|
45
|
-
id="fixedId-helper"
|
|
46
|
-
kind="info"
|
|
47
|
-
theme="light"
|
|
48
|
-
>
|
|
49
|
-
Test helper
|
|
50
|
-
</InputHelper>
|
|
51
|
-
</div>
|
|
52
|
-
</div>
|
|
53
|
-
`;
|
|
54
|
-
|
|
55
|
-
exports[`<Checkbox> Props should use the given props while passing custom props to input 1`] = `
|
|
56
|
-
<div
|
|
57
|
-
className="lumx-checkbox lumx-checkbox--is-unchecked lumx-checkbox--theme-light"
|
|
58
|
-
>
|
|
59
|
-
<div
|
|
60
|
-
className="lumx-checkbox__input-wrapper"
|
|
61
|
-
>
|
|
62
|
-
<input
|
|
63
|
-
aria-describedby="fixedId-helper"
|
|
64
|
-
aria-labelledby="labelledby-id"
|
|
65
|
-
className="lumx-checkbox__input-native"
|
|
66
|
-
id="fixedId"
|
|
67
|
-
onChange={[Function]}
|
|
68
|
-
tabIndex={0}
|
|
69
|
-
type="checkbox"
|
|
70
|
-
/>
|
|
71
|
-
<div
|
|
72
|
-
className="lumx-checkbox__input-placeholder"
|
|
73
|
-
>
|
|
74
|
-
<div
|
|
75
|
-
className="lumx-checkbox__input-background"
|
|
76
|
-
/>
|
|
77
|
-
<div
|
|
78
|
-
className="lumx-checkbox__input-indicator"
|
|
79
|
-
>
|
|
80
|
-
<Icon
|
|
81
|
-
icon="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"
|
|
82
|
-
/>
|
|
83
|
-
</div>
|
|
84
|
-
</div>
|
|
85
|
-
</div>
|
|
86
|
-
<div
|
|
87
|
-
className="lumx-checkbox__content"
|
|
88
|
-
>
|
|
89
|
-
<InputLabel
|
|
90
|
-
className="lumx-checkbox__label"
|
|
91
|
-
htmlFor="fixedId"
|
|
92
|
-
theme="light"
|
|
93
|
-
>
|
|
94
|
-
Test label
|
|
95
|
-
</InputLabel>
|
|
96
|
-
<InputHelper
|
|
97
|
-
className="lumx-checkbox__helper"
|
|
98
|
-
id="fixedId-helper"
|
|
99
|
-
kind="info"
|
|
100
|
-
theme="light"
|
|
101
|
-
>
|
|
102
|
-
Test helper
|
|
103
|
-
</InputHelper>
|
|
104
|
-
</div>
|
|
105
|
-
</div>
|
|
106
|
-
`;
|
|
107
|
-
|
|
108
|
-
exports[`<Checkbox> Snapshots and structure should render correctly 1`] = `
|
|
109
|
-
<div
|
|
110
|
-
className="lumx-checkbox lumx-checkbox--is-unchecked lumx-checkbox--theme-light"
|
|
111
|
-
>
|
|
112
|
-
<div
|
|
113
|
-
className="lumx-checkbox__input-wrapper"
|
|
114
|
-
>
|
|
115
|
-
<input
|
|
116
|
-
className="lumx-checkbox__input-native"
|
|
117
|
-
id="fixedId"
|
|
118
|
-
onChange={[Function]}
|
|
119
|
-
tabIndex={0}
|
|
120
|
-
type="checkbox"
|
|
121
|
-
/>
|
|
122
|
-
<div
|
|
123
|
-
className="lumx-checkbox__input-placeholder"
|
|
124
|
-
>
|
|
125
|
-
<div
|
|
126
|
-
className="lumx-checkbox__input-background"
|
|
127
|
-
/>
|
|
128
|
-
<div
|
|
129
|
-
className="lumx-checkbox__input-indicator"
|
|
130
|
-
>
|
|
131
|
-
<Icon
|
|
132
|
-
icon="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"
|
|
133
|
-
/>
|
|
134
|
-
</div>
|
|
135
|
-
</div>
|
|
136
|
-
</div>
|
|
137
|
-
<div
|
|
138
|
-
className="lumx-checkbox__content"
|
|
139
|
-
/>
|
|
140
|
-
</div>
|
|
141
|
-
`;
|