Skip to content

Commit 3c5280c

Browse files
committed
test userEvent with delay null
Signed-off-by: Carita Ou <[email protected]>
1 parent c4481b2 commit 3c5280c

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

canvas_modules/common-canvas/__tests__/common-properties/controls/multiselect-test.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ mockMultiselect.mockImplementation((props) => {
3939
return <MultiselectComp {...props} />;
4040
});
4141

42-
userEvent.setup({ delay: null });
42+
const user = userEvent.setup({ delay: null });
4343

4444
describe("multiselect renders correctly", () => {
4545

@@ -139,7 +139,7 @@ describe("multiselect renders correctly", () => {
139139
multiselectWrapper = container.querySelector("div[data-id='properties-test-multiselect']");
140140
const multiselectList = multiselectWrapper.querySelectorAll("li.cds--list-box__menu-item");
141141
expect(multiselectList).to.be.length(4);
142-
await userEvent.click(multiselectList[0]);
142+
await user.click(multiselectList[0]);
143143
const expectedValue = [multiselectList[0].textContent];
144144
expect(controller.getPropertyValue(propertyId)).to.eql(expectedValue);
145145
});
@@ -166,7 +166,7 @@ describe("multiselect renders correctly", () => {
166166
multiselectWrapper = container.querySelector("div[data-id='properties-test-multiselect']");
167167
const multiselectList = multiselectWrapper.querySelectorAll("li.cds--list-box__menu-item");
168168
expect(multiselectList).to.be.length(4);
169-
await userEvent.click(multiselectList[0]);
169+
await user.click(multiselectList[0]);
170170
const expectedValue = [multiselectList[0].textContent];
171171
expect(controller.getPropertyValue(propertyId)).to.eql(expectedValue);
172172
});
@@ -304,7 +304,7 @@ describe("multiselect paramDef works correctly", () => {
304304
multiselectWrapper = container.querySelector("div[data-id='properties-multiselect_custom_labels']");
305305
const multiselectList = multiselectWrapper.querySelectorAll("li.cds--list-box__menu-item");
306306
expect(multiselectList).to.have.length(6);
307-
await userEvent.click(multiselectList[0]);
307+
await user.click(multiselectList[0]);
308308
const expectedValue = [multiselectList[0].textContent];
309309
expect(renderedController.getPropertyValue(propertyId)).to.eql(expectedValue);
310310

@@ -387,7 +387,7 @@ describe("multiselect paramDef works correctly", () => {
387387
const multiselectList = table.querySelectorAll("li.cds--list-box__menu-item");
388388
expect(multiselectList).to.have.length(4);
389389

390-
await userEvent.click(multiselectList[0]);
390+
await user.click(multiselectList[0]);
391391
const expectedValue = [multiselectList[0].textContent];
392392
expect(renderedController.getPropertyValue(propertyId11)).to.eql(expectedValue);
393393
});

0 commit comments

Comments
 (0)