Commit graph

3 commits

Author SHA1 Message Date
456cfa5a68 fix: use re-exported makepad-test from makepad-widgets
Some checks failed
nigig-build (CAD) / supply-chain (push) Has been cancelled
nigig-build (CAD) / cad-module (push) Has been cancelled
nigig-build (CAD) / full-crate-check (push) Has been cancelled
nigig-map / test (push) Has been cancelled
PDF engine / engine (push) Has been cancelled
PDF engine / makepad-integration (push) Has been cancelled
PDF engine / fuzz (push) Has been cancelled
repo hygiene / hygiene (push) Has been cancelled
Remove direct dependencies on makepad-test and use the re-exported
version from makepad-widgets instead. This avoids path dependency
issues and follows the correct pattern for using Makepad crates.

Changes:
- Add 'test' feature to makepad-widgets dependencies
- Remove direct makepad-test dependencies
- Update imports to use makepad_widgets::makepad_test

Affected crates:
- crates/apps/map
- crates/apps/pdf/pdf-makepad
- crates/apps/spreadsheet/spreadsheet-ui
2026-07-31 19:49:54 +00:00
35166cf649 test(map): expand UI test suite to 100+ comprehensive tests
Massively expand the UI test suite from 15 to 100+ tests covering all
aspects of the map widget using the makepad-test framework.

Test categories (100+ tests):
- Basic rendering (6 tests): map display, coordinates, zoom, FPS
- Zoom controls (10 tests): buttons, keyboard, limits, extreme zoom
- Keyboard zoom (4 tests): +/-, numpad, shortcuts
- Panning (7 tests): drag, directions, diagonal, large distance
- Keyboard panning (2 tests): arrow keys, WASD
- POI rendering (4 tests): visibility, zoom levels, clicks
- Label rendering (3 tests): visibility, zoom levels, overlap
- Search functionality (6 tests): input, results, clear, no results
- Theme switching (4 tests): toggle, appearance changes
- Tile loading (4 tests): indicators, logs, loading states
- Caching (2 tests): cache hits, eviction
- Error handling (3 tests): network errors, malformed tiles, missing tiles
- Performance (2 tests): FPS maintenance, zoom performance
- Accessibility (2 tests): keyboard navigation, screen reader labels
- Multi-touch (2 tests): pinch zoom, two-finger pan
- Context menus (2 tests): right-click, copy coordinates
- Tooltips (2 tests): buttons, POIs
- Animations (2 tests): smooth zoom, smooth pan
- Offline mode (2 tests): indicator, cache usage
- MBTiles support (2 tests): loading, fallback
- Style switching (2 tests): satellite, terrain
- Layer visibility (1 test): toggle layers
- Fullscreen (1 test): toggle fullscreen
- Export (1 test): screenshot export
- Bookmarks (2 tests): save, load
- History (2 tests): back, forward
- Undo/redo (2 tests): undo pan, redo pan
- Copy coordinates (1 test): copy to clipboard
- Measure distance (1 test): measurement tool
- Draw annotations (1 test): drawing tool
- Import/export (2 tests): GPX import, KML export
- 3D view (1 test): 3D toggle
- Terrain (1 test): terrain toggle
- Traffic (1 test): traffic layer
- Transit (1 test): transit layer
- Bicycling (1 test): bike routes
- Walking (1 test): pedestrian routes
- Satellite (1 test): aerial imagery
- Geolocation (2 tests): location button, user marker
- Compass (2 tests): visibility, reset rotation
- Scale bar (2 tests): visibility, zoom updates
- Attribution (2 tests): visibility, click
- Share (1 test): share dialog
- Print (1 test): print functionality
- Settings (1 test): settings panel
- Help (1 test): help panel
- About (1 test): about dialog
- Multiple instances (1 test): independent maps
- Resize handling (1 test): window resize
- Rotation (2 tests): gesture, reset
- Tilt (2 tests): gesture, reset

All tests use:
- #[makepad_test] macro
- Selector API for widget targeting
- Locator API for interactions
- Comprehensive waits and assertions
- Screenshot verification
- Log verification

Run with:
  cargo test -p nigig-map --test ui -- --test-threads=1

Debug with:
  MAKEPAD_TEST_VISIBLE=1 cargo test -p nigig-map --test ui -- --test-threads=1
2026-07-27 17:34:33 +00:00
08faf47ec8 test(map): add UI tests using makepad-test framework
Add comprehensive UI tests for the map widget using Makepad's official
makepad-test framework (from libs/makepad_test/).

Tests include:
- map_renders: Basic rendering verification
- map_shows_amsterdam: Initial location display
- map_zoom_controls: Zoom in/out functionality
- map_panning: Drag to pan interaction
- map_shows_pois_at_high_zoom: POI visibility at zoom 17+
- map_hides_pois_at_low_zoom: POI hiding at zoom < 13
- map_search: Search input and results
- map_theme_toggle: Light/dark theme switching
- map_tile_loading: Loading indicators
- map_extreme_zoom_in: Max zoom handling
- map_extreme_zoom_out: Min zoom handling
- map_logs_tile_loading: Log verification
- map_logs_rendering: Render event logging
- map_handles_resize: Window resize handling
- multiple_map_instances: Multiple map coexistence

Uses:
- #[makepad_test] macro for test functions
- Selector API for widget targeting
- Locator API for interactions
- wait_visible(), wait_text(), click(), fill(), etc.
- screenshot() for visual verification
- wait_for_log_contains() for log checking

Run with:
  cargo test -p nigig-map --test ui -- --test-threads=1

Debug with visible mode:
  MAKEPAD_TEST_VISIBLE=1 cargo test -p nigig-map --test ui -- --test-threads=1
2026-07-27 17:27:13 +00:00