Commit Graph

36 Commits

Author SHA1 Message Date
Scott Idem
283ccb3ce4 Tests: fix IDAA recovery meeting test suite
Multiple failures caused by the SWR background fetch pattern and
collapsed UI sections:

1. IDB settle wait: add waitForFunction that polls IndexedDB for
   tmp_sort_1 on the event record. tmp_sort_1 is only written by
   _process_generic_props, so its presence signals the background
   API fetch has completed and no further liveQuery re-fires will
   overwrite form inputs the test is about to fill.

2. JSON.parse for _json fields: update_ae_obj_v3 auto-serializes any
   key ending in _json to a JSON string before sending the PATCH.
   Tests now parse location_address_json, attend_json, and
   contact_li_json from the captured body before asserting field values.

3. Contact 2 section: collapsed by default when contact_2.full_name
   and email are null. Collapsed state renders type='hidden' inputs
   which Playwright's fill() rejects. Add click on the 'Contact 2
   (Optional)' toggle before filling those fields.

4. Admin Options section: same collapse pattern. Add click on the
   'Admin Options' toggle before filling status/sort/group/hide fields.

5. Increase suite timeout to 60 s: open_edit_form awaits real lookup
   API responses (pass_through_lookups=true) which can take 20-25 s
   on slow network, leaving no margin at the default 30 s limit.
2026-03-10 14:23:01 -04:00
Scott Idem
8247c62d0e test(idaa): IDAA recovery meeting edit form Playwright test suite + README docs
Full payload-verification test suite for ae_idaa_comp__event_obj_id_edit_v2.

Root cause fixed: $ae_loc.lu_time_zone_list empty at mount caused Svelte 5 to
render <input type=text name=timezone required value=''> instead of the <select>
branch. HTML5 required validation silently cancelled onsubmit with no JS error
and zero network activity — waitForRequest timed out with no obvious cause.
Fix: pre-seed lu_time_zone_list in addInitScript so the <select> branch renders
on first mount with a valid value already set.

Key patterns established:
- setup_idaa_auth(): pre-seeds ae_loc + ae_idaa_loc in localStorage via
  addInitScript; includes lu_time_zone_list and window.__ae_test_mode = true
- setup_api_mocks(): selective pass-through flags for lookups and site_domain
- open_edit_form(): waitForFunction guards for name field, country lists, and
  the timezone required field before any interaction
- capture_patch_body(): registers waitForRequest before click, awaits after

README.md updated with deep-dive section covering:
- HTML5 form validation silent block and how to diagnose it
- Svelte 5 one-time value= bind trap
- addInitScript store pre-seeding pattern
- __ae_test_mode email suppression
- waitForFunction patterns for reactive state
- Route mock strategy (pass-through vs fixture)
2026-03-09 17:54:01 -04:00
Scott Idem
dd5cf9b63b chore: minor updates across events, journals, elements, and shared components
Miscellaneous small changes to events (badges, launcher, leads, pres_mgmt,
settings), journals, reusable elements (crud, field editor), app components,
core components, and test README. Mostly 1-2 line changes per file.
2026-03-06 17:32:53 -05:00
Scott Idem
bdf3260c74 test: fix IDAA recovery meetings test — real backend save works
- Fix site_domain mock to return array { data: [mock_site_domain] } so
  ae_api.headers['x-account-id'] gets a valid 11-char account_id.
  Previously returned { data: {} } causing layout to fall back to 'ghost'
  (5 chars) and the real API PATCH rejected the request with 422.
- Add integration test describe block (Real Backend Save) with
  pass_through_event_patch option to let PATCH reach the real API.
