mirror of
https://github.com/KevinMidboe/vue-chartjs.git
synced 2025-10-29 18:00:20 +00:00
Merge pull request #140 from apertureless/feature/update_tests
✅ Update tests for addPlugin method
This commit is contained in:
@@ -57,8 +57,28 @@ describe('BarChart', () => {
|
|||||||
|
|
||||||
vm.$nextTick(() => {
|
vm.$nextTick(() => {
|
||||||
vm.$forceUpdate()
|
vm.$forceUpdate()
|
||||||
expect(vm.$children[0]._chart.chart.ctx).to.be.null
|
expect(vm.$children[0]._chart.chart.ctx).to.equal
|
||||||
done()
|
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)
|
||||||
|
})
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -61,4 +61,24 @@ describe('BubbleChart', () => {
|
|||||||
done()
|
done()
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
|
it('should add an inline plugin to the array', () => {
|
||||||
|
const testPlugin = {
|
||||||
|
id: 'test'
|
||||||
|
}
|
||||||
|
|
||||||
|
const vm = new Vue({
|
||||||
|
render: function (createElement) {
|
||||||
|
return createElement(
|
||||||
|
BubbleChart
|
||||||
|
)
|
||||||
|
},
|
||||||
|
components: { BubbleChart }
|
||||||
|
}).$mount(el)
|
||||||
|
|
||||||
|
expect(vm.$children[0].plugins).to.exist
|
||||||
|
vm.$children[0].addPlugin(testPlugin)
|
||||||
|
|
||||||
|
expect(vm.$children[0].plugins.length).to.equal(1)
|
||||||
|
})
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -61,4 +61,24 @@ describe('DoughnutChart', () => {
|
|||||||
done()
|
done()
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
|
it('should add an inline plugin to the array', () => {
|
||||||
|
const testPlugin = {
|
||||||
|
id: 'test'
|
||||||
|
}
|
||||||
|
|
||||||
|
const vm = new Vue({
|
||||||
|
render: function (createElement) {
|
||||||
|
return createElement(
|
||||||
|
DoughnutChart
|
||||||
|
)
|
||||||
|
},
|
||||||
|
components: { DoughnutChart }
|
||||||
|
}).$mount(el)
|
||||||
|
|
||||||
|
expect(vm.$children[0].plugins).to.exist
|
||||||
|
vm.$children[0].addPlugin(testPlugin)
|
||||||
|
|
||||||
|
expect(vm.$children[0].plugins.length).to.equal(1)
|
||||||
|
})
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -61,4 +61,24 @@ describe('HorizontalBarChart', () => {
|
|||||||
done()
|
done()
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
|
it('should add an inline plugin to the array', () => {
|
||||||
|
const testPlugin = {
|
||||||
|
id: 'test'
|
||||||
|
}
|
||||||
|
|
||||||
|
const vm = new Vue({
|
||||||
|
render: function (createElement) {
|
||||||
|
return createElement(
|
||||||
|
HorizontalBarChart
|
||||||
|
)
|
||||||
|
},
|
||||||
|
components: { HorizontalBarChart }
|
||||||
|
}).$mount(el)
|
||||||
|
|
||||||
|
expect(vm.$children[0].plugins).to.exist
|
||||||
|
vm.$children[0].addPlugin(testPlugin)
|
||||||
|
|
||||||
|
expect(vm.$children[0].plugins.length).to.equal(1)
|
||||||
|
})
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -61,4 +61,24 @@ describe('LineChart', () => {
|
|||||||
done()
|
done()
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
|
it('should add an inline plugin to the array', () => {
|
||||||
|
const testPlugin = {
|
||||||
|
id: 'test'
|
||||||
|
}
|
||||||
|
|
||||||
|
const vm = new Vue({
|
||||||
|
render: function (createElement) {
|
||||||
|
return createElement(
|
||||||
|
LineChart
|
||||||
|
)
|
||||||
|
},
|
||||||
|
components: { LineChart }
|
||||||
|
}).$mount(el)
|
||||||
|
|
||||||
|
expect(vm.$children[0].plugins).to.exist
|
||||||
|
vm.$children[0].addPlugin(testPlugin)
|
||||||
|
|
||||||
|
expect(vm.$children[0].plugins.length).to.equal(1)
|
||||||
|
})
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -60,4 +60,24 @@ describe('PieChart', () => {
|
|||||||
done()
|
done()
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
|
it('should add an inline plugin to the array', () => {
|
||||||
|
const testPlugin = {
|
||||||
|
id: 'test'
|
||||||
|
}
|
||||||
|
|
||||||
|
const vm = new Vue({
|
||||||
|
render: function (createElement) {
|
||||||
|
return createElement(
|
||||||
|
PieChart
|
||||||
|
)
|
||||||
|
},
|
||||||
|
components: { PieChart }
|
||||||
|
}).$mount(el)
|
||||||
|
|
||||||
|
expect(vm.$children[0].plugins).to.exist
|
||||||
|
vm.$children[0].addPlugin(testPlugin)
|
||||||
|
|
||||||
|
expect(vm.$children[0].plugins.length).to.equal(1)
|
||||||
|
})
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -61,4 +61,24 @@ describe('PolarChart', () => {
|
|||||||
done()
|
done()
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
|
it('should add an inline plugin to the array', () => {
|
||||||
|
const testPlugin = {
|
||||||
|
id: 'test'
|
||||||
|
}
|
||||||
|
|
||||||
|
const vm = new Vue({
|
||||||
|
render: function (createElement) {
|
||||||
|
return createElement(
|
||||||
|
PolarChart
|
||||||
|
)
|
||||||
|
},
|
||||||
|
components: { PolarChart }
|
||||||
|
}).$mount(el)
|
||||||
|
|
||||||
|
expect(vm.$children[0].plugins).to.exist
|
||||||
|
vm.$children[0].addPlugin(testPlugin)
|
||||||
|
|
||||||
|
expect(vm.$children[0].plugins.length).to.equal(1)
|
||||||
|
})
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -60,4 +60,24 @@ describe('RadarChart', () => {
|
|||||||
done()
|
done()
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
|
it('should add an inline plugin to the array', () => {
|
||||||
|
const testPlugin = {
|
||||||
|
id: 'test'
|
||||||
|
}
|
||||||
|
|
||||||
|
const vm = new Vue({
|
||||||
|
render: function (createElement) {
|
||||||
|
return createElement(
|
||||||
|
RadarChart
|
||||||
|
)
|
||||||
|
},
|
||||||
|
components: { RadarChart }
|
||||||
|
}).$mount(el)
|
||||||
|
|
||||||
|
expect(vm.$children[0].plugins).to.exist
|
||||||
|
vm.$children[0].addPlugin(testPlugin)
|
||||||
|
|
||||||
|
expect(vm.$children[0].plugins.length).to.equal(1)
|
||||||
|
})
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -61,4 +61,24 @@ describe('ScatterChart', () => {
|
|||||||
done()
|
done()
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
|
it('should add an inline plugin to the array', () => {
|
||||||
|
const testPlugin = {
|
||||||
|
id: 'test'
|
||||||
|
}
|
||||||
|
|
||||||
|
const vm = new Vue({
|
||||||
|
render: function (createElement) {
|
||||||
|
return createElement(
|
||||||
|
ScatterChart
|
||||||
|
)
|
||||||
|
},
|
||||||
|
components: { ScatterChart }
|
||||||
|
}).$mount(el)
|
||||||
|
|
||||||
|
expect(vm.$children[0].plugins).to.exist
|
||||||
|
vm.$children[0].addPlugin(testPlugin)
|
||||||
|
|
||||||
|
expect(vm.$children[0].plugins.length).to.equal(1)
|
||||||
|
})
|
||||||
})
|
})
|
||||||
|
|||||||
Reference in New Issue
Block a user