diff --git a/package.json b/package.json index c753d36..3a9c1e1 100644 --- a/package.json +++ b/package.json @@ -17,6 +17,7 @@ "prettier:write": "prettier --write \"./**/*.{ts,tsx,js,json,html,css,md}\"", "lint": "tslint -p tsconfig.json 'src/**/*.ts' 'demo/**/*.ts'", "test:screenshots": "webpack --test && TEST_SUITE=screenshots jest --forceExit --projects test/screenshots --colors", + "test:screenshots:update": "webpack --test && TEST_SUITE=screenshots jest --forceExit --projects test/screenshots --colors -u", "test:screenshots:watch": "webpack --test && TEST_SUITE=screenshots jest --forceExit --watchAll --projects test/screenshots --colors", "test:screenshots:no-headless": "webpack --test && NO_HEADLESS=true TEST_SUITE=screenshots jest --forceExit --projects test/screenshots --colors" }, diff --git a/test/puppeteer/utils.ts b/test/puppeteer/utils.ts index 0698a5a..0956c7f 100644 --- a/test/puppeteer/utils.ts +++ b/test/puppeteer/utils.ts @@ -92,3 +92,13 @@ export async function makeSnapshot( export async function waitForMapReady(page: PuppeteerPage) { await page.waitForFunction(() => window.map.isIdle()); } + +export const emptyStyle = { + version: 1, + name: '', + background: { + color: '#f5f2e0', + }, + layers: [], + icons: {}, +}; diff --git a/test/screenshots/__screenshots__/plugin/add_and_delete_hexagon-snap.png b/test/screenshots/__screenshots__/plugin/add_and_delete_hexagon-snap.png index 4fbf049..f83a527 100644 Binary files a/test/screenshots/__screenshots__/plugin/add_and_delete_hexagon-snap.png and b/test/screenshots/__screenshots__/plugin/add_and_delete_hexagon-snap.png differ diff --git a/test/screenshots/__screenshots__/plugin/add_hexagon-snap.png b/test/screenshots/__screenshots__/plugin/add_hexagon-snap.png index c0d3dc4..0b8e031 100644 Binary files a/test/screenshots/__screenshots__/plugin/add_hexagon-snap.png and b/test/screenshots/__screenshots__/plugin/add_hexagon-snap.png differ diff --git a/test/screenshots/__screenshots__/plugin/resize_viewport-snap.png b/test/screenshots/__screenshots__/plugin/resize_viewport-snap.png index 92b3066..41590b3 100644 Binary files a/test/screenshots/__screenshots__/plugin/resize_viewport-snap.png and b/test/screenshots/__screenshots__/plugin/resize_viewport-snap.png differ diff --git a/test/screenshots/plugin.screen.ts b/test/screenshots/plugin.screen.ts index 7877332..6d063a9 100644 --- a/test/screenshots/plugin.screen.ts +++ b/test/screenshots/plugin.screen.ts @@ -1,11 +1,12 @@ import { pageSetUp, Page } from '../puppeteer'; -import { API_KEY, DEFAULT_STYLE } from '../puppeteer/config'; +import { API_KEY } from '../puppeteer/config'; import { makeScreenshotsPath, makeSnapshot, initMapWithOptions, defaultFontsPath, waitForMapReady, + emptyStyle, } from '../puppeteer/utils'; import { HexagonLayer } from '@deck.gl/aggregation-layers/typed'; import * as puppeteer from 'puppeteer'; @@ -16,7 +17,8 @@ describe('Base tests', () => { beforeEach(async () => { page = await pageSetUp(); await initMapWithOptions(page, { - style: DEFAULT_STYLE, + //@ts-ignore + style: emptyStyle, styleOptions: { fontsPath: defaultFontsPath, }, @@ -30,9 +32,12 @@ describe('Base tests', () => { await waitForMapReady(page); await page.evaluate(() => { window.polyline = new window.Polyline(window.map, { - coordinates: [[59, 24], [59.296872, 24.261885]], + coordinates: [ + [59, 24], + [59.296872, 24.261885], + ], }); - }) + }); await page.evaluate(() => { window.deckgl = window.initDeck(window.map, window.Deck, { antialiasing: 'msaa' }); }); @@ -70,13 +75,13 @@ describe('Base tests', () => { }, { point: { - lon: 59.299030, + lon: 59.29903, lat: 24.254414, }, }, { point: { - lon: 59.299030, + lon: 59.29903, lat: 24.254413, }, },