diff --git a/.travis.yml b/.travis.yml index 1ccf8c4b..c260e5b9 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,5 +1,5 @@ language: node_js -node_js: "6" +node_js: "8" before_install: - stty cols 80 diff --git a/package-lock.json b/package-lock.json index 3353ddaa..40052ca1 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "orgchart", - "version": "2.1.5", + "version": "2.1.6", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index 9c9ab5cc..a8114651 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "orgchart", - "version": "2.1.6", + "version": "2.1.7", "description": "Simple and direct organization chart(tree-like hierarchy) plugin based on pure DOM and jQuery.", "main": "./dist/js/jquery.orgchart.min.js", "style": [ diff --git a/test/visual-regression/zoom/__image_snapshots__/test-js-orgchart-visual-regression-tests-zoomin-correctly-1-snap.png b/test/visual-regression/zoom/__image_snapshots__/test-js-orgchart-visual-regression-tests-zoomin-correctly-1-snap.png index bf362983..fc23826c 100644 Binary files a/test/visual-regression/zoom/__image_snapshots__/test-js-orgchart-visual-regression-tests-zoomin-correctly-1-snap.png and b/test/visual-regression/zoom/__image_snapshots__/test-js-orgchart-visual-regression-tests-zoomin-correctly-1-snap.png differ diff --git a/test/visual-regression/zoom/__image_snapshots__/test-js-orgchart-visual-regression-tests-zoomout-correctly-1-snap.png b/test/visual-regression/zoom/__image_snapshots__/test-js-orgchart-visual-regression-tests-zoomout-correctly-1-snap.png index 4259698e..aee1b357 100644 Binary files a/test/visual-regression/zoom/__image_snapshots__/test-js-orgchart-visual-regression-tests-zoomout-correctly-1-snap.png and b/test/visual-regression/zoom/__image_snapshots__/test-js-orgchart-visual-regression-tests-zoomout-correctly-1-snap.png differ diff --git a/test/visual-regression/zoom/test.js b/test/visual-regression/zoom/test.js index c14cdd51..72a6daba 100644 --- a/test/visual-regression/zoom/test.js +++ b/test/visual-regression/zoom/test.js @@ -1,9 +1,19 @@ -const { toMatchImageSnapshot } = require("jest-image-snapshot"); +const { toMatchImageSnapshot } = require('jest-image-snapshot'); expect.extend({ toMatchImageSnapshot }); +const config = { + failureThreshold: 0.01, + failureThresholdType: 'percent' +}; + describe('orgchart -- visual regression tests', () => { beforeAll(async () => { + await page.setViewport({ + width: 1680, + height: 450, + deviceScaleFactor: 1, + }); await page.goto( `file:${require('path').join(__dirname, '../../../demo/pan-zoom.html')}` ); @@ -18,7 +28,7 @@ describe('orgchart -- visual regression tests', () => { el.dispatchEvent(syntheticEvent); }); const image = await page.screenshot(); - expect(image).toMatchImageSnapshot(); + expect(image).toMatchImageSnapshot(config); }); it('zoomout correctly', async () => { @@ -31,6 +41,6 @@ describe('orgchart -- visual regression tests', () => { el.dispatchEvent(syntheticEvent); }); const image = await page.screenshot(); - expect(image).toMatchImageSnapshot(); + expect(image).toMatchImageSnapshot(config); }); });