Skip to content

Commit

Permalink
Merge pull request #140 from apertureless/feature/update_tests
Browse files Browse the repository at this point in the history
✅ Update tests for addPlugin method
  • Loading branch information
apertureless authored Jul 4, 2017
2 parents a996049 + 4109fb3 commit ef77c0d
Show file tree
Hide file tree
Showing 9 changed files with 181 additions and 1 deletion.
22 changes: 21 additions & 1 deletion test/unit/specs/Bar.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -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)
})
})
20 changes: 20 additions & 0 deletions test/unit/specs/Bubble.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,4 +61,24 @@ describe('BubbleChart', () => {
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)
})
})
20 changes: 20 additions & 0 deletions test/unit/specs/Doughnut.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,4 +61,24 @@ describe('DoughnutChart', () => {
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)
})
})
20 changes: 20 additions & 0 deletions test/unit/specs/HorizontalBar.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,4 +61,24 @@ describe('HorizontalBarChart', () => {
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)
})
})
20 changes: 20 additions & 0 deletions test/unit/specs/Line.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,4 +61,24 @@ describe('LineChart', () => {
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)
})
})
20 changes: 20 additions & 0 deletions test/unit/specs/Pie.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -60,4 +60,24 @@ describe('PieChart', () => {
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)
})
})
20 changes: 20 additions & 0 deletions test/unit/specs/PolarArea.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,4 +61,24 @@ describe('PolarChart', () => {
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)
})
})
20 changes: 20 additions & 0 deletions test/unit/specs/Radar.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -60,4 +60,24 @@ describe('RadarChart', () => {
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)
})
})
20 changes: 20 additions & 0 deletions test/unit/specs/Scatter.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,4 +61,24 @@ describe('ScatterChart', () => {
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)
})
})

0 comments on commit ef77c0d

Please sign in to comment.