Skip to content

Commit da4d256

Browse files
author
committed
chore: add test case
1 parent 9a81aba commit da4d256

File tree

1 file changed

+15
-7
lines changed

1 file changed

+15
-7
lines changed

tests/index.spec.tsx

Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1064,18 +1064,26 @@ describe('Cascader.Basic', () => {
10641064
errorSpy.mockReset();
10651065
});
10661066

1067-
it('``in Cascader options should throw a warning', () => {
1067+
it('`dropdownMenuColumnStyle`in Cascader options should throw a warning', () => {
10681068
const errorSpy = jest.spyOn(console, 'error').mockImplementation(() => null);
1069-
mount(
1070-
<Cascader
1071-
dropdownMenuColumnStyle={{}}
1072-
options={[]}
1073-
/>,
1074-
);
1069+
mount(<Cascader dropdownMenuColumnStyle={{}} options={[]} />);
10751070

10761071
expect(errorSpy).toHaveBeenCalledWith(
10771072
'Warning: `dropdownMenuColumnStyle` is deprecated. Please use `styles.dropdownMenuColumn` instead.',
10781073
);
10791074
errorSpy.mockReset();
10801075
});
1076+
1077+
it('`dropdownMenuColumnStyle`in Cascader options should throw a warning', () => {
1078+
const wrapper = mount(<Cascader
1079+
styles={{ dropdown: { backgroundColor: 'red' }, dropdownMenuColumn: { backgroundColor: 'blue' } }}
1080+
options={[]}
1081+
open
1082+
/>);
1083+
expect(wrapper.find('.rc-cascader-dropdown').props().style.backgroundColor).toEqual('red');
1084+
expect(wrapper.find('.rc-cascader-menu-item').props().style.backgroundColor).toEqual('blue');
1085+
1086+
});
1087+
1088+
10811089
});

0 commit comments

Comments
 (0)