mirror of
https://github.com/ant-design/ant-design.git
synced 2025-08-06 16:06:28 +08:00
Fix style prop of spin
This commit is contained in:
parent
29081542e6
commit
1a3ea43ebe
15
components/spin/__tests__/index.test.js
Normal file
15
components/spin/__tests__/index.test.js
Normal file
@ -0,0 +1,15 @@
|
||||
import React from 'react';
|
||||
import { shallow } from 'enzyme';
|
||||
import Spin from '..';
|
||||
|
||||
describe('Spin', () => {
|
||||
it('should only affect the spin element when set style to a nested <Spin>xx</Spin>', () => {
|
||||
const wrapper = shallow(
|
||||
<Spin style={{ background: 'red' }}>
|
||||
<div>content</div>
|
||||
</Spin>
|
||||
);
|
||||
expect(wrapper.find('.ant-spin-nested-loading').at(0).prop('style')).toBe(null);
|
||||
expect(wrapper.find('.ant-spin').at(0).prop('style').background).toBe('red');
|
||||
});
|
||||
});
|
@ -119,6 +119,7 @@ export default class Spin extends React.Component<SpinProps, any> {
|
||||
{...divProps}
|
||||
component="div"
|
||||
className={`${prefixCls}-nested-loading`}
|
||||
style={null}
|
||||
transitionName="fade"
|
||||
>
|
||||
{spinning && <div key="loading">{spinElement}</div>}
|
||||
|
Loading…
Reference in New Issue
Block a user