@dxc-technology/halstack-react 0.0.0-b3da1a9 → 0.0.0-b3de035

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.
Files changed (51) hide show
  1. package/dist/ThemeContext.js +7 -7
  2. package/dist/V3Select/V3Select.js +549 -0
  3. package/dist/V3Select/index.d.ts +27 -0
  4. package/dist/V3Textarea/index.d.ts +27 -0
  5. package/dist/accordion/index.d.ts +28 -0
  6. package/dist/accordion-group/index.d.ts +16 -0
  7. package/dist/box/index.d.ts +25 -0
  8. package/dist/button/index.d.ts +24 -0
  9. package/dist/card/index.d.ts +22 -0
  10. package/dist/checkbox/index.d.ts +24 -0
  11. package/dist/chip/index.d.ts +22 -0
  12. package/dist/common/variables.js +125 -129
  13. package/dist/date/Date.js +6 -6
  14. package/dist/date/index.d.ts +27 -0
  15. package/dist/dialog/index.d.ts +18 -0
  16. package/dist/dropdown/index.d.ts +26 -0
  17. package/dist/file-input/FileItem.js +8 -1
  18. package/dist/file-input/index.d.ts +1 -1
  19. package/dist/footer/index.d.ts +25 -0
  20. package/dist/header/index.d.ts +25 -0
  21. package/dist/heading/index.d.ts +17 -0
  22. package/dist/input-text/index.d.ts +36 -0
  23. package/dist/link/index.d.ts +23 -0
  24. package/dist/main.d.ts +36 -4
  25. package/dist/main.js +8 -8
  26. package/dist/paginator/Paginator.js +3 -3
  27. package/dist/paginator/index.d.ts +20 -0
  28. package/dist/password-input/PasswordInput.js +6 -1
  29. package/dist/progress-bar/index.d.ts +18 -0
  30. package/dist/radio/index.d.ts +23 -0
  31. package/dist/resultsetTable/index.d.ts +19 -0
  32. package/dist/select/Select.js +822 -302
  33. package/dist/{new-select → select}/index.d.ts +1 -1
  34. package/dist/sidenav/index.d.ts +13 -0
  35. package/dist/slider/index.d.ts +29 -0
  36. package/dist/spinner/index.d.ts +17 -0
  37. package/dist/switch/index.d.ts +24 -0
  38. package/dist/table/index.d.ts +13 -0
  39. package/dist/tabs/index.d.ts +19 -0
  40. package/dist/tag/index.d.ts +24 -0
  41. package/dist/text-input/TextInput.js +3 -0
  42. package/dist/toggle/index.d.ts +21 -0
  43. package/dist/toggle-group/index.d.ts +21 -0
  44. package/dist/upload/Upload.js +3 -3
  45. package/dist/upload/index.d.ts +15 -0
  46. package/dist/wizard/index.d.ts +18 -0
  47. package/package.json +1 -1
  48. package/test/Date.test.js +34 -36
  49. package/test/Upload.test.js +4 -4
  50. package/test/{Select.test.js → V3Select.test.js} +12 -12
  51. package/dist/new-select/NewSelect.js +0 -1085
@@ -50,4 +50,4 @@ type Props = {
50
50
  ref?: React.RefObject<HTMLDivElement>;
51
51
  };
52
52
 
