Commit Graph

11 Commits

Author SHA1 Message Date
Scott Idem
f95243a9c7 fix(leads): disable sign-in submit until exhibit loads; add licensed-user auth tests
Prevents silent no-op when user clicks submit before lq__exhibit_obj is ready
(exhibit not yet written to Dexie). Button now shows 'Loading...' spinner while
the exhibit record is resolving, eliminating the two-tap workaround needed on
first page load.

Also adds 7 Playwright tests for licensed user sign-in (leads_licensed_signin.test.ts)
covering success path, wrong credentials, email/identity tagging on captured leads,
identity isolation between staff members, and returning-session bypass.

Helpers: attach_leads_routes/setup_leads_test_page now accept exhibit_overrides
(e.g. license_li_json) to inject licensed users into mocked API responses.
seed_leads_loc import added to leads_auth.test.ts multi-exhibit test.

Total leads test coverage: 29 tests.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-06 17:04:57 -04:00
Scott Idem
d340bbbe94 test: seed ae_leads_loc; update badge tests and helpers; docs: note Leads migration 2026-04-03 17:47:10 -04:00
Scott Idem
a952c5ddbe docs(leads): document Leads store migration and payment UI fix; note tests update 2026-04-03 17:33:23 -04:00
Scott Idem
512e5ef87c Saving more code clean up and removal 2026-03-24 11:15:01 -04:00
Scott Idem
81741919a8 refactor: extract seed_trusted_session + setup_badge_test_page into shared test helpers
All 4 badge test files had identical ~35-line beforeEach blocks (pageerror listener,
inline V3 route mocks, addInitScript localStorage seed). Replaced with two helpers
in minimal_v3_mocks.ts:

  seed_trusted_session(page, event_id, account_id?)
    — seeds ae_loc localStorage with trusted/manager auth via addInitScript;
      account_id defaults to testing_account_id

  setup_badge_test_page(page, event_id)
    — one-call beforeEach: pageerror listener + attach_minimal_v3_routes +
      seed_trusted_session

Each test file's beforeEach is now 1-3 lines. All 12 tests still pass.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-18 17:05:22 -04:00
Scott Idem
af02e38528 test: badge E2E tests — fix __version wipe, extract idb_helpers, add render + workflow tests
Root cause fix: tests/_helpers/ae_defaults.ts was missing __version: 1, causing
store_versions.ts to wipe ae_loc from localStorage on every test page load. This
made trusted_access fall back to false, hiding the print button (can_print guard)
and failing all attendee workflow tests.

Changes:
- ae_defaults.ts: add __version: 1 with comment explaining the store_versions guard
- idb_helpers.ts: extract inject_badge_and_template() from print layout test into
  shared helper; now used by all three print/render test files
- event_badge_render.test.ts: new — 4 tests covering full_name_override priority,
  full_name fallback, duplex=0 hides badge back, duplex=1 shows badge back
- event_badge_attendee_workflow.test.ts: cleaned up (diagnostic code removed);
  all 3 tests now pass
- event_badge_print_layout.test.ts: renamed from badge_print_layout.test.ts;
  inline inject_idb() replaced with shared idb_helpers import
- event_badge_smoke.test.ts: renamed from event_badge.test.ts
- playwright.config.ts: use system /usr/bin/chromium on Arch Linux (avoids
  Playwright's bundled Chromium which requires Ubuntu libs not present on Arch)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-18 16:58:55 -04: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
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
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
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
c70e7a3bf9 test: add badge interaction test + README; ignore disabled tests in Playwright config 2026-02-24 16:32:50 -05:00