Total Complexity | 13 |
Complexity/F | 1 |
Lines of Code | 53 |
Function Count | 13 |
Duplicated Lines | 0 |
Ratio | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | /** |
||
5 | import Plugin from '../../../../src/plugin/js/index' |
||
6 | import should from 'should' |
||
7 | import {assert} from 'chai' |
||
8 | import Vue from 'vue' |
||
9 | |||
10 | Vue.config.productionTip = false |
||
11 | |||
12 | describe('Plugin installer', function () { |
||
13 | it('"Plugin.install" Should be a function', function () { |
||
14 | should(Plugin.install).be.a.Function() |
||
15 | }) |
||
16 | }) |
||
17 | |||
18 | Vue.use(Plugin) |
||
19 | |||
20 | describe('Plugin Installed', function () { |
||
21 | it('Plugin Should be installed', function () { |
||
22 | assert.property(Vue, 'dialog') |
||
23 | }) |
||
24 | }) |
||
25 | |||
26 | describe('Plugin Available', function () { |
||
27 | it('"$dialog" Should be a available on the created, mounted hooks', function () { |
||
28 | new Vue({ |
||
29 | created(){ |
||
30 | assert.property(this, '$dialog') |
||
31 | }, |
||
32 | mounted(){ |
||
33 | assert.property(this, '$dialog') |
||
34 | }, |
||
35 | render(){ |
||
36 | return '' |
||
37 | } |
||
38 | }).$mount() |
||
39 | }) |
||
40 | }) |
||
41 | |||
42 | describe('Plugin Available', function () { |
||
43 | it('"$dialog" Should be a available in component methods', function () { |
||
44 | let vm = new Vue({ |
||
45 | methods: { |
||
46 | check(){ |
||
47 | assert.property(this, '$dialog') |
||
48 | } |
||
49 | }, |
||
50 | render(){ |
||
51 | return '' |
||
52 | } |
||
53 | }).$mount() |
||
54 | |||
55 | vm.check() |
||
56 | }) |
||
57 | }) |
||
58 |