File tree Expand file tree Collapse file tree 7 files changed +119
-21
lines changed Expand file tree Collapse file tree 7 files changed +119
-21
lines changed Original file line number Diff line number Diff line change @@ -2,16 +2,30 @@ import Vue from 'vue'
2
2
import BarChart from 'src/examples/BarExample'
3
3
4
4
describe ( 'BarChart' , ( ) => {
5
+ let el
6
+
7
+ beforeEach ( ( ) => {
8
+ el = document . createElement ( 'div' )
9
+ } )
10
+
5
11
it ( 'should render a canvas' , ( ) => {
6
12
const vm = new Vue ( {
7
- el : 'body' ,
8
- replace : false ,
9
13
template : '<bar-chart></bar-chart>' ,
10
14
components : { BarChart }
11
- } )
15
+ } ) . $mount ( el )
16
+
12
17
expect ( vm . $el . querySelector ( '#bar-chart' ) ) . not . to . be . an ( 'undefined' )
13
18
expect ( vm . $el . querySelector ( 'canvas' ) ) . not . to . be . an ( 'undefined' )
14
19
expect ( vm . $el . querySelector ( 'canvas' ) ) . not . to . be . an ( 'null' )
15
20
expect ( vm . $el . querySelector ( 'canvas' ) ) . to . exist
16
21
} )
22
+
23
+ it ( 'should change id based on prop' , ( ) => {
24
+ const vm = new Vue ( {
25
+ template : '<bar-chart chartId="barchartprop"></bar-chart>' ,
26
+ components : { BarChart }
27
+ } ) . $mount ( el )
28
+
29
+ expect ( vm . $el . querySelector ( '#barchartprop' ) ) . not . to . be . an ( 'undefined' )
30
+ } )
17
31
} )
Original file line number Diff line number Diff line change @@ -2,16 +2,30 @@ import Vue from 'vue'
2
2
import BubbleChart from 'src/examples/BubbleExample'
3
3
4
4
describe ( 'BubbleChart' , ( ) => {
5
+ let el
6
+
7
+ beforeEach ( ( ) => {
8
+ el = document . createElement ( 'div' )
9
+ } )
10
+
5
11
it ( 'should render a canvas' , ( ) => {
6
12
const vm = new Vue ( {
7
- el : 'body' ,
8
- replace : false ,
9
13
template : '<bubble-chart></bubble-chart>' ,
10
14
components : { BubbleChart }
11
- } )
15
+ } ) . $mount ( el )
16
+
12
17
expect ( vm . $el . querySelector ( '#bubble-chart' ) ) . not . to . be . an ( 'undefined' )
13
18
expect ( vm . $el . querySelector ( 'canvas' ) ) . not . to . be . an ( 'undefined' )
14
19
expect ( vm . $el . querySelector ( 'canvas' ) ) . not . to . be . an ( 'null' )
15
20
expect ( vm . $el . querySelector ( 'canvas' ) ) . to . exist
16
21
} )
22
+
23
+ it ( 'should change id based on prop' , ( ) => {
24
+ const vm = new Vue ( {
25
+ template : '<bubble-chart chartId="bubblechartprop"></bubble-chart>' ,
26
+ components : { BubbleChart }
27
+ } ) . $mount ( el )
28
+
29
+ expect ( vm . $el . querySelector ( '#bubblechartprop' ) ) . not . to . be . an ( 'undefined' )
30
+ } )
17
31
} )
Original file line number Diff line number Diff line change @@ -2,16 +2,30 @@ import Vue from 'vue'
2
2
import DoughnutChart from 'src/examples/DoughnutExample'
3
3
4
4
describe ( 'DoughnutChart' , ( ) => {
5
+ let el
6
+
7
+ beforeEach ( ( ) => {
8
+ el = document . createElement ( 'div' )
9
+ } )
10
+
5
11
it ( 'should render a canvas' , ( ) => {
6
12
const vm = new Vue ( {
7
- el : 'body' ,
8
- replace : false ,
9
13
template : '<doughnut-chart></doughnut-chart>' ,
10
14
components : { DoughnutChart }
11
- } )
15
+ } ) . $mount ( el )
16
+
12
17
expect ( vm . $el . querySelector ( '#doughnut-chart' ) ) . not . to . be . an ( 'undefined' )
13
18
expect ( vm . $el . querySelector ( 'canvas' ) ) . not . to . be . an ( 'undefined' )
14
19
expect ( vm . $el . querySelector ( 'canvas' ) ) . not . to . be . an ( 'null' )
15
20
expect ( vm . $el . querySelector ( 'canvas' ) ) . to . exist
16
21
} )
22
+
23
+ it ( 'should change id based on prop' , ( ) => {
24
+ const vm = new Vue ( {
25
+ template : '<doughnut-chart chartId="doughnutchartprop"></doughnut-chart>' ,
26
+ components : { DoughnutChart }
27
+ } ) . $mount ( el )
28
+
29
+ expect ( vm . $el . querySelector ( '#doughnutchartprop' ) ) . not . to . be . an ( 'undefined' )
30
+ } )
17
31
} )
Original file line number Diff line number Diff line change @@ -2,16 +2,30 @@ import Vue from 'vue'
2
2
import LineChart from 'src/examples/LineExample'
3
3
4
4
describe ( 'LineChart' , ( ) => {
5
+ let el
6
+
7
+ beforeEach ( ( ) => {
8
+ el = document . createElement ( 'div' )
9
+ } )
10
+
5
11
it ( 'should render a canvas' , ( ) => {
6
12
const vm = new Vue ( {
7
- el : 'body' ,
8
- replace : false ,
9
13
template : '<line-chart></line-chart>' ,
10
14
components : { LineChart }
11
- } )
15
+ } ) . $mount ( el )
16
+
12
17
expect ( vm . $el . querySelector ( '#line-chart' ) ) . not . to . be . an ( 'undefined' )
13
18
expect ( vm . $el . querySelector ( 'canvas' ) ) . not . to . be . an ( 'undefined' )
14
19
expect ( vm . $el . querySelector ( 'canvas' ) ) . not . to . be . an ( 'null' )
15
20
expect ( vm . $el . querySelector ( 'canvas' ) ) . to . exist
16
21
} )
22
+
23
+ it ( 'should change id based on prop' , ( ) => {
24
+ const vm = new Vue ( {
25
+ template : '<line-chart chartId="linechartprop"></line-chart>' ,
26
+ components : { LineChart }
27
+ } ) . $mount ( el )
28
+
29
+ expect ( vm . $el . querySelector ( '#linechartprop' ) ) . not . to . be . an ( 'undefined' )
30
+ } )
17
31
} )
Original file line number Diff line number Diff line change @@ -2,16 +2,30 @@ import Vue from 'vue'
2
2
import PieChart from 'src/examples/PieExample'
3
3
4
4
describe ( 'PieChart' , ( ) => {
5
+ let el
6
+
7
+ beforeEach ( ( ) => {
8
+ el = document . createElement ( 'div' )
9
+ } )
10
+
5
11
it ( 'should render a canvas' , ( ) => {
6
12
const vm = new Vue ( {
7
- el : 'body' ,
8
- replace : false ,
9
13
template : '<pie-chart></pie-chart>' ,
10
14
components : { PieChart }
11
- } )
15
+ } ) . $mount ( el )
16
+
12
17
expect ( vm . $el . querySelector ( '#pie-chart' ) ) . not . to . be . an ( 'undefined' )
13
18
expect ( vm . $el . querySelector ( 'canvas' ) ) . not . to . be . an ( 'undefined' )
14
19
expect ( vm . $el . querySelector ( 'canvas' ) ) . not . to . be . an ( 'null' )
15
20
expect ( vm . $el . querySelector ( 'canvas' ) ) . to . exist
16
21
} )
22
+
23
+ it ( 'should change id based on prop' , ( ) => {
24
+ const vm = new Vue ( {
25
+ template : '<pie-chart chartId="piechartprop"></pie-chart>' ,
26
+ components : { PieChart }
27
+ } ) . $mount ( el )
28
+
29
+ expect ( vm . $el . querySelector ( '#piechartprop' ) ) . not . to . be . an ( 'undefined' )
30
+ } )
17
31
} )
Original file line number Diff line number Diff line change @@ -2,16 +2,30 @@ import Vue from 'vue'
2
2
import PolarChart from 'src/examples/PolarAreaExample'
3
3
4
4
describe ( 'PolarChart' , ( ) => {
5
+ let el
6
+
7
+ beforeEach ( ( ) => {
8
+ el = document . createElement ( 'div' )
9
+ } )
10
+
5
11
it ( 'should render a canvas' , ( ) => {
6
12
const vm = new Vue ( {
7
- el : 'body' ,
8
- replace : false ,
9
13
template : '<polar-chart></polar-chart>' ,
10
14
components : { PolarChart }
11
- } )
15
+ } ) . $mount ( el )
16
+
12
17
expect ( vm . $el . querySelector ( '#polar-chart' ) ) . not . to . be . an ( 'undefined' )
13
18
expect ( vm . $el . querySelector ( 'canvas' ) ) . not . to . be . an ( 'undefined' )
14
19
expect ( vm . $el . querySelector ( 'canvas' ) ) . not . to . be . an ( 'null' )
15
20
expect ( vm . $el . querySelector ( 'canvas' ) ) . to . exist
16
21
} )
22
+
23
+ it ( 'should change id based on prop' , ( ) => {
24
+ const vm = new Vue ( {
25
+ template : '<polar-chart chartId="polarchartprop"></polar-chart>' ,
26
+ components : { PolarChart }
27
+ } ) . $mount ( el )
28
+
29
+ expect ( vm . $el . querySelector ( '#polarchartprop' ) ) . not . to . be . an ( 'undefined' )
30
+ } )
17
31
} )
Original file line number Diff line number Diff line change @@ -2,16 +2,30 @@ import Vue from 'vue'
2
2
import RadarChart from 'src/examples/RadarExample'
3
3
4
4
describe ( 'RadarChart' , ( ) => {
5
+ let el
6
+
7
+ beforeEach ( ( ) => {
8
+ el = document . createElement ( 'div' )
9
+ } )
10
+
5
11
it ( 'should render a canvas' , ( ) => {
6
12
const vm = new Vue ( {
7
- el : 'body' ,
8
- replace : false ,
9
13
template : '<radar-chart></radar-chart>' ,
10
14
components : { RadarChart }
11
- } )
15
+ } ) . $mount ( el )
16
+
12
17
expect ( vm . $el . querySelector ( '#radar-chart' ) ) . not . to . be . an ( 'undefined' )
13
18
expect ( vm . $el . querySelector ( 'canvas' ) ) . not . to . be . an ( 'undefined' )
14
19
expect ( vm . $el . querySelector ( 'canvas' ) ) . not . to . be . an ( 'null' )
15
20
expect ( vm . $el . querySelector ( 'canvas' ) ) . to . exist
16
21
} )
22
+
23
+ it ( 'should change id based on prop' , ( ) => {
24
+ const vm = new Vue ( {
25
+ template : '<radar-chart chartId="rodarchartprop"></radar-chart>' ,
26
+ components : { RadarChart }
27
+ } ) . $mount ( el )
28
+
29
+ expect ( vm . $el . querySelector ( '#rodarchartprop' ) ) . not . to . be . an ( 'undefined' )
30
+ } )
17
31
} )
You can’t perform that action at this time.
0 commit comments