[unit] 添加button测试用例
This commit is contained in:
parent
fe5ffd7f3f
commit
9c33c6443a
1 changed files with 24 additions and 0 deletions
24
test/unit/specs/button.spec.js
Normal file
24
test/unit/specs/button.spec.js
Normal file
|
@ -0,0 +1,24 @@
|
||||||
|
import { createVue, destroyVM } from '../util';
|
||||||
|
|
||||||
|
describe('Button.vue', () => {
|
||||||
|
let vm;
|
||||||
|
afterEach(() => {
|
||||||
|
destroyVM(vm);
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should render as <a>', done => {
|
||||||
|
vm = createVue(`
|
||||||
|
<Button to="http://www.thinkinfe.tech/">Think in FE</Button>
|
||||||
|
`);
|
||||||
|
expect(vm.$el.tagName).to.equal('A');
|
||||||
|
done();
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should render as <button>', done => {
|
||||||
|
vm = createVue(`
|
||||||
|
<Button>Think in FE</Button>
|
||||||
|
`);
|
||||||
|
expect(vm.$el.tagName).to.equal('BUTTON');
|
||||||
|
done();
|
||||||
|
});
|
||||||
|
});
|
Loading…
Add table
Reference in a new issue