- Extract localStorage injection into setup_idaa_auth() helper.
- Fix test name: 'sends PUT' → 'sends PATCH' (the API uses PATCH).
- All 14 tests pass.
2026-03-06 16:59:39 -05:00
Scott Idem
94c974d7fb test: add Playwright tests for IDAA Recovery Meetings edit form
13 tests covering: form render, form sections, field names/types,
weekday checkboxes, timing inputs, contact fields, address fieldset
visibility, virtual checkbox, text input, and PATCH API submission.
All tests pass (13/13). Fully mocked — no real backend required.
2026-03-05 22:01:30 -05:00
Scott Idem
73597cb8b4 chore: svelte-check cleanup — fix Svelte 5 patterns in events/pres_mgmt, badges, launcher, and tests
Source changes (0 errors, 175 warnings after):
- api_post__crud_obj_v3: add backward-compat migration aliases (for_obj_type/id, obj_type/id) to nested CRUD funcs
- ae_events__event_device/presenter/session: make event_id/presentation_id optional; fall back to store value
- element_ae_obj_field_editor_v3: import type Snippet properly; mark current_value as $bindable()
- ae_comp__badge_obj_view: fix $derived(() => false) → $derived(false) for show_receipt/show_tickets
- badge templates: pass explicit event_id param to delete/update calls
- launcher/+page: capture URL params as stable consts; pass event_id to update_ae_obj__event_device
- ae_comp__event_device_obj_li: wrap setInterval in $effect; onDestroy cleanup always registered
- ae_comp__event_device_obj_li_wrapper: move console.log to $effect; fix self-closing tag
- presenter form/menu/view/list: add missing event_presentation_id to all update/delete calls
- reports/locations/presenter/+page: move store assignments into $effect + untrack; ae_acct → $derived
- session/+page: add Comp_event_presenter_form_agree import; cast for type compat
- session_view: wrap <img onclick> in <button> for accessibility/validity
- ae_comp__event_presentation_obj_li: remove unneeded event_id/session_id from create_ae_obj__event_presenter
- ae_comp__event_session_obj_li: make lq prop optional; add plain-array fallback prop
- location/+page: refactor to $derived ae_acct, $effect+untrack for stores, simplified session/file sections
- location_page_menu: add optional data prop; export interface

Tests:
- Rename ae_events__event_badge.spec.ts → ae_events__event_badge.test.ts (extended coverage)
- All test files: 'warn' → 'warning' (Playwright API), addInitScript array-destructure pattern, import type fixes
- ae_defaults: remove duplicate hide_app_cfg key; meaningful sponsorship cfg_id placeholder
- create_event_badge.spec: fix import path to use $lib alias
- event_presenter.test: fix test URL to use /presenter/:id route

NOTE: location/+page.svelte — Element_manage_event_file_li_wrap no longer receives
allow_basic/allow_moderator (now default false); file list shows but management
actions may be restricted. Follow-up needed to restore auth__kv-based access.
2026-03-05 20:05:35 -05:00
Scott Idem
911a427757 docs: add IDAA client module doc, minor whitespace cleanup
- CLIENT__IDAA_and_customized_mods.md: New comprehensive doc covering IDAA
  architecture, all 4 submodules (Archives, BB, Recovery Meetings, Jitsi),
  Novi UUID auth system, permission levels, state stores, iframe integration,
  and testing requirements. Reverse-engineered from source 2026-02-26.
- MODULE__AE_Events_Badges.md: trailing whitespace only
- tests/README.md: blank line only
2026-02-26 18:50:20 -05:00
Scott Idem
f5e98b8c0d fix(tests): fix all 4 failing badge data integrity tests
- Badge search mock: was checking nested URL /v3/crud/event/{id}/event_badge/search
  but search_ae_obj_v3 uses flat path /v3/crud/event_badge/search
- Template list mock: was checking nested path, fixed to flat /v3/crud/event_badge_template/
  with for_obj_id query param (matches get_ae_obj_li_v3 behavior)
- Badge objects: add _random ID fields (event_badge_id_random, id_random, event_id_random)
  required for Dexie IDB processing
- Template edit assertion: input[value*=...] CSS checks HTML attribute not DOM property;
  Svelte bind:value sets DOM property only — fix to use getByLabel('Template Name')
- Relax null body check: the debug panel footer can contain 'null' legitimately
2026-02-26 18:08:25 -05:00
Scott Idem
5a16772639 feat(badges): auto-navigate to badge search after print 2026-02-26 17:36:45 -05:00
Scott Idem
d1ded2d45e test(badges): pass attendee workflow test (edit → print → return)
- Add data-testid to badge edit/save/cancel/print buttons and professional title input
- Fix API mock routes (badge GET uses /v3/crud/event_badge/{id}, not nested)
- Add badge_template mock so badge view renders
- Add event_badge_id_random and id_random fields to all mock responses
- Split workflow test into its own test() instead of being inline in beforeEach
- Use data-testid selectors throughout for stability
2026-02-26 17:28:08 -05:00
Scott Idem
657a7122b8 docs(test): update workflow test comments for multi-word search
Test continues to use 'scott idem' (full name) now that backend
supports multi-word search with AND logic. Updated status notes.
2026-02-26 17:08:58 -05:00
Scott Idem
ba10b8f996 test: add attendee badge workflow test (WIP)
- Simulates complete check-in: navigate → search → view → edit → print → return
- Mocks V3 API for event, badge search, and PATCH operations
- Tests override field editing (professional_title_override)
- Documents future attendee review feature (email link workflow)

