Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tiles 6597 empty styles #37

Merged
merged 3 commits into from
Jul 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
},
Expand Down
10 changes: 10 additions & 0 deletions test/puppeteer/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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: {},
};
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified test/screenshots/__screenshots__/plugin/add_hexagon-snap.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
17 changes: 11 additions & 6 deletions test/screenshots/plugin.screen.ts
Original file line number Diff line number Diff line change
@@ -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';
Expand All @@ -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,
},
Expand All @@ -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' });
});
Expand Down Expand Up @@ -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,
},
},
Expand Down
Loading