Completed
Push — master ( d5ffb5...8c40a0 )
by Ajeh
43s
created

main.spec.js ➔ describe(ꞌPlugin Installedꞌ)   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
c 1
b 0
f 0
nc 1
dl 0
loc 5
rs 9.4285
nop 0

1 Function

Rating   Name   Duplication   Size   Complexity  
A main.spec.js ➔ ... ➔ it(ꞌPlugin Should be installedꞌ) 0 3 1
1
/**
2
 * Created by Emmy on 10/8/2017.
3
 */
4
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