Skip to content

bug: E2E test "owner can re-invite" fails due to ambiguous button selector #133

@zacharias-ona

Description

@zacharias-ona

Description

The E2E test Workspace member management › owner can re-invite and invited user can accept (e2e/members.spec.ts:139) fails with a Playwright strict mode violation. The selector getByRole('button', { name: /invite/i }) matches two buttons:

  1. The "Invite" submit button
  2. The "Revoke invite for ..." button (which also contains "invite" in its aria-label)

This causes the test to fail before the re-invite action can complete, which also prevents 3 dependent tests from running.

This is a test selector issue, not a production bug.

Acceptance Criteria

  • getByRole('button', { name: /invite/i }) is replaced with a more specific selector (e.g. getByRole('button', { name: 'Invite', exact: true }))
  • E2E test owner can re-invite and invited user can accept passes
  • The 3 dependent member management tests that were skipped also pass
  • pnpm lint && pnpm typecheck && pnpm test pass

Technical Notes

  • Failing test: e2e/members.spec.ts:147
  • Error: strict mode violation: getByRole('button', { name: /invite/i }) resolved to 2 elements
  • Root cause: The regex /invite/i matches both the "Invite" submit button and the "Revoke invite for ..." button visible on the page after a previous invite was sent
  • Fix: Use { name: 'Invite', exact: true } or target by type="submit"
  • First observed during post-merge verification of PR fix(editor): wrap dispatchCommand in editor.update() to prevent read-only errors #129

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions