Skip to content

test(e2e): Add ownership transfer test for invited user signup#912

Merged
timothyfroehlich merged 1 commit intomainfrom
test/invite-ownership-transfer-e2e
Feb 2, 2026
Merged

test(e2e): Add ownership transfer test for invited user signup#912
timothyfroehlich merged 1 commit intomainfrom
test/invite-ownership-transfer-e2e

Conversation

@timothyfroehlich
Copy link
Owner

Summary

  • Adds E2E test verifying invited user → machine owner → signup flow correctly transfers ownership
  • Test verifies the "(Invited)" suffix is removed after user completes signup
  • Fixes cleanup API FK constraint issue when deleting users who own machines

Changes

  • Added data-testid="owner-select" to OwnerSelect component for test targeting
  • Fixed cleanup API to clear machine ownership references before deleting users
  • Added ownership transfer test in e2e/full/invite-signup.spec.ts

Test plan

  • Test passes on all browsers (chromium, firefox, mobile chrome)
  • All existing invite-signup tests still pass
  • pnpm run check passes

🤖 Generated with Claude Code

Closes beads-2ig

Adds E2E test verifying that when an invited user is assigned as a
machine owner and then completes signup, the ownership transfers
correctly without "(Invited)" suffix showing.

Also fixes:
- Added data-testid="owner-select" to OwnerSelect component
- Fixed cleanup API to clear machine ownership before deleting users
  (prevents FK constraint violations)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings February 2, 2026 04:12
@vercel
Copy link

vercel bot commented Feb 2, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
pin-point Ready Ready Preview, Comment Feb 2, 2026 4:14am

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds an E2E test that validates a critical user journey: ensuring that when an invited user is assigned as a machine owner before completing signup, the ownership properly transfers to their real user account after signup, and the "(Invited)" suffix is removed from the display.

Changes:

  • Added data-testid="owner-select" to support test targeting of the owner dropdown in multi-occurrence scenarios
  • Fixed FK constraint violation in cleanup API by clearing machine ownership references before deleting users
  • Added comprehensive ownership transfer E2E test covering invite → assign ownership → signup → verify transfer

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.

File Description
src/components/machines/OwnerSelect.tsx Adds test-id to owner select dropdown for stable E2E targeting (follows best practice for repeated elements)
src/app/api/test-data/cleanup/route.ts Fixes FK constraint issue by nullifying machine ownership fields before deleting users, preventing cascade deletion failures
e2e/full/invite-signup.spec.ts Adds ownership transfer test verifying invited user → machine owner → signup flow correctly transfers ownership and removes "(Invited)" suffix


// 3. Logout and complete signup
await logout(page);

Copy link

Copilot AI Feb 2, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This hard-coded delay should include an explanatory comment like the one on line 82-83 of this file. The comment should explain that this delay allows backend processing time for email transmission and that getSignupLink performs internal polling. This helps future maintainers understand why the delay is necessary.

Suggested change
// Allow backend processing time for the invitation email to be transmitted.
// getSignupLink performs internal polling against Mailpit to retrieve the message.

Copilot uses AI. Check for mistakes.
@timothyfroehlich timothyfroehlich merged commit f34fa4b into main Feb 2, 2026
26 checks passed
@timothyfroehlich timothyfroehlich deleted the test/invite-ownership-transfer-e2e branch February 2, 2026 04:26
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