**STATUS: WIP** - Search results not displaying in test environment
- API mocks configured correctly
- IDB cleared properly, schema managed by app
- Store initialization includes qry__remote_first flag
- Issue: Badge list not rendering after search (timing or store issue)
-  Screenshot saved to test-results/ for debugging
2026-02-26 17:01:10 -05:00
Scott Idem
5514d579d0 test: centralize demo IDs and site_domain mock in env.ts
- Added testing_site_id, testing_site_domain_id, testing_fqdn, testing_person_id
- Created mock_site_domain object matching +layout.ts expectations
- Updated minimal_v3_mocks.ts to use mock_site_domain
- Fixes 'Domain Not Registered' overlay in Playwright tests
- All test IDs now documented with comments from tests/README.md
2026-02-26 16:43:36 -05:00
Scott Idem
b28595dad8 fix(badges): return processed data from all badge API functions
CRITICAL FIX (same pattern as event_file fix):
- search__event_badge(): Now returns processed_obj_li instead of unprocessed result_li
- load_ae_obj_id__event_badge(): Returns processed object after IDB save
- load_ae_obj_li__event_badge(): Returns processed list after IDB save
- create_ae_obj__event_badge(): Returns processed object after IDB save
- update_ae_obj__event_badge(): Returns processed object after IDB save

Pattern: All functions now return what was actually saved to IDB (processed data)
This ensures consistency between API return values and IDB cached data.

TEST IMPROVEMENTS:
- Add full_name field to badge mock data (not just full_name_override)
- Ensures mock data matches real API structure
2026-02-26 15:59:25 -05:00
Scott Idem
a91c648c61 test: standardize naming conventions to snake_case
- Rename demo_event_id → testing_event_id (more explicit)
- Rename demo_account_id → testing_account_id (matches convention)
- Rename demo_badge_id → event_badge_id (descriptive)
- Rename demo_template_id → event_badge_template_id (explicit)
- Update all test files for consistency (15 files)
- Enhance README with organized test data sections
- Update person IDs to match README test data
- No regression: 15 tests passing, 7 pre-existing failures unchanged
2026-02-26 15:43:31 -05:00
Scott Idem
2c289e39de test(badges): Add badge cold-start and data integrity tests
- Add coldstart_event_badges_list.test.ts: badge list on empty IDB
- Add event_badge_data_integrity.test.ts: field mapping, templates, Electron compatibility
- 6 of 12 badge tests passing (3 original + 3 new)
- Tests cover: CRUD, interactions, cold-start, Electron bridge graceful degradation
- Ready for client demo
2026-02-26 14:57:08 -05:00
Scott Idem
fd5c36f836 Test: Add Playwright test for session cold-start bug fix
New test validates that presentations AND presenters render on first
navigation when IndexedDB is empty (cold-start scenario).

Test Configuration:
- Demo Session: DOW3h7v6H42 (703) 'How To Do Things'
- Demo Presentation: 7U2eXSjR6H4 (1670) 'Build a House'
- Demo Presenter: gT-hxnifb-0 (2202) 'Bob The Builder'

Tests:
1. UI visibility: Session name, presentation, and presenter all visible
2. IDB integrity: Verifies all nested data written to IndexedDB

Both tests passing - confirms fix works correctly.
2026-02-26 13:47:07 -05:00
Scott Idem
b1162b9f08 I am done. Just saving things for the night. Not a good day. 2026-02-25 20:17:03 -05:00
Scott Idem
95a56d25bf test: stabilize cold-start Playwright tests; fix editor bind:new_content fallback 2026-02-25 20:15:09 -05:00
Scott Idem
197adff33b tests: add Playwright event badge CRUD + interaction tests; add minimal V3 mocks and env helper; update presenter/badge smoke tests to use helpers; convert test locals to snake_case 2026-02-24 17:49:43 -05:00
Scott Idem
39614c9cc2 test: remove stale tests/disabled/example.test.ts 2026-02-24 16:45:45 -05:00
Scott Idem
a7f6101cce test: move and rename private-network check to tests/private_network.test.ts; make diagnostic 2026-02-24 16:42:10 -05:00
Scott Idem
f2c426b595 test: combine and modernize private-network checks; remove legacy disabled variants 2026-02-24 16:38:36 -05:00
Scott Idem
7f9f93765d test: modernize v3 API security tests (mock /v3/, deterministic headers); add runnable modern copy 2026-02-24 16:36:27 -05:00
Scott Idem
c70e7a3bf9 test: add badge interaction test + README; ignore disabled tests in Playwright config 2026-02-24 16:32:50 -05:00
Scott Idem
e57bbca33e Work on CORS testing and fixes. Chrome and pfSense with the DNS resolution found a problem. Should be fixed now. 2026-02-23 18:18:58 -05:00
Scott Idem
30e44a0af1 Testing tests with Playwright 2026-02-21 10:05:21 -05:00
Scott Idem
399455b67a feat(testing): Add foundational Playwright security test
Adds the first successful, stable Playwright integration test for the SvelteKit frontend. This test serves as a template for future UI/UX and integration tests.

