test: update result

pull/2682/head
tanjinzhou 2020-08-03 17:35:34 +08:00
parent 769f9b794e
commit 8f19769cce
3 changed files with 7 additions and 5 deletions

@ -1 +1 @@
Subproject commit 48e2a378cecd87b9e32d0ddc6d3fed26ed4a5e50 Subproject commit bb1ff4ddc529b85b5ab492d80d391b057fdd6eaa

View File

@ -1,6 +1,7 @@
import { mount } from '@vue/test-utils'; import { mount } from '@vue/test-utils';
import Result from '../index'; import Result from '../index';
import Button from '../../button'; import Button from '../../button';
import { sleep } from '../../../tests/utils';
describe('Result', () => { describe('Result', () => {
it('๐Ÿ™‚ successPercent should decide the progress status when it exists', () => { it('๐Ÿ™‚ successPercent should decide the progress status when it exists', () => {
@ -23,20 +24,21 @@ describe('Result', () => {
expect(wrapper.findAll('.anticon-check-circle')).toHaveLength(1); expect(wrapper.findAll('.anticon-check-circle')).toHaveLength(1);
}); });
it('๐Ÿ™‚ different status, different class', () => { it('๐Ÿ™‚ different status, different class', async () => {
const wrapper = mount(Result, { props: { status: 'warning' } }); const wrapper = mount(Result, { props: { status: 'warning' }, sync: false });
expect(wrapper.findAll('.ant-result-warning')).toHaveLength(1); expect(wrapper.findAll('.ant-result-warning')).toHaveLength(1);
wrapper.setProps({ wrapper.setProps({
status: 'error', status: 'error',
}); });
await sleep();
expect(wrapper.findAll('.ant-result-error')).toHaveLength(1); expect(wrapper.findAll('.ant-result-error')).toHaveLength(1);
wrapper.setProps({ wrapper.setProps({
status: '500', status: '500',
}); });
await sleep();
expect(wrapper.findAll('.ant-result-500')).toHaveLength(1); expect(wrapper.findAll('.ant-result-500')).toHaveLength(1);
}); });

View File

@ -4,7 +4,7 @@
</div> </div>
</template> </template>
<script> <script>
import demo from '../antdv-demo/docs/radio/demo/index'; import demo from '../antdv-demo/docs/result/demo/index';
export default { export default {
components: { components: {