diff --git a/cypress/component/VisualTest.cy.js b/cypress/component/VisualTest.cy.js index 4ccd4a25..033aceae 100644 --- a/cypress/component/VisualTest.cy.js +++ b/cypress/component/VisualTest.cy.js @@ -1,5 +1,5 @@ /* eslint-disable no-alert, no-console */ -const ERROR_TOLERANCE = 0.00384; +const ERROR_TOLERANCE = parseFloat(Cypress.env('ERROR_TOLERANCE')); // Ref: flatmap-viewer/src/layers/styling.ts const STROKE_INTERPOLATION = [ 'interpolate', @@ -104,7 +104,7 @@ describe('MultiFlatmapVuer Screenshot Comparison', () => { // Test with saved screenshot from fixture cy.get('@viewerCanvas').compareSnapshot('test-canvas').then(comparisonResults => { - expect(comparisonResults.percentage, 'Viewer map should match test-canvas.png exactly').to.equal(0); + expect(comparisonResults.percentage, 'Viewer map should be almost identical.').to.be.lessThan(ERROR_TOLERANCE); }); // NOTE: disable base map comparison for now diff --git a/src/services/flatmapLoader.js b/src/services/flatmapLoader.js index ad313219..be341d53 100644 --- a/src/services/flatmapLoader.js +++ b/src/services/flatmapLoader.js @@ -1,6 +1,6 @@ /** * a single source for the flatmap-viewer library import */ -import * as flatmap from 'https://cdn.jsdelivr.net/npm/@abi-software/flatmap-viewer@4.4.2/+esm'; +import * as flatmap from 'https://cdn.jsdelivr.net/npm/@abi-software/flatmap-viewer@4.4.3/+esm'; export default flatmap;