chore: update test cases of Spin (#34695)

This commit is contained in:
Zack Chang 2022-03-24 22:12:41 +08:00 committed by GitHub
parent 5e0c232077
commit be18ea659b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 11 additions and 24 deletions

View File

@ -1,16 +1,9 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP // Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`Spin if indicator set null should not be render default indicator 1`] = ` exports[`Spin if indicator set null should not be render default indicator 1`] = `
<Spin <div
indicator={null} class="ant-spin ant-spin-spinning"
size="default" />
spinning={true}
wrapperClassName=""
>
<div
className="ant-spin ant-spin-spinning"
/>
</Spin>
`; `;
exports[`Spin rtl render component should be rendered correctly in RTL direction 1`] = ` exports[`Spin rtl render component should be rendered correctly in RTL direction 1`] = `
@ -47,17 +40,11 @@ exports[`Spin should render custom indicator when it's set 1`] = `
`; `;
exports[`Spin should support static method Spin.setDefaultIndicator 1`] = ` exports[`Spin should support static method Spin.setDefaultIndicator 1`] = `
<Spin <div
size="default" class="ant-spin ant-spin-spinning"
spinning={true}
wrapperClassName=""
> >
<div <em
className="ant-spin ant-spin-spinning" class="custom-spinner ant-spin-dot"
> />
<em </div>
className="custom-spinner ant-spin-dot"
/>
</div>
</Spin>
`; `;

View File

@ -33,13 +33,13 @@ describe('Spin', () => {
it('if indicator set null should not be render default indicator', () => { it('if indicator set null should not be render default indicator', () => {
const wrapper = mount(<Spin indicator={null} />); const wrapper = mount(<Spin indicator={null} />);
expect(wrapper).toMatchSnapshot(); expect(wrapper.render()).toMatchSnapshot();
}); });
it('should support static method Spin.setDefaultIndicator', () => { it('should support static method Spin.setDefaultIndicator', () => {
Spin.setDefaultIndicator(<em className="custom-spinner" />); Spin.setDefaultIndicator(<em className="custom-spinner" />);
const wrapper = mount(<Spin />); const wrapper = mount(<Spin />);
expect(wrapper).toMatchSnapshot(); expect(wrapper.render()).toMatchSnapshot();
Spin.setDefaultIndicator(null); Spin.setDefaultIndicator(null);
}); });