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
exports[`Spin if indicator set null should not be render default indicator 1`] = `
<Spin
indicator={null}
size="default"
spinning={true}
wrapperClassName=""
>
<div
className="ant-spin ant-spin-spinning"
/>
</Spin>
<div
class="ant-spin ant-spin-spinning"
/>
`;
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`] = `
<Spin
size="default"
spinning={true}
wrapperClassName=""
<div
class="ant-spin ant-spin-spinning"
>
<div
className="ant-spin ant-spin-spinning"
>
<em
className="custom-spinner ant-spin-dot"
/>
</div>
</Spin>
<em
class="custom-spinner ant-spin-dot"
/>
</div>
`;

View File

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