diff --git a/src/Dialog/index.tsx b/src/Dialog/index.tsx index fdad1ee0..21155957 100644 --- a/src/Dialog/index.tsx +++ b/src/Dialog/index.tsx @@ -41,6 +41,7 @@ const Dialog: React.FC = (props) => { maskStyle, maskProps, rootClassName, + rootStyle, classNames: modalClassNames, styles: modalStyles, } = props; @@ -175,6 +176,7 @@ const Dialog: React.FC = (props) => { return (
any; diff --git a/tests/__snapshots__/index.spec.tsx.snap b/tests/__snapshots__/index.spec.tsx.snap index 8bebc66f..d7886512 100644 --- a/tests/__snapshots__/index.spec.tsx.snap +++ b/tests/__snapshots__/index.spec.tsx.snap @@ -1,8 +1,9 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP -exports[`dialog add rootClassName should render correct 1`] = ` +exports[`dialog add rootClassName and rootStyle should render correct 1`] = `
{ expect(wrapper.render()).toMatchSnapshot(); }); - it('add rootClassName should render correct', () => { + it('add rootClassName and rootStyle should render correct', () => { const spy = jest.spyOn(console, 'error').mockImplementation(() => {}); const wrapper = mount( { ); expect(wrapper.find('.customize-root-class').length).toBeTruthy(); expect(wrapper.find('.rc-dialog-wrap').props().style.fontSize).toBe(10); + expect(wrapper.find('.rc-dialog-root').props().style.fontSize).toBe(20); expect(wrapper.find('.rc-dialog').props().style.height).toEqual(903); expect(wrapper.find('.rc-dialog').props().style.width).toEqual(600); });