Skip to content

Commit

Permalink
fix e2e dataviz service
Browse files Browse the repository at this point in the history
  • Loading branch information
mind84 committed Aug 31, 2023
1 parent eb5b191 commit 057c381
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
10 changes: 8 additions & 2 deletions lizmap/www/assets/js/dataviz/dataviz.js
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,12 @@ var lizDataviz = function() {
*
*/
async function getPlot(plot_id, exp_filter, target_id) {
if ($('#' + target_id).length == 0) {
return;
}

// Show the infinite progress bar
$('#' + target_id).prev('.dataviz-waiter:first').show();

exp_filter = typeof exp_filter !== 'undefined' ? exp_filter : null;
target_id = typeof target_id !== 'undefined' ? target_id : new Date().valueOf()+btoa(Math.random()).substring(0,12);
Expand Down Expand Up @@ -154,8 +160,8 @@ var lizDataviz = function() {
}

// Build plot
var plot = buildPlot(target_id, dv.plots[plot_id]['cache']);
$('#'+target_id).prev('.dataviz-waiter:first').hide();
buildPlot(target_id, dv.plots[plot_id]['cache']);
$('#' + target_id).prev('.dataviz-waiter:first').hide();

return true;
}
Expand Down
4 changes: 2 additions & 2 deletions tests/end2end/cypress/integration/dataviz-ghaction.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ describe('Dataviz tests', function () {
})
}).as('getMap')

cy.intercept('*request=getPlot*',
cy.intercept('*/dataviz/service*',
{ middleware: true },
(req) => {
req.on('before:response', (res) => {
Expand Down Expand Up @@ -202,4 +202,4 @@ describe('Dataviz tests', function () {
})
})
})
})
})

0 comments on commit 057c381

Please sign in to comment.