53
- export default function DxcNewSelect(props: Props): JSX.Element;
53
+ export default function DxcSelect(props: Props): JSX.Element;
@@ -0,0 +1,13 @@
1
+ type Space = "xxsmall" | "xsmall" | "small" | "medium" | "large" | "xlarge" | "xxlarge";
2
+ type Padding = {
3
+ top?: Space;
4
+ bottom?: Space;
5
+ left?: Space;
6
+ right?: Space;
7
+ };
8
+
9
+ type Props = {
10
+ padding?: Space | Padding;
11
+ };
12
+
13
+ export default function DxcSidenav(props: Props): JSX.Element;
@@ -0,0 +1,29 @@
1
+ type Size = "small" | "medium" | "large" | "fillParent";
2
+ type Space = "xxsmall" | "xsmall" | "small" | "medium" | "large" | "xlarge" | "xxlarge";
3
+ type Margin = {
4
+ top?: Space;
5
+ bottom?: Space;
6
+ left?: Space;
7
+ right?: Space;
8
+ };
9
+
10
+ type Props = {
11
+ label?: string;
12
+ helperText?: string;
13
+ minValue?: number;
14
+ maxValue?: number;
15
+ step?: number;
16
+ value?: number;
17
+ showLimitsValues?: boolean;
18
+ showInput?: boolean;
19
+ name?: string;
20
+ onChange?: void;
21
+ onDragEnd?: void;
22
+ disabled?: boolean;
23
+ marks?: boolean;
24
+ labelFormatCallback?: void;
25
+ margin?: Space | Margin;
26
+ size?: Size;
27
+ };
28
+
29
+ export default function DxcSlider(props: Props): JSX.Element;
@@ -0,0 +1,17 @@
1
+ type Space = "xxsmall" | "xsmall" | "small" | "medium" | "large" | "xlarge" | "xxlarge";
2
+ type Margin = {
3
+ top?: Space;
4
+ bottom?: Space;
5
+ left?: Space;
6
+ right?: Space;
7
+ };
8
+
9
+ type Props = {
10
+ label?: string;
11
+ value?: number;
12
+ showValue?: boolean;
13
+ mode?: "large" | "small" | "overlay";
14
+ margin?: Space | Margin;
15
+ };
16
+
17
+ export default function DxcSpinner(props: Props): JSX.Element;
@@ -0,0 +1,24 @@
1
+ type Size = "small" | "medium" | "large" | "fillParent" | "fitContent";
2
+ type Space = "xxsmall" | "xsmall" | "small" | "medium" | "large" | "xlarge" | "xxlarge";
3
+ type Margin = {
4
+ top?: Space;
5
+ bottom?: Space;
6
+ left?: Space;
7
+ right?: Space;
8
+ };
9
+
10
+ type Props = {
11
+ checked?: boolean;
12
+ value?: any;
13
+ label?: string;
14
+ labelPosition?: "before" | "after";
15
+ name?: string,
16
+ disabled?: boolean;
17
+ onChange?: void;
18
+ required?: boolean;
19
+ margin?: Space | Margin;
20
+ size?: Size;
21
+ tabIndex?: number;
22
+ };
23
+
24
+ export default function DxcSwitch(props: Props): JSX.Element;
@@ -0,0 +1,13 @@
1
+ type Space = "xxsmall" | "xsmall" | "small" | "medium" | "large" | "xlarge" | "xxlarge";
2
+ type Margin = {
3
+ top?: Space;
4
+ bottom?: Space;
5
+ left?: Space;
6
+ right?: Space;
7
+ };
8
+
9
+ type Props = {
10
+ margin?: Space | Margin;
11
+ };
12
+
13
+ export default function DxcTable(props: Props): JSX.Element;
@@ -0,0 +1,19 @@
1
+ type Space = "xxsmall" | "xsmall" | "small" | "medium" | "large" | "xlarge" | "xxlarge";
2
+ type Margin = {
3
+ top?: Space;
4
+ bottom?: Space;
5
+ left?: Space;
6
+ right?: Space;
7
+ };
8
+
9
+ type Props = {
10
+ activeTabIndex?: number;
11
+ tabs?: any;
12
+ onTabClick?: void;
13
+ onTabHover?: void;
14
+ iconPosition?: "top" | "left";
15
+ margin?: Space | Margin;
16
+ tabIndex?: number;
17
+ };
18
+
19
+ export default function DxcTabs(props: Props): JSX.Element;
@@ -0,0 +1,24 @@
1
+ type Size = "small" | "medium" | "large" | "fillParent" | "fitContent";
2
+ type Space = "xxsmall" | "xsmall" | "small" | "medium" | "large" | "xlarge" | "xxlarge";
3
+ type Margin = {
4
+ top?: Space;
5
+ bottom?: Space;
6
+ left?: Space;
7
+ right?: Space;
8
+ };
9
+
10
+ type Props = {
11
+ icon?: any;
12
+ iconSrc?: string;
13
+ label?: string;
14
+ linkHref?: string;
15
+ onClick?: void,
16
+ iconBgColor?: string;
17
+ labelPosition?: "before" | "after";
18
+ newWindow?: boolean;
19
+ margin?: Space | Margin;
20
+ size?: Size;
21
+ tabIndex?: number;
22
+ };
23
+
24
+ export default function DxcTag(props: Props): JSX.Element;
@@ -243,6 +243,8 @@ var patternMatch = function patternMatch(pattern, value) {
243
243
  };
