Update tests for addPlugin method

This commit is contained in:
Jakub Juszczak
2017-07-04 10:31:21 +02:00
parent b23ce23015
commit 4109fb30f3
9 changed files with 181 additions and 1 deletions

View File

@@ -57,8 +57,28 @@ describe('BarChart', () => {
vm.$nextTick(() => {
vm.$forceUpdate()
expect(vm.$children[0]._chart.chart.ctx).to.be.null
expect(vm.$children[0]._chart.chart.ctx).to.equal
done()
})
})
it('should add an inline plugin to the array', () => {
const testPlugin = {
id: 'test'
}
const vm = new Vue({
render: function (createElement) {
return createElement(
BarChart
)
},
components: { BarChart }
}).$mount(el)
expect(vm.$children[0].plugins).to.exist
vm.$children[0].addPlugin(testPlugin)
expect(vm.$children[0].plugins.length).to.equal(1)
})
})