Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: support dropdownStyle and merge dropdownMenuColumnStyle to styles prop #413

Open
wants to merge 7 commits into
base: master
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 15 additions & 7 deletions tests/index.spec.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -1064,18 +1064,26 @@ describe('Cascader.Basic', () => {
errorSpy.mockReset();
});

it('``in Cascader options should throw a warning', () => {
it('`dropdownMenuColumnStyle`in Cascader options should throw a warning', () => {
const errorSpy = jest.spyOn(console, 'error').mockImplementation(() => null);
mount(
<Cascader
dropdownMenuColumnStyle={{}}
options={[]}
/>,
);
mount(<Cascader dropdownMenuColumnStyle={{}} options={[]} />);

expect(errorSpy).toHaveBeenCalledWith(
'Warning: `dropdownMenuColumnStyle` is deprecated. Please use `styles.dropdownMenuColumn` instead.',
);
errorSpy.mockReset();
});

it('`dropdownMenuColumnStyle`in Cascader options should throw a warning', () => {
const wrapper = mount(<Cascader
styles={{ dropdown: { backgroundColor: 'red' }, dropdownMenuColumn: { backgroundColor: 'blue' } }}
options={[]}
open
/>);
expect(wrapper.find('.rc-cascader-dropdown').props().style.backgroundColor).toEqual('red');
expect(wrapper.find('.rc-cascader-menu-item').props().style.backgroundColor).toEqual('blue');

BoyYangzai marked this conversation as resolved.
Show resolved Hide resolved
});


BoyYangzai marked this conversation as resolved.
Show resolved Hide resolved
});