-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
a94847a
commit 7e351d1
Showing
5 changed files
with
107 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
38 changes: 38 additions & 0 deletions
38
test/e2e/elements/mapml-viewer/mapml-viewer-unknown-projection.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
|
||
<head> | ||
<title>Basic Mapml-Viewer</title> | ||
<meta charset="UTF-8"> | ||
<script type="module" src="mapml-viewer.js"></script> | ||
<style> | ||
html { | ||
height: 100% | ||
} | ||
|
||
body { | ||
height: inherit | ||
} | ||
|
||
* { | ||
margin: 0; | ||
padding: 0; | ||
} | ||
</style> | ||
</head> | ||
|
||
<body> | ||
<mapml-viewer data-testid="testviewer" style="height: 600px;width:500px;" projection="CBMTILE" zoom="0" lat="47" lon="-92" controls> | ||
<layer- data-testid="testlayer" label="CBMT - INLINE" checked> | ||
<map-meta name="zoom" content="min=0,max=25"></map-meta> | ||
<map-extent units="CBMTILE" checked hidden> | ||
<map-input name="zoomLevel" type="zoom" value="3" min="0" max="3" ></map-input> | ||
<map-input name="row" type="location" axis="row" units="tilematrix" min="14" max="21" ></map-input> | ||
<map-input name="col" type="location" axis="column" units="tilematrix" min="14" max="19" ></map-input> | ||
<map-link rel='tile' tref='/data/cbmt/{zoomLevel}/c{col}_r{row}.png' ></map-link> | ||
</map-extent> | ||
</layer-> | ||
</mapml-viewer> | ||
</body> | ||
|
||
</html> |
28 changes: 28 additions & 0 deletions
28
test/e2e/elements/mapml-viewer/mapml-viewer-unknown-projection.test.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
import { test, expect, chromium } from '@playwright/test'; | ||
|
||
test.describe('Playwright mapml-viewer issue-980 test', () => { | ||
let page; | ||
let context; | ||
test.beforeAll(async () => { | ||
context = await chromium.launchPersistentContext(''); | ||
page = | ||
context.pages().find((page) => page.url() === 'about:blank') || | ||
(await context.newPage()); | ||
await page.goto('mapml-viewer-unknown-projection.html'); | ||
await page.waitForTimeout(500); | ||
}); | ||
|
||
test.afterAll(async function () { | ||
await context.close(); | ||
}); | ||
|
||
test('mapml-viewer projection set to unknown prj errors to console', async () => { | ||
let message; | ||
page.on('pageerror', exception => message = exception.message); | ||
const viewer = page.getByTestId('testviewer'); | ||
await viewer.evaluate((v) => (v.projection = 'unknown')); | ||
// update the projection attribute on the viewer | ||
await page.waitForTimeout(5000); | ||
expect(message).toBe("Undefined projection: unknown"); | ||
}); | ||
}); |