Tests
The demo branch adds a few test helpers that guard the demo layout and prove the normal test suite needs no network access.
Viewer layout regression tests
Both tests run in the npm project under Build/ (Node version from
Build/.):
npm run -C Build test:demo # both
npm run -C Build test:layout # navigation-row layout
npm run -C Build test:fullscreen # fullscreen map height
They render the real stylesheets and scripts in headless Chrome and assert:
- ``test:layout`` (
Build/): in the kiosk-fullscreen layout the navigation row stays on one line and the fixed style-selector widget does not overlap the navigation or the toolbox frame. A nativeDemo/ test- nav- layout. mjs <select>sizes itself to its widest option, so long page labels are the shape that makes the page pill overflow the sidebar and wrap. - ``test:fullscreen`` (
Build/): it loads the realDemo/ test- fullscreen- map- height. mjs Pageand replays "page reloaded while in fullscreen, then the user leaves fullscreen", asserting the map container keeps a non-zero height (leaving fullscreen must not collapse the map to 0px and hide the page image).View. js
Both exit non-zero on failure and skip (exit 0) if no Chrome/Chromium is
available (override the binary with the $CHROME environment variable).
Run them before committing changes to Build/,
Build/ or Resources/.
Offline test runner
Build/ runs the unit and functional suites with
the machine's network disabled, to prove they need no external connection. It
uses the already-installed vendor/ directory and the Docker images from
Build/ (no pulls, no composer):
Build/Test/runOfflineTests.sh # PHP 8.4 (default)
PHP_VERSION=8.2 Build/Test/runOfflineTests.sh # PHP 8.2
PHP_VERSION=8.5 Build/Test/runOfflineTests.sh # PHP 8.5
When Docker is provided by Podman (e.g. on macOS) two temporary local
workarounds are applied to Build/ (Podman cannot
resolve host- and does not support links:); the file is
restored afterwards in all cases. The full output is written to a temporary
log file whose location is printed at the end; the exit code is 0 only if both
suites passed.