244
244
 
245
245
  var DxcTextInput = _react["default"].forwardRef(function (_ref, ref) {
246
+ var _action$title;
247
+
246
248
  var _ref$label = _ref.label,
247
249
  label = _ref$label === void 0 ? "" : _ref$label,
248
250
  _ref$name = _ref.name,
@@ -745,6 +747,7 @@ var DxcTextInput = _react["default"].forwardRef(function (_ref, ref) {
745
747
  ref: actionRef,
746
748
  disabled: disabled,
747
749
  onClick: action.onClick,
750
+ title: (_action$title = action.title) !== null && _action$title !== void 0 ? _action$title : action.title,
748
751
  backgroundType: backgroundType,
749
752
  tabIndex: tabIndex
750
753
  }, typeof action.icon === "string" ? _react["default"].createElement(ActionIcon, {
@@ -0,0 +1,21 @@
1
+ type Space = "xxsmall" | "xsmall" | "small" | "medium" | "large" | "xlarge" | "xxlarge";
2
+ type Margin = {
3
+ top?: Space;
4
+ bottom?: Space;
5
+ left?: Space;
6
+ right?: Space;
7
+ };
8
+
9
+ type Props = {
10
+ label?: string;
11
+ helperText?: string;
12
+ value?: any;
13
+ onChange?: void;
14
+ disabled?: boolean,
15
+ options?: any;
16
+ multiple?: boolean;
17
+ margin?: Space | Margin;
18
+ tabIndex?: number;
19
+ };
20
+
21
+ export default function DxcToggle(props: Props): JSX.Element;
@@ -0,0 +1,21 @@
1
+ type Space = "xxsmall" | "xsmall" | "small" | "medium" | "large" | "xlarge" | "xxlarge";
2
+ type Margin = {
3
+ top?: Space;
4
+ bottom?: Space;
5
+ left?: Space;
6
+ right?: Space;
7
+ };
8
+
9
+ type Props = {
10
+ label?: string;
11
+ helperText?: string;
12
+ value?: any;
13
+ onChange?: void;
14
+ disabled?: boolean;
15
+ options?: any;
16
+ multiple?: boolean;
17
+ margin?: Space | Margin;
18
+ tabIndex?: number;
19
+ };
20
+
21
+ export default function DxcToggleGroup(props: Props): JSX.Element;
@@ -41,7 +41,7 @@ function _templateObject() {
41
41
  return data;
42
42
  }
43
43
 
44
- var V3DxcUpload = function V3DxcUpload(_ref) {
44
+ var DxcUpload = function DxcUpload(_ref) {
45
45
  var callbackUpload = _ref.callbackUpload,
46
46
  margin = _ref.margin,
47
47
  _ref$tabIndex = _ref.tabIndex,
@@ -178,7 +178,7 @@ var V3DxcUpload = function V3DxcUpload(_ref) {
178
178
  }));
179
179
  };
180
180
 
181
- V3DxcUpload.propTypes = {
181
+ DxcUpload.propTypes = {
182
182
  callbackUpload: _propTypes["default"].func,
183
183
  margin: _propTypes["default"].oneOfType([_propTypes["default"].shape({
184
184
  top: _propTypes["default"].oneOf(Object.keys(_variables.spaces)),
@@ -201,5 +201,5 @@ var DXCUpload = _styledComponents["default"].div(_templateObject(), function (pr
201
201
  return props.margin && (0, _typeof2["default"])(props.margin) === "object" && props.margin.left ? _variables.spaces[props.margin.left] : "";
202
202
  });
203
203
 
204
- var _default = V3DxcUpload;
204
+ var _default = DxcUpload;
205
205
  exports["default"] = _default;
@@ -0,0 +1,15 @@
1
+ type Space = "xxsmall" | "xsmall" | "small" | "medium" | "large" | "xlarge" | "xxlarge";
2
+ type Margin = {
3
+ top?: Space;
4
+ bottom?: Space;
5
+ left?: Space;
6
+ right?: Space;
7
+ };
8
+
9
+ type Props = {
10
+ callbackUpload?: void;
11
+ margin?: Space | Margin;
12
+ tabIndex?: number;
13
+ };
14
+
15
+ export default function DxcUpload(props: Props): JSX.Element;
@@ -0,0 +1,18 @@
1
+ type Space = "xxsmall" | "xsmall" | "small" | "medium" | "large" | "xlarge" | "xxlarge";
2
+ type Margin = {
3
+ top?: Space;
4
+ bottom?: Space;
5
+ left?: Space;
6
+ right?: Space;
7
+ };
8
+
9
+ type Props = {
10
+ mode?: "horizontal" | "vertical";
11
+ currentStep?: number;
12
+ onStepClick?: void;
13
+ steps?: any;
14
+ margin?: Space | Margin;
15
+ tabIndex?: number;
16
+ };
17
+
18
+ export default function DxcWizard(props: Props): JSX.Element;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dxc-technology/halstack-react",
3
- "version": "0.0.0-b3da1a9",
3
+ "version": "0.0.0-b3de035",
4
4
  "description": "DXC Halstack React components library",
5
5
  "repository": "dxc-technology/halstack-react",
6
6
  "homepage": "http://developer.dxc.com/tools/react",
package/test/Date.test.js CHANGED
@@ -1,12 +1,12 @@
1
1
  import React from "react";
2
2
  import { render, fireEvent } from "@testing-library/react";
3
- import V3DxcDate from "../src/date/Date";
3
+ import DxcDate from "../src/date/Date";
4
4
 
5
5
  const defaultFormat = "DD-MM-YYYY";
6
6
 
7
7
  describe("Date component general tests", () => {
8
8
  test("Date renders correctly", () => {
9
- const { getByPlaceholderText } = render(<V3DxcDate label="Birthdate" placeholder />);
9
+ const { getByPlaceholderText } = render(<DxcDate label="Birthdate" placeholder />);
10
10
  // const input = getByPlaceholderText('DD-MM-YYYY');
11
11
  expect(getByPlaceholderText(defaultFormat)).toBeTruthy();
12
12
  });
@@ -22,19 +22,19 @@ describe("Controlled Date Component", () => {
22
22
  });
23
23
 
24
24
  const { getByRole, getByPlaceholderText, rerender } = render(
25
- <V3DxcDate label="Birthdate" value="30-03-1981" onChange={onChange} placeholder />
25
+ <DxcDate label="Birthdate" value="30-03-1981" onChange={onChange} placeholder />
26
26
  );
27
27
  const input = getByPlaceholderText(defaultFormat);
28
28
 
29
29
  fireEvent.change(input, { target: { value: "something" } });
30
30
  expect(onChange).toHaveBeenCalled();
31
31
  fireEvent.blur(input);
32
- rerender(<V3DxcDate label="Birthdate" value="" placeholder />);
32
+ rerender(<DxcDate label="Birthdate" value="" placeholder />);
33
33
  // expect(getByRole("textbox").value).toBe('');
34
34
  });
35
35
 
36
36
  test("The input´s value is the same as the one received as a parameter (Default format)", () => {
37
- const { getByRole, getByPlaceholderText } = render(<V3DxcDate label="Birthdate" value="30/03/1981" placeholder />);
37
+ const { getByRole, getByPlaceholderText } = render(<DxcDate label="Birthdate" value="30/03/1981" placeholder />);
38
38
  // const input = getByRole("textbox");
39
39
  const input = getByPlaceholderText(defaultFormat);
40
40
  expect(input.value).toBe("30/03/1981");
@@ -42,7 +42,7 @@ describe("Controlled Date Component", () => {
42
42
 
43
43
  test("The input´s value is the same as the one received as a parameter (Custom format)", () => {
44
44
  const { getByRole, getByPlaceholderText } = render(
45
- <V3DxcDate label="Birthdate" format="dd/MM/yy" value="30/03/81" placeholder />
45
+ <DxcDate label="Birthdate" format="dd/MM/yy" value="30/03/81" placeholder />
46
46
  );
47
47
  // const input = getByRole("textbox");
48
48
  const input = getByPlaceholderText("DD/MM/YY");
@@ -50,20 +50,20 @@ describe("Controlled Date Component", () => {
50
50
  });
51
51
 
52
52
  test("Calendar´s value is the same as the input´s date if it´s right (Depending on the format)", () => {
53
- const { getByRole, getByText, getByTestId } = render(<V3DxcDate label="Birthdate" value="16-10-2020" />);
53
+ const { getByRole, getByText, getByTestId } = render(<DxcDate label="Birthdate" value="16-10-2020" />);
54
54
  fireEvent.click(getByTestId("calendarIcon"));
55
55
  expect(getByText("Fri, Oct 16")).toBeTruthy();
56
56
  });
57
57
 
58
58
  test("Calendar´s value is the same as the input´s date if it´s right after changing the input value", () => {
59
59
  const { getByRole, getByText, rerender, getByPlaceholderText, getByTestId } = render(
60
- <V3DxcDate label="Birthdate" value="30-03-1981" placeholder />
60
+ <DxcDate label="Birthdate" value="30-03-1981" placeholder />
61
61
  );
62
62
  // const input = getByRole("textbox");
63
63
  const input = getByPlaceholderText(defaultFormat);
64
64
  fireEvent.change(input, { target: { value: "10-02-2020" } });
65
65
 
66
- rerender(<V3DxcDate label="Birthdate" value="10-02-2020" />);
66
+ rerender(<DxcDate label="Birthdate" value="10-02-2020" />);
67
67
  const calendarButton = getByTestId("calendarIcon");
68
68
  fireEvent.click(calendarButton);
69
69
  expect(getByText("Mon, Feb 10")).toBeTruthy();
@@ -76,7 +76,7 @@ describe("Controlled Date Component", () => {
76
76
  });
77
77
 
78
78
  const { getByRole, getByPlaceholderText } = render(
79
- <V3DxcDate label="Birthdate" value="30-03-1981" onChange={onChange} placeholder />
79
+ <DxcDate label="Birthdate" value="30-03-1981" onChange={onChange} placeholder />
80
80
  );
81
81
  // const input = getByRole("textbox");
82
82
  const input = getByPlaceholderText(defaultFormat);
@@ -92,7 +92,7 @@ describe("Controlled Date Component", () => {
92
92
  });
93
93
 
94
94
  const { getByRole, getByPlaceholderText } = render(
95
- <V3DxcDate label="Birthdate" value="30-03-1981" onChange={onChange} placeholder />
95
+ <DxcDate label="Birthdate" value="30-03-1981" onChange={onChange} placeholder />
96
96
  );
97
97
  // const input = getByRole("textbox");
98
98
  const input = getByPlaceholderText(defaultFormat);
@@ -107,7 +107,7 @@ describe("Controlled Date Component", () => {
107
107
  });
108
108
 
109
109
  const { getByRole, getByPlaceholderText } = render(
110
- <V3DxcDate label="Birthdate" format="dd-MM-yy" value="30-03-81" onChange={onChange} placeholder />
110
+ <DxcDate label="Birthdate" format="dd-MM-yy" value="30-03-81" onChange={onChange} placeholder />
111
111
  );
112
112
  // const input = getByRole("textbox");
113
113
  const input = getByPlaceholderText("DD-MM-YY");
@@ -123,7 +123,7 @@ describe("Controlled Date Component", () => {
123
123
  });
124
124
 
125
125
  const { getByRole, getByPlaceholderText } = render(
126
- <V3DxcDate label="Birthdate" value="30-03-1981" onChange={onChange} placeholder />
126
+ <DxcDate label="Birthdate" value="30-03-1981" onChange={onChange} placeholder />
127
127
  );
128
128
  // const input = getByRole("textbox");
129
129
  const input = getByPlaceholderText(defaultFormat);
@@ -139,7 +139,7 @@ describe("Controlled Date Component", () => {
139
139
  });
140
140
 
141
141
  const { getByRole, getByPlaceholderText } = render(
142
- <V3DxcDate label="Birthdate" value="03/30/1981" format="MM/dd/yyyy" onChange={onChange} placeholder />
142
+ <DxcDate label="Birthdate" value="03/30/1981" format="MM/dd/yyyy" onChange={onChange} placeholder />
143
143
  );
144
144
  // const input = getByRole("textbox");
145
145
  const input = getByPlaceholderText("MM/DD/YYYY");
@@ -151,7 +151,7 @@ describe("Controlled Date Component", () => {
151
151
  test("onChange function is called when the user selects from the calendar", () => {
152
152
  const onChange = jest.fn();
153
153
 
154
- const component = render(<V3DxcDate label="Birthdate" value="01-02-2020" onChange={onChange} />);
154
+ const component = render(<DxcDate label="Birthdate" value="01-02-2020" onChange={onChange} />);
155
155
  const calendarButton = component.getByTestId("calendarIcon");
156
156
  fireEvent.click(calendarButton);
157
157
  const dayButton = component.getByRole("button", { name: "10" });
@@ -165,7 +165,7 @@ describe("Controlled Date Component", () => {
165
165
  expect(returnedValue.dateValue.getTime()).toBe(date.getTime());
166
166
  });
167
167
 
168
- const component = render(<V3DxcDate label="Birthdate" value="30-10-2020" onChange={onChange} />);
168
+ const component = render(<DxcDate label="Birthdate" value="30-10-2020" onChange={onChange} />);
169
169
  const calendarButton = component.getByTestId("calendarIcon");
170
170
  fireEvent.click(calendarButton);
171
171
  const dayButton = component.getByRole("button", { name: "16" });
@@ -178,7 +178,7 @@ describe("Controlled Date Component", () => {
178
178
  expect(returnedValue.stringValue).toBe("16-10-2020");
179
179
  });
180
180
 
181
- const component = render(<V3DxcDate label="Birthdate" value="01-10-2020" onChange={onChange} />);
181
+ const component = render(<DxcDate label="Birthdate" value="01-10-2020" onChange={onChange} />);
182
182
  const calendarButton = component.getByTestId("calendarIcon");
183
183
  fireEvent.click(calendarButton);
184
184
  const dayButton = component.getByRole("button", { name: "16" });
@@ -191,9 +191,7 @@ describe("Controlled Date Component", () => {
191
191
  expect(returnedValue.stringValue).toBe("2020/10/16");
192
192
  });
193
193
 
194
- const component = render(
195
- <V3DxcDate label="Birthdate" format="yyyy/MM/dd" value="2020/10/01" onChange={onChange} />
196
- );
194
+ const component = render(<DxcDate label="Birthdate" format="yyyy/MM/dd" value="2020/10/01" onChange={onChange} />);
197
195
  const calendarButton = component.getByTestId("calendarIcon");
198
196
  fireEvent.click(calendarButton);
199
197
  const dayButton = component.getByRole("button", { name: "16" });
@@ -202,7 +200,7 @@ describe("Controlled Date Component", () => {
202
200
  });
203
201
 
204
202
  test("Check selected date on calendar is the same date as the one on the input", () => {
205
- const component = render(<V3DxcDate label="Birthdate" value="01-10-2020" />);
203
+ const component = render(<DxcDate label="Birthdate" value="01-10-2020" />);
206
204
  const calendarButton = component.getByTestId("calendarIcon");
207
205
  fireEvent.click(calendarButton);
208
206
  const dayButton = component.getByRole("button", { name: "1" });
@@ -211,7 +209,7 @@ describe("Controlled Date Component", () => {
211
209
  test("onBlur function is called", () => {
212
210
  const onBlur = jest.fn();
213
211
  const { getByRole, getByPlaceholderText } = render(
214
- <V3DxcDate label="Birthdate" value="30-03-81" onBlur={onBlur} placeholder />
212
+ <DxcDate label="Birthdate" value="30-03-81" onBlur={onBlur} placeholder />
215
213
  );
216
214
  // const input = getByRole("textbox");
217
215
  const input = getByPlaceholderText(defaultFormat);
@@ -224,7 +222,7 @@ describe("Controlled Date Component", () => {
224
222
  expect(returnedValue).toBe("30-03-81");
225
223
  });
226
224
  const { getByRole, getByPlaceholderText } = render(
227
- <V3DxcDate label="Birthdate" value="30-03-81" onBlur={onBlur} placeholder />
225
+ <DxcDate label="Birthdate" value="30-03-81" onBlur={onBlur} placeholder />
228
226
  );
229
227
  // const input = getByRole("textbox");
230
228
  const input = getByPlaceholderText(defaultFormat);
@@ -237,7 +235,7 @@ describe("Controlled Date Component", () => {
237
235
  expect(returnedValue).toBe("30/03/81");
238
236
  });
239
237
  const { getByRole, getByPlaceholderText } = render(
240
- <V3DxcDate label="Birthdate" format="dd/MM/yy" value="30/03/81" onBlur={onBlur} placeholder />
238
+ <DxcDate label="Birthdate" format="dd/MM/yy" value="30/03/81" onBlur={onBlur} placeholder />
241
239
  );
242
240
  // const input = getByRole("textbox");
243
241
  const input = getByPlaceholderText("DD/MM/YY");
@@ -252,14 +250,14 @@ describe("Uncontrolled Date Component", () => {
252
250
 
253
251
  test("Calendar´s value is the same as the input´s date if it´s right after changing the input value", () => {
254
252
  const { getByRole, getByText, rerender, getByPlaceholderText, getByTestId } = render(
255
- <V3DxcDate label="Birthdate" placeholder />
253
+ <DxcDate label="Birthdate" placeholder />
256
254
  );
257
255
  // const input = getByRole("textbox");
258
256
  const input = getByPlaceholderText(defaultFormat);
259
257
 
260
258
  fireEvent.change(input, { target: { value: "10-02-2020" } });
261
259
 
262
- rerender(<V3DxcDate label="Birthdate" value="10-02-2020" />);
260
+ rerender(<DxcDate label="Birthdate" value="10-02-2020" />);
263
261
  const calendarButton = getByTestId("calendarIcon");
264
262
  fireEvent.click(calendarButton);
265
263
  expect(getByText("Mon, Feb 10")).toBeTruthy();
@@ -271,7 +269,7 @@ describe("Uncontrolled Date Component", () => {
271
269
  expect(returnedValue.stringValue).toBe("something");
272
270
  });
273
271
 
274
- const { getByRole, getByPlaceholderText } = render(<V3DxcDate label="Birthdate" onChange={onChange} placeholder />);
272
+ const { getByRole, getByPlaceholderText } = render(<DxcDate label="Birthdate" onChange={onChange} placeholder />);
275
273
  // const input = getByRole("textbox");
276
274
  const input = getByPlaceholderText(defaultFormat);
277
275
 
@@ -284,7 +282,7 @@ describe("Uncontrolled Date Component", () => {
284
282
  expect(returnedValue.stringValue).toBe("16-10-2020");
285
283
  });
286
284
 
287
- const { getByRole, getByPlaceholderText } = render(<V3DxcDate label="Birthdate" onChange={onChange} placeholder />);
285
+ const { getByRole, getByPlaceholderText } = render(<DxcDate label="Birthdate" onChange={onChange} placeholder />);
288
286
  // const input = getByRole("textbox");
289
287
  const input = getByPlaceholderText(defaultFormat);
290
288
 
@@ -298,7 +296,7 @@ describe("Uncontrolled Date Component", () => {
298
296
  });
299
297
 
300
298
  const { getByRole, getByPlaceholderText } = render(
301
- <V3DxcDate label="Birthdate" format="dd-MM-yy" onChange={onChange} placeholder />
299
+ <DxcDate label="Birthdate" format="dd-MM-yy" onChange={onChange} placeholder />
302
300
  );
303
301
  // const input = getByRole("textbox");
304
302
  const input = getByPlaceholderText("DD-MM-YY");
@@ -313,7 +311,7 @@ describe("Uncontrolled Date Component", () => {
313
311
  expect(returnedValue.stringValue).toBe("11-15-2020");
314
312
  });
315
313
 
316
- const { getByRole, getByPlaceholderText } = render(<V3DxcDate label="Birthdate" onChange={onChange} placeholder />);
314
+ const { getByRole, getByPlaceholderText } = render(<DxcDate label="Birthdate" onChange={onChange} placeholder />);
317
315
  // const input = getByRole("textbox");
318
316
  const input = getByPlaceholderText(defaultFormat);
319
317
 
@@ -328,7 +326,7 @@ describe("Uncontrolled Date Component", () => {
328
326
  });
329
327
 
330
328
  const { getByRole, getByPlaceholderText } = render(
331
- <V3DxcDate label="Birthdate" format="MM/dd/yyyy" onChange={onChange} placeholder />
329
+ <DxcDate label="Birthdate" format="MM/dd/yyyy" onChange={onChange} placeholder />
332
330
  );
333
331
  // const input = getByRole("textbox");
334
332
  const input = getByPlaceholderText("MM/DD/YYYY");
@@ -339,7 +337,7 @@ describe("Uncontrolled Date Component", () => {
339
337
  test("onChange function is called when the user selects from the calendar", () => {
340
338
  const onChange = jest.fn();
341
339
 
342
- const component = render(<V3DxcDate label="Birthdate" onChange={onChange} />);
340
+ const component = render(<DxcDate label="Birthdate" onChange={onChange} />);
343
341
  const calendarButton = component.getByTestId("calendarIcon");
344
342
  fireEvent.click(calendarButton);
345
343
  const dayButton = component.getByRole("button", { name: "10" });
@@ -349,7 +347,7 @@ describe("Uncontrolled Date Component", () => {
349
347
  });
350
348
 
351
349
  test("Check selected date on calendar is the same date as the one on the input", () => {
352
- const component = render(<V3DxcDate label="Birthdate" placeholder />);
350
+ const component = render(<DxcDate label="Birthdate" placeholder />);
353
351
  // const input = component.getByRole("textbox");
354
352
  const input = component.getByPlaceholderText(defaultFormat);
355
353
 
@@ -361,7 +359,7 @@ describe("Uncontrolled Date Component", () => {
361
359
  });
362
360
  test("onBlur function is called", () => {
363
361
  const onBlur = jest.fn();
364
- const { getByRole, getByPlaceholderText } = render(<V3DxcDate label="Birthdate" onBlur={onBlur} placeholder />);
362
+ const { getByRole, getByPlaceholderText } = render(<DxcDate label="Birthdate" onBlur={onBlur} placeholder />);
365
363
  // const input = getByRole("textbox");
366
364
  const input = getByPlaceholderText(defaultFormat);
367
365
 
@@ -372,7 +370,7 @@ describe("Uncontrolled Date Component", () => {
372
370
  const onBlur = jest.fn((returnedValue) => {
373
371
  expect(returnedValue).toBe("10-02-2020");
374
372
  });
375
- const { getByRole, getByPlaceholderText } = render(<V3DxcDate label="Birthdate" onBlur={onBlur} placeholder />);
373
+ const { getByRole, getByPlaceholderText } = render(<DxcDate label="Birthdate" onBlur={onBlur} placeholder />);
376
374
  // const input = getByRole("textbox");
377
375
  const input = getByPlaceholderText("DD-MM-YYYY");
378
376
 
@@ -385,7 +383,7 @@ describe("Uncontrolled Date Component", () => {
385
383
  expect(returnedValue).toBe("10/02/20");
386
384
  });
387
385
  const { getByRole, getByPlaceholderText } = render(
388
- <V3DxcDate label="Birthdate" format="dd/MM/yy" onBlur={onBlur} placeholder />
386
+ <DxcDate label="Birthdate" format="dd/MM/yy" onBlur={onBlur} placeholder />
389
387
  );
390
388
  // const input = getByRole("textbox");
391
389
  const input = getByPlaceholderText("DD/MM/YY");
@@ -1,10 +1,10 @@
1
1
  import React from "react";
2
2
  import { render, fireEvent, act, createEvent } from "@testing-library/react";
3
- import V3DxcUpload from "../src/upload/Upload";
3
+ import DxcUpload from "../src/upload/Upload";
4
4
 
5
5
  describe("Upload component tests", () => {
6
6
  test("Upload renders with correct text", () => {
7
- const { getByText } = render(<V3DxcUpload margin="small"></V3DxcUpload>);
7
+ const { getByText } = render(<DxcUpload margin="small"></DxcUpload>);
8
8
  expect(getByText("There are no files to upload")).toBeTruthy();
9
9
  expect(getByText("Drag and drop your files here or choose one from your computer")).toBeTruthy();
10
10
  expect(getByText("CHOOSE FILES")).toBeTruthy();
@@ -12,7 +12,7 @@ describe("Upload component tests", () => {
12
12
 
13
13
  test("Upload shows file information", () => {
14
14
  const myfunction = jest.fn();
15
- const { getByText } = render(<V3DxcUpload margin="small"></V3DxcUpload>);
15
+ const { getByText } = render(<DxcUpload margin="small"></DxcUpload>);
16
16
 
17
17
  const dropZone = getByText("There are no files to upload");
18
18
  const dropEvent = createEvent.drop(dropZone);
@@ -36,7 +36,7 @@ describe("Upload component tests", () => {
36
36
  test("Calls correct function callbackUpload", () => {
37
37
  const onCallbackUpload = jest.fn(() => new Promise((resolve) => setTimeout(resolve, 1000)));
38
38
  const myfunction = jest.fn();
39
- const { getByText } = render(<V3DxcUpload margin="small" callbackUpload={onCallbackUpload}></V3DxcUpload>);
39
+ const { getByText } = render(<DxcUpload margin="small" callbackUpload={onCallbackUpload}></DxcUpload>);
40
40
 
41
41
  const dropZone = getByText("There are no files to upload");
42
42
  const dropEvent = createEvent.drop(dropZone);