test(Button): add basic test case

This commit is contained in:
chenjiahan 2020-11-07 23:45:15 +08:00
parent 5b6e827080
commit 1022969ae4
2 changed files with 25 additions and 0 deletions

View File

@ -0,0 +1,13 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`loading-size prop 1`] = `
<button type="button" class="van-button van-button--default van-button--normal van-button--loading">
<div class="van-button__content">
<div class="van-loading van-loading--circular van-button__loading"><span class="van-loading__spinner van-loading__spinner--circular" style="color: currentColor; width: 10px; height: 10px;"><svg class="van-loading__circular" viewBox="25 25 50 50"><circle cx="50" cy="50" r="20" fill="none"></circle></svg></span>
<!---->
</div>
<!---->
<!---->
</div>
</button>
`;

View File

@ -0,0 +1,12 @@
import { mount } from '../../../test';
import Button from '..';
test('loading-size prop', () => {
const wrapper = mount(Button, {
propsData: {
loading: true,
loadingSize: '10px',
},
});
expect(wrapper.html()).toMatchSnapshot();
});