Skip to content

Commit

Permalink
WIP on map-link:
Browse files Browse the repository at this point in the history
- add reftest for 'zinger' rendering bug
  • Loading branch information
prushfor authored and prushfor committed Mar 8, 2024
1 parent 02800f4 commit a4e8172
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 20 deletions.
16 changes: 16 additions & 0 deletions test/e2e/elements/map-feature/map-feature-rendering.test.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import { test, expect, chromium } from '@playwright/test';

test.describe('map-feature rendering tests', () => {
let page;
let context;
test.beforeAll(async function () {
context = await chromium.launchPersistentContext('');
page =
context.pages().find((page) => page.url() === 'about:blank') ||
(await context.newPage());
});
test('Test for zingers', async ({ page }) => {
await page.goto('render-bug.html');
await expect(page).toHaveScreenshot('no-zinger.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.
27 changes: 7 additions & 20 deletions test/e2e/elements/map-feature/render-bug.html
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
</head>
<body>
<mapml-viewer data-testid="viewer" zoom="7" lon="16.53066406" lat="45.21669922" controls>
<layer- label="Bug: coordinates with map-span" checked>
<layer- label="Polygon with map-span" checked>
<map-meta name="cs" content="gcrs"></map-meta>
<map-meta name="projection" content="OSMTILE"></map-meta>
<map-style>.bbox{display:none; stroke:none; fill:none}
Expand All @@ -24,35 +24,22 @@
<map-feature data-testid="span" id="countries.213" class="countries">
<map-geometry cs="gcrs"><map-polygon class="polygon"><map-coordinates><map-span class="bbox">15.76035238 45 16.875 45 16.875 45.24935065</map-span> 16.875 45.24935065 16.79082031 45.196875 16.53066406 45.21669922 16.45351563 45.16201172 16.36503906 45.05834961 16.29335938 45.00883789 16.23105469 45.02661133 16.15732422 45.0722168 16.02832031 45.18959961 15.96318359 45.21079102 15.88828125 45.21572266 15.82285156 45.2027832 15.78808594 45.17895508 15.76152344 45.00751953 15.76035238 45</map-coordinates></map-polygon></map-geometry>
<map-properties>
<h2>zinnger</h2>
<h2>zinger</h2>
</map-properties>
</map-feature>
</layer->
<layer- label="Same feature, no map-spans" >
<layer- label="Same polygon, no map-span" >
<map-meta name="cs" content="gcrs"></map-meta>
<map-meta name="projection" content="OSMTILE"></map-meta>
<map-style>.bbox{display:none; stroke:none; fill:none}
.countries{fill:yellow; stroke: orange}</map-style>
feature below comes from geoserver countries layer
.polygon{fill:yellow; stroke: orange}</map-style>
<map-feature data-testid="no-span" class="countries">
<map-geometry cs="gcrs">
<map-polygon>
18 coordinate pairs
<map-coordinates>15.76035238 45 16.875 45 16.875 45.24935065 16.875 45.24935065 16.79082031 45.196875 16.53066406 45.21669922 16.45351563 45.16201172 16.36503906 45.05834961 16.29335938 45.00883789 16.23105469 45.02661133 16.15732422 45.0722168 16.02832031 45.18959961 15.96318359 45.21079102 15.88828125 45.21572266 15.82285156 45.2027832 15.78808594 45.17895508 15.76152344 45.00751953 15.76035238 45</map-coordinates>
</map-polygon>
</map-geometry>
<map-geometry cs="gcrs"><map-polygon><map-coordinates>15.76035238 45 16.875 45 16.875 45.24935065 16.875 45.24935065 16.79082031 45.196875 16.53066406 45.21669922 16.45351563 45.16201172 16.36503906 45.05834961 16.29335938 45.00883789 16.23105469 45.02661133 16.15732422 45.0722168 16.02832031 45.18959961 15.96318359 45.21079102 15.88828125 45.21572266 15.82285156 45.2027832 15.78808594 45.17895508 15.76152344 45.00751953 15.76035238 45</map-coordinates></map-polygon></map-geometry>
<map-properties>
<h2>zinnger</h2>
<h2>normal</h2>
</map-properties>
</map-feature>
</map-feature>
</layer->
<layer- label="another perhaps" checked="">
<map-style>.bbox{display:none; stroke:none; fill:none}
.polygon{fill:yellow; stroke: orange}</map-style>
<map-meta name="cs" content="gcrs"></map-meta>
<map-meta name="projection" content="OSMTILE"></map-meta>
<map-feature id="countries.192" class="countries"><map-geometry><map-polygon class="polygon"><map-coordinates><map-span class="bbox">17.79409085 0 18.28125 0 18.28125 1.40625 18.00601534 1.40625</map-span> 18.00601534 1.40625 17.90244141 1.11806641 17.88574219 0.85688477 17.92519531 0.53730469 17.88769531 0.23413086 17.79409085 0</map-coordinates></map-polygon></map-geometry></map-feature></layer->

</mapml-viewer>
</body>
</html>

0 comments on commit a4e8172

Please sign in to comment.