@@ -2,58 +2,13 @@ import { expect } from '@vaadin/chai-plugins';
2
2
import { fixtureSync , nextRender , oneEvent } from '@vaadin/testing-helpers' ;
3
3
import sinon from 'sinon' ;
4
4
import '../theme/vaadin-chart-base-theme.js' ;
5
+ import './exporting-styles.js' ;
5
6
import '../src/vaadin-chart.js' ;
6
- import { html , PolymerElement } from '@polymer/polymer/polymer-element.js' ;
7
7
import HttpUtilities from 'highcharts/es-modules/Core/HttpUtilities.js' ;
8
8
import Highcharts from 'highcharts/es-modules/masters/highstock.src.js' ;
9
- import { css , registerStyles } from '@vaadin/vaadin-themable-mixin/vaadin-themable-mixin.js' ;
10
- import { chartBaseTheme } from '../theme/vaadin-chart-base-theme.js' ;
11
-
12
- const chart = css `
13
- /* Ensure exporting works with complex selectors */
14
- .highcharts-color-0 {
15
- stroke: red;
16
- fill: red;
17
- }
18
-
19
- :host(#chart) .highcharts-color-0 {
20
- stroke: blue;
21
- fill: blue;
22
- }
23
-
24
- :host(.my-class .dummy-class) .highcharts-color-0 {
25
- stroke: blue;
26
- fill: blue;
27
- }
28
-
29
- :host(.ColumnLineAndPie) g.highcharts-markers > .highcharts-point {
30
- fill: white;
31
- }
32
-
33
- :host(.GaugeWithDualAxes) .kmh .highcharts-tick,
34
- :host(.GaugeWithDualAxes) .kmh .highcharts-axis-line {
35
- stroke: #339;
36
- stroke-width: 2;
37
- }
38
- ` ;
39
-
40
- registerStyles ( 'vaadin-chart' , [ chartBaseTheme , chart ] ) ;
41
-
42
- customElements . define (
43
- 'chart-exporting' ,
44
- class extends PolymerElement {
45
- static get template ( ) {
46
- return html `
47
- < vaadin-chart id ="chart " class ="my-class dummy-class ">
48
- < vaadin-chart-series values ="[19,12,9,24,5] "> </ vaadin-chart-series >
49
- </ vaadin-chart >
50
- ` ;
51
- }
52
- } ,
53
- ) ;
54
9
55
10
describe ( 'vaadin-chart exporting' , ( ) => {
56
- let wrapper , chart , chartContainer , fireEventSpy ;
11
+ let chart , chartContainer , fireEventSpy ;
57
12
58
13
before ( ( ) => {
59
14
// Prevent form submit
@@ -63,8 +18,11 @@ describe('vaadin-chart exporting', () => {
63
18
} ) ;
64
19
65
20
beforeEach ( async ( ) => {
66
- wrapper = fixtureSync ( '<chart-exporting></chart-exporting>' ) ;
67
- chart = wrapper . $ . chart ;
21
+ chart = fixtureSync ( `
22
+ <vaadin-chart id="chart" class="my-class dummy-class">
23
+ <vaadin-chart-series values="[19,12,9,24,5]"></vaadin-chart-series>
24
+ </vaadin-chart>
25
+ ` ) ;
68
26
chart . additionalOptions = { exporting : { enabled : true } } ;
69
27
await oneEvent ( chart , 'chart-add-series' ) ;
70
28
chartContainer = chart . $ . chart ;
0 commit comments