Skip to content

Commit cb4d2bd

Browse files
committed
fix: update test
1 parent 5a5d26a commit cb4d2bd

File tree

2 files changed

+25
-2
lines changed

2 files changed

+25
-2
lines changed

packages/pluggableWidgets/checkbox-radio-selection-web/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@
4242
"publish-marketplace": "rui-publish-marketplace",
4343
"release": "pluggable-widgets-tools release:web",
4444
"start": "pluggable-widgets-tools start:server",
45-
"test": "jest --projects jest.config.js",
45+
"test": "pluggable-widgets-tools test:unit:web:enzyme-free",
4646
"update-changelog": "rui-update-changelog-widget",
4747
"verify": "rui-verify-package-format"
4848
},

packages/pluggableWidgets/checkbox-radio-selection-web/src/__tests__/SelectionControls.spec.tsx

Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,32 @@ jest.mock("../helpers/getSelector", () => ({
88
getSelector: jest.fn(() => ({
99
type: "single",
1010
status: "available",
11+
readOnly: false,
12+
currentId: "option1",
13+
clearable: false,
14+
customContentType: "no",
1115
updateProps: jest.fn(),
16+
setValue: jest.fn(),
1217
options: {
13-
onAfterSearchTermChange: jest.fn()
18+
status: "available",
19+
searchTerm: "",
20+
sortOrder: undefined,
21+
datasourceFilter: undefined,
22+
hasMore: false,
23+
isLoading: false,
24+
getAll: jest.fn(() => ["option1", "option2", "option3"]),
25+
setSearchTerm: jest.fn(),
26+
onAfterSearchTermChange: jest.fn(),
27+
loadMore: jest.fn(),
28+
_updateProps: jest.fn(),
29+
_optionToValue: jest.fn(),
30+
_valueToOption: jest.fn()
31+
},
32+
caption: {
33+
get: jest.fn(value => `Caption ${value}`),
34+
render: jest.fn(value => `Caption ${value}`),
35+
emptyCaption: "Select an option",
36+
formatter: undefined
1437
}
1538
}))
1639
}));

0 commit comments

Comments
 (0)