mirror of
https://github.com/Azgaar/Fantasy-Map-Generator.git
synced 2026-02-04 17:41:23 +01:00
Test/add e2e and unit testing (#1282)
Some checks failed
Deploy static content to Pages / deploy (push) Has been cancelled
Some checks failed
Deploy static content to Pages / deploy (push) Has been cancelled
* feat: add string utility tests and vitest browser configuration * feat: add Playwright for end-to-end testing and update snapshots - Introduced Playwright for E2E testing with a new configuration file. - Added test scripts to package.json for running E2E tests. - Updated package-lock.json and package.json with new dependencies for Playwright and types. - Created new SVG snapshot files for various layers (ruler, scaleBar, temperature, terrain, vignette, zones) to support visual testing. - Excluded e2e directory from TypeScript compilation. * Apply suggestions from code review Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Add SVG layer snapshots for various components - Added ruler layer snapshot with hidden display. - Added scale bar layer snapshot with detailed structure and styling. - Added temperature layer snapshot with opacity and stroke settings. - Added terrain layer snapshot with ocean and land heights groups. - Added vignette layer snapshot with mask and opacity settings. - Added zones layer snapshot with specified opacity and stroke settings. * fix: update Playwright browser installation command to use npx * Update snapshots * refactor: remove unused layer tests and their corresponding snapshots as fonts are unpredictable --------- Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
This commit is contained in:
parent
c590c168f4
commit
9903f0b9aa
38 changed files with 963 additions and 6 deletions
1
tests/e2e/layers.spec.ts-snapshots/anchors.html
Normal file
1
tests/e2e/layers.spec.ts-snapshots/anchors.html
Normal file
File diff suppressed because one or more lines are too long
1
tests/e2e/layers.spec.ts-snapshots/armies.html
Normal file
1
tests/e2e/layers.spec.ts-snapshots/armies.html
Normal file
|
|
@ -0,0 +1 @@
|
|||
<g id="armies" font-size="6" box-size="3" stroke="#000" stroke-width="0.3" fill-opacity="1"></g>
|
||||
1
tests/e2e/layers.spec.ts-snapshots/biomes.html
Normal file
1
tests/e2e/layers.spec.ts-snapshots/biomes.html
Normal file
|
|
@ -0,0 +1 @@
|
|||
<g id="biomes" mask="url(#land)"></g>
|
||||
1
tests/e2e/layers.spec.ts-snapshots/borders.html
Normal file
1
tests/e2e/layers.spec.ts-snapshots/borders.html
Normal file
File diff suppressed because one or more lines are too long
1
tests/e2e/layers.spec.ts-snapshots/cells.html
Normal file
1
tests/e2e/layers.spec.ts-snapshots/cells.html
Normal file
|
|
@ -0,0 +1 @@
|
|||
<g id="cells" stroke="#808080" stroke-width="0.1"></g>
|
||||
1
tests/e2e/layers.spec.ts-snapshots/coastline.html
Normal file
1
tests/e2e/layers.spec.ts-snapshots/coastline.html
Normal file
|
|
@ -0,0 +1 @@
|
|||
<g id="coastline"><g id="sea_island" opacity="0.5" stroke="#1f3846" stroke-width="0.7" filter="url(#dropShadow)" auto-filter="1" style="filter: none;"><use href="#feature_2" data-f="2"></use><use href="#feature_3" data-f="3"></use><use href="#feature_4" data-f="4"></use><use href="#feature_5" data-f="5"></use><use href="#feature_6" data-f="6"></use><use href="#feature_15" data-f="15"></use></g><g id="lake_island" opacity="1" stroke="#7c8eaf" stroke-width="0.35"></g></g>
|
||||
1
tests/e2e/layers.spec.ts-snapshots/compass.html
Normal file
1
tests/e2e/layers.spec.ts-snapshots/compass.html
Normal file
|
|
@ -0,0 +1 @@
|
|||
<g id="compass" opacity="0.8" mask="url(#water)" shape-rendering="optimizespeed" style="display: none;"><use xlink:href="#defs-compass-rose" transform="translate(80 80) scale(0.25)"></use></g>
|
||||
1
tests/e2e/layers.spec.ts-snapshots/coordinates.html
Normal file
1
tests/e2e/layers.spec.ts-snapshots/coordinates.html
Normal file
|
|
@ -0,0 +1 @@
|
|||
<g id="coordinates" opacity="1" data-size="12" font-size="12" stroke="#d4d4d4" stroke-width="1" stroke-dasharray="5"></g>
|
||||
1
tests/e2e/layers.spec.ts-snapshots/cultures.html
Normal file
1
tests/e2e/layers.spec.ts-snapshots/cultures.html
Normal file
|
|
@ -0,0 +1 @@
|
|||
<g id="cults" opacity="0.6" stroke="#777777" stroke-width="0.5"></g>
|
||||
1
tests/e2e/layers.spec.ts-snapshots/emblems.html
Normal file
1
tests/e2e/layers.spec.ts-snapshots/emblems.html
Normal file
|
|
@ -0,0 +1 @@
|
|||
<g id="emblems" opacity="0.9" stroke-width="1" style="display: none;"><g id="burgEmblems" data-size="1"></g><g id="provinceEmblems" data-size="1"></g><g id="stateEmblems" data-size="1"></g></g>
|
||||
1
tests/e2e/layers.spec.ts-snapshots/ice.html
Normal file
1
tests/e2e/layers.spec.ts-snapshots/ice.html
Normal file
File diff suppressed because one or more lines are too long
1
tests/e2e/layers.spec.ts-snapshots/icons.html
Normal file
1
tests/e2e/layers.spec.ts-snapshots/icons.html
Normal file
File diff suppressed because one or more lines are too long
1
tests/e2e/layers.spec.ts-snapshots/labels.html
Normal file
1
tests/e2e/layers.spec.ts-snapshots/labels.html
Normal file
|
|
@ -0,0 +1 @@
|
|||
<g id="labels" style="display: inline;"><g id="states" opacity="1" fill="#3e3e4b" stroke="#3a3a3a" stroke-width="0" style="text-shadow: white 0px 0px 4px" letter-spacing="0" data-size="22" font-size="22" font-family="Almendra SC"></g><g id="addedLabels" opacity="1" fill="#3e3e4b" stroke="#3a3a3a" stroke-width="0" style="text-shadow: white 0px 0px 4px" letter-spacing="0" data-size="18" font-size="18" font-family="Almendra SC"></g><g id="burgLabels"><g opacity="1" fill="#3e3e4b" style="text-shadow: white 0px 0px 4px" letter-spacing="0" data-size="2" font-size="2" font-family="Almendra SC" data-dy="-0.4" id="hamlet" class="hidden"></g><g opacity="1" fill="#3e3e4b" style="text-shadow: white 0px 0px 4px" letter-spacing="0" data-size="3" font-size="3" font-family="Almendra SC" data-dy="-0.4" id="village" class="hidden"></g><g opacity="1" fill="#3e3e4b" style="text-shadow: white 0px 0px 4px" letter-spacing="0" data-size="2" font-size="2" font-family="Almendra SC" data-dy="-0.5" id="trading_post" class="hidden"></g><g opacity="1" fill="#3e3e4b" style="text-shadow: white 0px 0px 4px" letter-spacing="0" data-size="2" font-size="2" font-family="Almendra SC" data-dy="-0.5" id="caravanserai" class="hidden"></g><g opacity="1" fill="#3e3e4b" style="text-shadow: white 0px 0px 4px" letter-spacing="0" data-size="2" font-size="2" font-family="Almendra SC" data-dy="-0.5" id="monastery" class="hidden"></g><g opacity="1" fill="#3e3e4b" style="text-shadow: white 0px 0px 4px" letter-spacing="0" data-size="2" font-size="2" font-family="Almendra SC" data-dy="-0.5" id="fort" class="hidden"></g><g opacity="1" fill="#3e3e4b" style="text-shadow: white 0px 0px 4px" letter-spacing="0" data-size="4" font-size="4" font-family="Almendra SC" data-dy="-0.4" id="town" class="hidden"></g><g opacity="1" fill="#3e3e4b" style="text-shadow: white 0px 0px 4px" letter-spacing="0" data-size="5" font-size="5" font-family="Almendra SC" data-dy="-0.4" id="city" class="hidden"></g><g opacity="1" fill="#3e3e4b" style="text-shadow: white 0px 0px 4px" letter-spacing="0" data-size="6" font-size="6" font-family="Almendra SC" data-dy="-0.5" id="capital"></g></g></g>
|
||||
1
tests/e2e/layers.spec.ts-snapshots/lakes.html
Normal file
1
tests/e2e/layers.spec.ts-snapshots/lakes.html
Normal file
|
|
@ -0,0 +1 @@
|
|||
<g id="lakes"><g id="freshwater" opacity="0.5" fill="#a6c1fd" stroke="#5f799d" stroke-width="0.7"><use href="#feature_7" data-f="7"></use><use href="#feature_8" data-f="8"></use><use href="#feature_9" data-f="9"></use><use href="#feature_10" data-f="10"></use><use href="#feature_11" data-f="11"></use><use href="#feature_12" data-f="12"></use><use href="#feature_13" data-f="13"></use><use href="#feature_14" data-f="14"></use></g><g id="salt" opacity="0.5" fill="#409b8a" stroke="#388985" stroke-width="0.7"></g><g id="sinkhole" opacity="1" fill="#5bc9fd" stroke="#53a3b0" stroke-width="0.7"></g><g id="frozen" opacity="0.95" fill="#cdd4e7" stroke="#cfe0eb" stroke-width="0"></g><g id="lava" opacity="0.7" fill="#90270d" stroke="#f93e0c" stroke-width="2" filter="url(#crumpled)"></g><g id="dry" opacity="1" fill="#c9bfa7" stroke="#8e816f" stroke-width="0.7"></g></g>
|
||||
1
tests/e2e/layers.spec.ts-snapshots/landmass.html
Normal file
1
tests/e2e/layers.spec.ts-snapshots/landmass.html
Normal file
|
|
@ -0,0 +1 @@
|
|||
<g id="landmass" opacity="1" fill="#eef6fb"><rect x="0" y="0" width="1280" height="720"></rect></g>
|
||||
1
tests/e2e/layers.spec.ts-snapshots/markers.html
Normal file
1
tests/e2e/layers.spec.ts-snapshots/markers.html
Normal file
|
|
@ -0,0 +1 @@
|
|||
<g id="markers" rescale="1"></g>
|
||||
1
tests/e2e/layers.spec.ts-snapshots/ocean.html
Normal file
1
tests/e2e/layers.spec.ts-snapshots/ocean.html
Normal file
File diff suppressed because one or more lines are too long
1
tests/e2e/layers.spec.ts-snapshots/population.html
Normal file
1
tests/e2e/layers.spec.ts-snapshots/population.html
Normal file
|
|
@ -0,0 +1 @@
|
|||
<g id="population" stroke-width="1.6" stroke-linecap="butt"><g id="rural" stroke="#0000ff"></g><g id="urban" stroke="#ff0000"></g></g>
|
||||
1
tests/e2e/layers.spec.ts-snapshots/precipitation.html
Normal file
1
tests/e2e/layers.spec.ts-snapshots/precipitation.html
Normal file
|
|
@ -0,0 +1 @@
|
|||
<g id="prec" stroke="#000000" stroke-width="0" fill="#003dff" style="display: none;"><g id="wind"><text text-rendering="optimizeSpeed" x="1228" y="60.904999999999994">⇇</text><text text-rendering="optimizeSpeed" x="20" y="187.95">⇉</text><text text-rendering="optimizeSpeed" x="1228" y="305.625">⇇</text><text text-rendering="optimizeSpeed" x="1228" y="428.15">⇇</text><text text-rendering="optimizeSpeed" x="20" y="547.8299999999999">⇉</text><text text-rendering="optimizeSpeed" x="1228" y="661.2449999999999">⇇</text><text text-rendering="optimizeSpeed" x="640" y="42">⇊</text><text text-rendering="optimizeSpeed" x="640" y="700">⇈</text></g></g>
|
||||
1
tests/e2e/layers.spec.ts-snapshots/provinces.html
Normal file
1
tests/e2e/layers.spec.ts-snapshots/provinces.html
Normal file
|
|
@ -0,0 +1 @@
|
|||
<g id="provs" opacity="0.7" fill="#000000" font-size="10" font-family="Georgia"></g>
|
||||
1
tests/e2e/layers.spec.ts-snapshots/regions.html
Normal file
1
tests/e2e/layers.spec.ts-snapshots/regions.html
Normal file
File diff suppressed because one or more lines are too long
1
tests/e2e/layers.spec.ts-snapshots/relief.html
Normal file
1
tests/e2e/layers.spec.ts-snapshots/relief.html
Normal file
|
|
@ -0,0 +1 @@
|
|||
<g id="terrain" set="simple" size="1" density="0.4"></g>
|
||||
1
tests/e2e/layers.spec.ts-snapshots/religions.html
Normal file
1
tests/e2e/layers.spec.ts-snapshots/religions.html
Normal file
|
|
@ -0,0 +1 @@
|
|||
<g id="relig" opacity="0.7" stroke="#777777" stroke-width="0"></g>
|
||||
1
tests/e2e/layers.spec.ts-snapshots/rivers.html
Normal file
1
tests/e2e/layers.spec.ts-snapshots/rivers.html
Normal file
File diff suppressed because one or more lines are too long
1
tests/e2e/layers.spec.ts-snapshots/routes.html
Normal file
1
tests/e2e/layers.spec.ts-snapshots/routes.html
Normal file
File diff suppressed because one or more lines are too long
1
tests/e2e/layers.spec.ts-snapshots/temperature.html
Normal file
1
tests/e2e/layers.spec.ts-snapshots/temperature.html
Normal file
|
|
@ -0,0 +1 @@
|
|||
<g id="temperature" font-size="8px" fill="#000000" fill-opacity="0.3" stroke-width="1.8"></g>
|
||||
1
tests/e2e/layers.spec.ts-snapshots/terrain.html
Normal file
1
tests/e2e/layers.spec.ts-snapshots/terrain.html
Normal file
|
|
@ -0,0 +1 @@
|
|||
<g id="terrs"><g id="oceanHeights" data-render="0" opacity="1" scheme="bright" terracing="0" skip="0" relax="1" curve="curveBasisClosed"></g><g id="landHeights" opacity="1" scheme="bright" terracing="0" skip="5" relax="0" curve="curveBasisClosed" mask="url(#land)"></g></g>
|
||||
1
tests/e2e/layers.spec.ts-snapshots/zones.html
Normal file
1
tests/e2e/layers.spec.ts-snapshots/zones.html
Normal file
|
|
@ -0,0 +1 @@
|
|||
<g id="zones" opacity="0.6" stroke="#333333" stroke-width="0" stroke-linecap="butt"></g>
|
||||
Loading…
Add table
Add a link
Reference in a new issue