Skip to content

test(calendar): e2e coverage for M2 promote-external flow - #280

Merged
h4yfans merged 1 commit into
mainfrom
elegant-kepler-66fbe5
Apr 19, 2026
Merged

test(calendar): e2e coverage for M2 promote-external flow#280
h4yfans merged 1 commit into
mainfrom
elegant-kepler-66fbe5

Conversation

@h4yfans

@h4yfans h4yfans commented Apr 19, 2026

Copy link
Copy Markdown
Collaborator

Summary

Adds end-to-end Playwright coverage for the only M1/M2/M3 user-visible flow that lacked it: clicking an externally-owned Google calendar event and promoting it into a native Memry event.

M1 (correctness fixes) and M3 (etag + field-clock conflict resolution) are entirely internal to the sync layer — their unit suites in `sync-service.test.ts`, `field-merge-calendar.test.ts`, `onboarding.test.ts`, and `promote-external-event.test.ts` already exercise every branch with a mocked `GoogleCalendarClient`. M2's promote flow is the one path that crosses main ↔ renderer ↔ DB and needed regression protection at the Playwright layer.

What changed

  • New `apps/desktop/tests/e2e/calendar-promote-external.e2e.ts` — 5 tests, BDD-style `#given/#when/#then` naming, `data-testid`-first selectors:
    1. Click imported chip → promote dialog appears with the M2 copy ("Edit this event in Memry?").
    2. Cancel → dialog closes, no popover, imported chip still present.
    3. Confirm → dialog closes, edit popover opens pre-populated with the external title.
    4. Rename after promote + save → renamed chip appears on the calendar.
    5. `promoteConfirmDismissed=true` in settings → dialog skipped, popover opens directly.
  • Replaced the pre-M2 `test.skip` placeholder in `apps/desktop/tests/e2e/calendar-comprehensive.e2e.ts` with a comment pointing to the new file.

Reuses the existing `seedCalendarProjection` test hook — no new test infrastructure.

Test plan

  • `pnpm typecheck:node` passes
  • `pnpm test` full unit suite: 7005 passed / 1 skipped (unchanged baseline)
  • `pnpm test:e2e` filtered to `calendar-promote-external`: 5 passed (30.7s) on first run against the existing M2 implementation
  • CI green on full `test:e2e`

Notes for reviewer

  • All five tests passed on the very first run — no implementation changes were needed, so this is pure regression protection for M2's user-visible contract.
  • The new file doesn't duplicate unit coverage: `promote-external-event.test.ts` already asserts row shape, binding ownership mode, mirror archival, and idempotency. The E2E asserts the user-visible flow (dialog copy, click wiring, popover population, persistence to the calendar view).

Add Playwright coverage for the M2 user-visible path that clicking an
externally-owned Google event surfaces the promote confirmation dialog,
and confirming it opens the edit popover on the newly-promoted native
calendar_events row. Five tests cover: dialog copy, cancel, confirm,
rename-and-save after promote, and the promoteConfirmDismissed shortcut.

Also replace the pre-M2 test.skip placeholder in calendar-comprehensive
with a pointer to the new file now that the interaction contract is
finalized.

Internal correctness (binding ownership, mirror archival, idempotency,
412 retries, 410 recovery, field-clock merges) remains covered by the
existing unit suites; this change only closes the E2E gap.
@h4yfans
h4yfans merged commit 8adb196 into main Apr 19, 2026
5 checks passed
@h4yfans
h4yfans deleted the elegant-kepler-66fbe5 branch April 19, 2026 07:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant