mirror of
https://github.com/KevinMidboe/vue-chartjs.git
synced 2025-10-29 18:00:20 +00:00
Add prop for inline plugins
This commit is contained in:
@@ -76,9 +76,31 @@ describe('PolarChart', () => {
|
||||
components: { PolarChart }
|
||||
}).$mount(el)
|
||||
|
||||
expect(vm.$children[0].plugins).to.exist
|
||||
expect(vm.$children[0]._plugins).to.exist
|
||||
vm.$children[0].addPlugin(testPlugin)
|
||||
|
||||
expect(vm.$children[0].plugins.length).to.equal(1)
|
||||
expect(vm.$children[0]._plugins.length).to.equal(1)
|
||||
})
|
||||
|
||||
it('should add inline plugins based on prop', () => {
|
||||
const testPlugin = {
|
||||
id: 'test'
|
||||
}
|
||||
|
||||
const vm = new Vue({
|
||||
render: function (createElement) {
|
||||
return createElement(
|
||||
PolarChart, {
|
||||
props: {
|
||||
plugins: [testPlugin]
|
||||
}
|
||||
}
|
||||
)
|
||||
},
|
||||
components: { PolarChart }
|
||||
}).$mount(el)
|
||||
|
||||
expect(vm.$children[0]._plugins).to.exist
|
||||
expect(vm.$children[0]._plugins.length).to.equal(1)
|
||||
})
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user