@@ -95,7 +95,7 @@ describe('Test Free - sources', function() {
95
95
first_chart_content = Cypress . $ ( '#' + id ) . html ( ) ;
96
96
} ) ;
97
97
98
- cy . get ( '.visualizer-chart-action.visualizer-chart-edit' ) . first ( ) . click ( ) ;
98
+ cy . get ( '.visualizer-chart-action.visualizer-chart-edit' ) . first ( ) . click ( { force : true } ) ;
99
99
100
100
cy . wait ( Cypress . env ( 'wait' ) ) ;
101
101
@@ -114,25 +114,38 @@ describe('Test Free - sources', function() {
114
114
cy . wrap ( $body ) . find ( '#json-chart-button' ) . click ( ) ;
115
115
116
116
cy . wrap ( $body ) . find ( 'input[type="url"]#vz-import-json-url' ) . clear ( ) . type ( fileName , { force :true } ) ;
117
- cy . wrap ( $body ) . find ( '#visualizer-json-fetch' ) . click ( ) . then ( ( ) => {
117
+ cy . wrap ( $body ) . find ( '#visualizer-json-fetch' ) . click ( { force : true } ) . then ( ( ) => {
118
118
cy . wait ( Cypress . env ( 'wait' ) ) ;
119
119
cy . wrap ( $body ) . find ( '#visualizer-json-parse' ) . should ( 'be.visible' ) ;
120
120
cy . wrap ( $body ) . find ( '#vz-import-json-root' ) . should ( 'be.visible' ) ;
121
- cy . wrap ( $body ) . find ( '#vz-import-json-root option' ) . should ( 'have.length' , 1 ) ;
121
+ cy . wrap ( $body ) . find ( '#vz-import-json-root option' ) . should ( 'have.length' , 2 ) ;
122
+ cy . wrap ( $body ) . find ( '#vz-import-json-root' ) . invoke ( 'prop' , 'selectedIndex' , 1 ) ;
122
123
} ) ;
123
124
124
- cy . wrap ( $body ) . find ( '#visualizer-json-parse' ) . click ( ) . then ( ( ) => {
125
+ cy . wrap ( $body ) . find ( '#visualizer-json-parse' ) . click ( { force : true } ) . then ( ( ) => {
125
126
cy . wait ( Cypress . env ( 'wait' ) ) ;
126
127
cy . wrap ( $body ) . find ( '#json-conclude-form' ) . should ( 'be.visible' ) ;
127
128
cy . wrap ( $body ) . find ( '.json-table tr' ) . should ( 'have.length' , 15 ) ;
129
+
130
+ /*
131
+ // TODO: Alert does not get auto accepted
132
+ // check alert, if no columns are selected.
133
+ const stub = cy.stub();
134
+ cy.on('window:alert', stub);
135
+
136
+ cy.wrap($body).find('#json-chart-button').click().then( () => {
137
+ expect(stub.getCall(0)).to.be.calledWith('Please select a few columns to include in the chart.');
138
+ });
139
+ */
140
+
128
141
cy . wrap ( $body ) . find ( '.json-table tbody tr td select' ) . each ( function ( el , index ) {
129
142
if ( index === 0 ) {
130
143
cy . wrap ( el ) . select ( 'date' ) ;
131
144
} else {
132
145
cy . wrap ( el ) . select ( 'number' ) ;
133
146
}
134
147
} ) ;
135
- cy . wrap ( $body ) . find ( '#visualizer- json-conclude ' ) . click ( ) . then ( ( ) => {
148
+ cy . wrap ( $body ) . find ( '#json-chart-button ' ) . click ( ) . then ( ( ) => {
136
149
cy . wait ( Cypress . env ( 'wait' ) ) ;
137
150
cy . wrap ( $body ) . find ( '#settings-button' ) . click ( ) ;
138
151
} ) ;
0 commit comments