Skip to content

Add e2e test for device deletion with connected users #1520

@juan-malbeclabs

Description

@juan-malbeclabs

The smart contract already prevents deleting a device that still has connected users by relying on the reference counter. However, this behavior is not yet validated in the end-to-end (e2e) test suite.

We need to extend the e2e tests to ensure:

  • Devices with active user connections cannot be deleted.
  • The reference counter is enforced correctly.
  • Once all users are disconnected, device deletion succeeds.

Acceptance Criteria:

  • Create an e2e test case that:
    1. Connects one or more users to a device.
    2. Attempts to delete the device and asserts the deletion fails with the expected error.
    3. Disconnects all users.
    4. Retries the deletion and asserts the device is successfully removed.
  • Ensure the test runs reliably and covers both the fail and success scenarios.

Additional Notes:

  • This test guarantees that the existing logic is preserved and prevents regressions.
  • It complements unit tests by validating behavior at the integration level.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions