test(Form): improve test coverage

This commit is contained in:
陈嘉涵
2020-02-14 10:53:47 +08:00
parent 2e927ec2e4
commit 6bbeed7dd1
7 changed files with 108 additions and 15 deletions
+7 -4
View File
@@ -1,4 +1,9 @@
import { mount } from '../../../test';
import { mount, later } from '../../../test';
export async function submitForm(wrapper) {
wrapper.find('.van-button').trigger('click');
return later();
}
export function mountForm(options) {
return mount(options, { attachToDocument: true });
@@ -20,9 +25,7 @@ export function mountSimpleRulesForm(options) {
<van-button native-type="submit" />
</van-form>
`,
data() {
return getSimpleRules();
},
data: getSimpleRules,
...options,
});
}