@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.
- package/dist/ThemeContext.js +7 -7
- package/dist/V3Select/V3Select.js +549 -0
- package/dist/V3Select/index.d.ts +27 -0
- package/dist/V3Textarea/index.d.ts +27 -0
- package/dist/accordion/index.d.ts +28 -0
- package/dist/accordion-group/index.d.ts +16 -0
- package/dist/box/index.d.ts +25 -0
- package/dist/button/index.d.ts +24 -0
- package/dist/card/index.d.ts +22 -0
- package/dist/checkbox/index.d.ts +24 -0
- package/dist/chip/index.d.ts +22 -0
- package/dist/common/variables.js +125 -129
- package/dist/date/Date.js +6 -6
- package/dist/date/index.d.ts +27 -0
- package/dist/dialog/index.d.ts +18 -0
- package/dist/dropdown/index.d.ts +26 -0
- package/dist/file-input/FileItem.js +8 -1
- package/dist/file-input/index.d.ts +1 -1
- package/dist/footer/index.d.ts +25 -0
- package/dist/header/index.d.ts +25 -0
- package/dist/heading/index.d.ts +17 -0
- package/dist/input-text/index.d.ts +36 -0
- package/dist/link/index.d.ts +23 -0
- package/dist/main.d.ts +36 -4
- package/dist/main.js +8 -8
- package/dist/paginator/Paginator.js +3 -3
- package/dist/paginator/index.d.ts +20 -0
- package/dist/password-input/PasswordInput.js +6 -1
- package/dist/progress-bar/index.d.ts +18 -0
- package/dist/radio/index.d.ts +23 -0
- package/dist/resultsetTable/index.d.ts +19 -0
- package/dist/select/Select.js +822 -302
- package/dist/{new-select → select}/index.d.ts +1 -1
- package/dist/sidenav/index.d.ts +13 -0
- package/dist/slider/index.d.ts +29 -0
- package/dist/spinner/index.d.ts +17 -0
- package/dist/switch/index.d.ts +24 -0
- package/dist/table/index.d.ts +13 -0
- package/dist/tabs/index.d.ts +19 -0
- package/dist/tag/index.d.ts +24 -0
- package/dist/text-input/TextInput.js +3 -0
- package/dist/toggle/index.d.ts +21 -0
- package/dist/toggle-group/index.d.ts +21 -0
- package/dist/upload/Upload.js +3 -3
- package/dist/upload/index.d.ts +15 -0
- package/dist/wizard/index.d.ts +18 -0
- package/package.json +1 -1
- package/test/Date.test.js +34 -36
- package/test/Upload.test.js +4 -4
- package/test/{Select.test.js → V3Select.test.js} +12 -12
- package/dist/new-select/NewSelect.js +0 -1085
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import { render, act } from "@testing-library/react";
|
|
3
3
|
import userEvent from "@testing-library/user-event";
|
|
4
|
-
import
|
|
4
|
+
import V3DxcSelect from "../src/V3Select/V3Select";
|
|
5
5
|
|
|
6
6
|
const optionsWithoutIcon = [
|
|
7
7
|
{
|
|
@@ -63,13 +63,13 @@ const optionsWithIcons = [
|
|
|
63
63
|
|
|
64
64
|
describe("Select component tests", () => {
|
|
65
65
|
test("Select renders with correct label", () => {
|
|
66
|
-
const { getByText } = render(<
|
|
66
|
+
const { getByText } = render(<V3DxcSelect label="test-select-label"></V3DxcSelect>);
|
|
67
67
|
expect(getByText("test-select-label")).toBeTruthy();
|
|
68
68
|
});
|
|
69
69
|
|
|
70
70
|
test("Select renders options when select is clicked", () => {
|
|
71
71
|
const { getByText, getByRole, queryByText } = render(
|
|
72
|
-
<
|
|
72
|
+
<V3DxcSelect label="test-select-name" options={optionsWithoutIcon}></V3DxcSelect>
|
|
73
73
|
);
|
|
74
74
|
//Before are not shown
|
|
75
75
|
expect(queryByText("Amazon")).toBeFalsy();
|
|
@@ -86,7 +86,7 @@ describe("Select component tests", () => {
|
|
|
86
86
|
|
|
87
87
|
test("Select renders options with icons before", () => {
|
|
88
88
|
const { getByRole, getByTestId } = render(
|
|
89
|
-
<
|
|
89
|
+
<V3DxcSelect label="test-select-name" options={optionsWithIcons}></V3DxcSelect>
|
|
90
90
|
);
|
|
91
91
|
const select = getByRole("button");
|
|
92
92
|
act(() => {
|
|
@@ -98,7 +98,7 @@ describe("Select component tests", () => {
|
|
|
98
98
|
|
|
99
99
|
test("Select renders options with icons after", () => {
|
|
100
100
|
const { getByRole, getByTestId } = render(
|
|
101
|
-
<
|
|
101
|
+
<V3DxcSelect label="test-select-name" options={optionsWithIcons} iconPosition="after"></V3DxcSelect>
|
|
102
102
|
);
|
|
103
103
|
const select = getByRole("button");
|
|
104
104
|
act(() => {
|
|
@@ -110,21 +110,21 @@ describe("Select component tests", () => {
|
|
|
110
110
|
|
|
111
111
|
test("Select renders with a default value", () => {
|
|
112
112
|
const { getByText } = render(
|
|
113
|
-
<
|
|
113
|
+
<V3DxcSelect label="test-select-name" options={optionsWithoutIcon} value={1}></V3DxcSelect>
|
|
114
114
|
);
|
|
115
115
|
expect(getByText("Amazon")).toBeTruthy();
|
|
116
116
|
});
|
|
117
117
|
|
|
118
118
|
test("Select renders with multiple default values", () => {
|
|
119
119
|
const { getByText } = render(
|
|
120
|
-
<
|
|
120
|
+
<V3DxcSelect label="test-select-name" options={optionsWithoutIcon} value={[1, 2]} multiple></V3DxcSelect>
|
|
121
121
|
);
|
|
122
122
|
expect(getByText("Amazon, Ebay")).toBeTruthy();
|
|
123
123
|
});
|
|
124
124
|
|
|
125
125
|
test("Disabled select is not clickable", () => {
|
|
126
126
|
const { getByText, queryByText } = render(
|
|
127
|
-
<
|
|
127
|
+
<V3DxcSelect label="test-select-name" options={optionsWithoutIcon} disabled></V3DxcSelect>
|
|
128
128
|
);
|
|
129
129
|
expect(queryByText("Amazon")).toBeFalsy();
|
|
130
130
|
expect(queryByText("Ebay")).toBeFalsy();
|
|
@@ -141,7 +141,7 @@ describe("Select component tests", () => {
|
|
|
141
141
|
test("Controlled select with unique value", () => {
|
|
142
142
|
const onChange = jest.fn();
|
|
143
143
|
const { getByText, getAllByText } = render(
|
|
144
|
-
<
|
|
144
|
+
<V3DxcSelect label="test-select-name" options={optionsWithoutIcon} value={1} onChange={onChange}></V3DxcSelect>
|
|
145
145
|
);
|
|
146
146
|
const select = getByText("Amazon");
|
|
147
147
|
act(() => {
|
|
@@ -159,13 +159,13 @@ describe("Select component tests", () => {
|
|
|
159
159
|
test("Controlled select with multiple values", () => {
|
|
160
160
|
const onChange = jest.fn();
|
|
161
161
|
const { getByText } = render(
|
|
162
|
-
<
|
|
162
|
+
<V3DxcSelect
|
|
163
163
|
label="test-select-name"
|
|
164
164
|
options={optionsWithoutIcon}
|
|
165
165
|
value={[1, 2]}
|
|
166
166
|
multiple
|
|
167
167
|
onChange={onChange}
|
|
168
|
-
></
|
|
168
|
+
></V3DxcSelect>
|
|
169
169
|
);
|
|
170
170
|
const select = getByText("Amazon, Ebay");
|
|
171
171
|
act(() => {
|
|
@@ -183,7 +183,7 @@ describe("Select component tests", () => {
|
|
|
183
183
|
test("Uncontrolled select with multiple values", () => {
|
|
184
184
|
const onChange = jest.fn();
|
|
185
185
|
const { getByText, getByRole } = render(
|
|
186
|
-
<
|
|
186
|
+
<V3DxcSelect label="test-select-name" options={optionsWithoutIcon} multiple onChange={onChange}></V3DxcSelect>
|
|
187
187
|
);
|
|
188
188
|
const select = getByRole("button");
|
|
189
189
|
act(() => {
|