Skip to content

test(ui): cover namespace switching, access mode and deletion in e2e - #7311

Merged
gustavosbarreto merged 3 commits into
masterfrom
test/ui/namespaces-e2e
Oct 2, 2026
Merged

gustavosbarreto merged 3 commits into
masterfrom
test/ui/namespaces-e2e

Conversation

@luizhf42

@luizhf42 luizhf42 commented Oct 2, 2026

Copy link
Copy Markdown
Member

Summary

Covers the five Playwright cases of Domain 5 (Namespaces) in the e2e use case map in shellhub-io/team#243.

Namespaces                                                         community  enterprise  cloud
  switching drops the previous namespace's data and loads the new one's  -       ✓          ✓
  SSH access mode
    switching to identity seeds the owner's access policy              ✓        ✓          ✓
    switching to identity keeps existing policies without seeding another ✓     ✓          ✓
Secure vault
  switching namespace locks the vault                                  -        ✓          ✓
Billing
  a namespace with an active subscription is deleted only once it is canceled  -   -    ✓
ui/apps/console/e2e/
├── helpers.ts          # findRow, createTeamWithOwnerInAnother
├── api.ts              # createApiKey
├── api-keys.spec.ts    # uses findRow
├── members.spec.ts     # uses findRow and createApiKey
├── namespaces.spec.ts  # new
├── vault.spec.ts       # switching namespace locks the vault
└── billing.spec.ts     # delete refused while subscribed

The API key query key has no tenant, so only removeQueries in enterNamespace keeps one namespace's keys off another's page. The switch test holds the key list request and checks the previous namespace's keys are gone while it is pending.

The map's billing case says "cleanup runs", but cloud has no cleanup on delete. It refuses the delete with a 402 while the subscription is active and allows it once canceled, so that is what the test checks. The case will be retitled in the issue.

Evidence

  • Before: with the removeQueries call in enterNamespace disabled, the switch test fails. With the vault lock on switch disabled, the vault test fails. Without the Stripe cancel, the billing test fails on the final empty namespace list.
    After: with the code as is, --repeat-each=3 on the new tests passes 6 on community, 12 on enterprise and 15 on cloud. The full suites pass 30 on community and 66 on cloud.

Merge Danger

Door: two-way

Blast Radius: tests

Only e2e files change.

The members, API key and vault specs each built these by hand, and the
namespace tests that follow need all three.
Covers the switching and SSH access mode cases of Domain 5 in the e2e
use case map in shellhub-io/team#243.

The API key query key carries no tenant, so only the `removeQueries`
call in `enterNamespace` keeps one namespace's keys off another's page.
The switch test holds the key list request and checks the previous
namespace's keys are gone while it is pending. The hold is set before
the switch because the switch fetches the new namespace's keys at once.
If the cache were kept, the keys would still be fresh, no request would
fire, and the test would fail waiting for it instead of on the row.

The vault lock test reaches the vault through the sidebar. Any page
load locks the vault by itself, so a `goto` would pass even if the
switch stopped locking it.
Covers the cloud namespace deletion case of Domain 5 in the e2e use
case map in shellhub-io/team#243. The map expects a billing cleanup on
delete, but cloud has none: it refuses the delete with a 402 while the
subscription is active and allows it once the subscription is canceled,
so the test checks that.

The test stores the Stripe customer on the fixture's owner because the
teardown can no longer read it from a deleted namespace. It reloads the
page after canceling so the second attempt starts without the first
refusal's dialog state. Reading the owner's namespaces logs in again
each time, because the token issued for the deleted namespace gets a
401.
@luizhf42
luizhf42 requested a review from a team as a code owner October 2, 2026 20:30
@github-actions

github-actions Bot commented Oct 2, 2026 •

Copy link
Copy Markdown

Code Review Complete

The automated review ran but did not post an updated summary — this usually means no new issues were found since the previous review. If you've pushed changes and want a fresh pass, comment /review.

View job

@gustavosbarreto
gustavosbarreto merged commit 7b9ab37 into master Oct 2, 2026
48 checks passed
@gustavosbarreto
gustavosbarreto deleted the test/ui/namespaces-e2e branch October 2, 2026 22:52
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.

2 participants