Skip to content

Commit

Permalink
chore: update test cases of Spin (#34695)
Browse files Browse the repository at this point in the history
  • Loading branch information
jrr997 committed Mar 24, 2022
1 parent 5e0c232 commit be18ea6
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 24 deletions.
31 changes: 9 additions & 22 deletions components/spin/__tests__/__snapshots__/index.test.js.snap
@@ -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`] = `
Expand Down Expand Up @@ -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>
`;
4 changes: 2 additions & 2 deletions components/spin/__tests__/index.test.js
Expand Up @@ -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);
});

Expand Down

0 comments on commit be18ea6

Please sign in to comment.