Commit 9c33c6443a47619bd2217a8da184c568700c993f

Authored by 范文杰
1 parent fe5ffd7f

[unit] 添加button测试用例

Showing 1 changed file with 24 additions and 0 deletions   Show diff stats
test/unit/specs/button.spec.js 0 → 100644
  1 +import { createVue, destroyVM } from '../util';
  2 +
  3 +describe('Button.vue', () => {
  4 + let vm;
  5 + afterEach(() => {
  6 + destroyVM(vm);
  7 + });
  8 +
  9 + it('should render as <a>', done => {
  10 + vm = createVue(`
  11 + <Button to="http://www.thinkinfe.tech/">Think in FE</Button>
  12 + `);
  13 + expect(vm.$el.tagName).to.equal('A');
  14 + done();
  15 + });
  16 +
  17 + it('should render as <button>', done => {
  18 + vm = createVue(`
  19 + <Button>Think in FE</Button>
  20 + `);
  21 + expect(vm.$el.tagName).to.equal('BUTTON');
  22 + done();
  23 + });
  24 +});
... ...