Key outcomes and learnings captured in this test:
- Establishes a pattern for running tests against the high-speed 'npm run dev' server.
- Verifies critical API security header logic, including the unauthenticated bypass for lookups and account ID scavenging from localStorage.
- Solves application boot crashes in a test environment by injecting a complete, default 'ae_loc' state object into localStorage before the app hydrates.
- Demonstrates the correct, race-condition-free pattern for waiting on network requests that are handled by API mocks.

This commit also removes the old, unreliable Node.js-based scripts ('verify_jwt_logic.js', 'verify_jwt_sync.js') that these new tests replace.
2026-02-20 19:43:01 -05:00
Scott Idem
88bc18cf15 fix(core): resolve 68 compiler errors and stabilize Svelte 5 reactivity
- Fixed 'Captured initial value' warnings in 65+ components by implementing
  proper sync effects with 'untrack' and derived states.
- Hardened Event Settings JSON editors using a temporary string-buffer pattern
  to safely decouple object-based data from CodeMirror's string requirements.
- Resolved strict TypeScript mismatches across core routes (Accounts, Sites, etc.)
  and improved property indexing safety in views.
- Patched Flowbite-Svelte Drawer transitions for Svelte 5 compatibility using
  prop spreading.
- Added comprehensive safety comments to high-risk reactivity blocks.
- Synchronized 'ae_types.ts' with V3 backend models.
2026-02-08 16:05:35 -05:00
Scott Idem
25d6503afe Environment & Bootstrap Stability: Fix Ghost Account and Modernize PWA Manifest
- Resolved 'Ghost Account' warning by updating layout hydration to align with V3 ID Vision (account_id vs account_id_random).
- Improved site lookup reliability using Agent API Key and structured EQ filters for exact FQDN matching (including ports).
- Modernized PWA manifest with maskable icons (PNG/WebP), app shortcuts, and unique installation IDs.
- Implemented automatic Electron 'Native' mode detection in root layout.
- Fixed stale API URLs in Launcher native file download logic.
- Added V3 migration documentation and JWT verification test scripts.
2026-01-20 18:22:14 -05:00
Scott Idem
0987cd6ad9 style: Apply Prettier formatting with 4-space indentation
Applied consistent code formatting across the project using Prettier, now configured to use 4-space indentation instead of tabs.
2025-11-18 18:40:50 -05:00
Scott Idem
7e1eaba3bc feat: Migrate ESLint to flat config and resolve initial linting errors
Migrated the ESLint configuration to the new flat config format ()
and addressed several initial linting errors.

Key changes include:
- Updated ESLint configuration to treat  as warnings instead of errors.
- Fixed  errors in  by declaring  and .
- Corrected  error in  by using  instead of an out-of-scope .
- Resolved  error in  by replacing the undefined  directive with the  component.
- Addressed  errors in  by replacing  with  and  with .
- Fixed  errors in  by importing necessary modules (, , ) and adding missing props (, , , , ).
2025-11-17 18:46:54 -05:00
Scott Idem
a3b37a5df4 refactor: Standardize data processing and update to Svelte 5 runes
This commit introduces a major refactoring of the data processing logic across multiple modules (events, archives, posts, sponsorships) to use a standardized pattern with . This improves consistency and maintainability.

Key changes:
- Replaced module-specific data processing with a generic helper.
- Removed deprecated  functions.
- Updated Svelte components to leverage the new Svelte 5 runes, simplifying state management.
- Fixed linting errors and updated test configurations.
- Added .
2025-11-17 16:38:54 -05:00
Scott Idem
c4fa35e86e Saving the new documentation for Svelte and Dexie made by Gemini. Saving changes made by Gemini to fix various things. 2025-11-17 14:09:33 -05:00
Scott Idem
5a147a98bb I am done for the night... 2024-03-08 00:09:17 -05:00
Scott Idem
17d99d080c Starting a new template using Svelte, SvelteKit, Tailwind, and Skeleton. 2024-02-15 09:49:35 -05:00