Organization profile
A member of the active organization opens its profile from OrganizationSwitcher's Manage organization, renames the organization, sees its members, invites people, and reaches its verified domains. Which rows and tabs show depends on the member's permissions in the organization.
Sub-features
profileshows the creator every row of the profile:Update profileunder the organization's name,Members,Verified domains,Leave organization, andDelete organization.Verified domainsshows theAdd domainrow.Membersshows the creator, markedYou, on theMemberstab,No invitations sentonInvitations, andNo membership requestsonRequests.invitation-sentsends an invitation to a new+clerk_testaddress fromInviteon the Members screen, and the address shows on theInvitationstab.renamechanges the organization's name onUpdate profile, and the profile shows the new name.org-domains-emptyshowsNo verified domains.and noAdd domainto a member whose role can read domains but not manage them.org-requestsshows a request to join on theRequeststab, withAcceptandReject, from a user who signed up with an address at the organization's verified domain.
How to get to it (user POV)
- With an organization active, tap the OrganizationSwitcher, then
Manage organization. The profile opens full screen with the titleOrganization. - From the profile, tap
Update profile,Members, orVerified domains. On the Members screen, the three tabs are at the top andInviteis at the top right.
Driving it with verify
Preconditions:
The first three tests seed a
+clerk_testuser on the standard instance, sign in with a ticket, and create an organization from the switcher withsignInWithNewOrganizationfromspecs/compose.ts. The last two seed the organization withhost.seedOrganization, and the seeded organization is active when a member signs in with a ticket. The user who creates an organization holds theorg:adminrole (creator_roleinsrc/core/instances/base.jsonof@clerk/internal-mobile-e2e), which has every permission. The standard settings turn on domains, allow three members, and let an admin delete the organization.Profile. Run
e2e-tests/bin/control-clerk-android run organization-profile. The first test opensManage organization, expects the organization's name and the five rows, and takes screenshotorg-profile. It opensVerified domains, expectsAdd domainand noNo verified domains., takes screenshotverified-domains, and goes back. It opensMembers, expectsYou, takes screenshotmembers, then opensInvitationsand expectsNo invitations sent, and opensRequestsand expectsNo membership requests.Invitation. The second test opens
Members, tapsInvite, fillsEnter email addresseswithhost.newEmail(), tapsSend invitations, opensInvitations, and expects the address. Screenshotinvitation-sent.Rename. The third test taps
Update profile, replaces the text inclerk.organization.profileForm.namewith anotherhost.newOrganizationName(), and tapsclerk.organization.profileForm.submit. It expects the form gone and the new name on the profile. Screenshotorg-renamed.Domains reader. The fourth test seeds an admin and a reader, and an organization with the reader as
org:e2e_domains_reader. It signs the reader in, expects the organization's name on the switcher, taps it, tapsManage organization, opensVerified domains, and expectsNo verified domains.and noAdd domain. Screenshotorg-domains-empty.Request to join. The fifth test seeds an admin and an organization with
suggestDomain: true. It signs up a new user through the full-screen AuthView withhost.newEmail({ domain: org.domain }), the run password, and the test code. That user taps the switcher, tapsRequest to joinon the suggestion, and expectsPending approval. Then it signs the admin in, opensManage organization,Members, andRequests, and expects the requester's email,Accept,Reject, and noNo membership requests. Screenshotorg-requests.Proof.
profile.e2e.tspasses.org-profileandorg-renamedshow the organization's name,membersshows the creator's email markedYou,invitation-sentshows the invited address, andorg-requestsshows the requester's address withAcceptandReject. The two domains screens show no name or email:verified-domainsshowsAdd domain, andorg-domains-emptyshowsNo verified domains.downdeletes the application, and every organization and invitation goes with it.
States a spec cannot reach
host.seedOrganization adds other members and the org:e2e_domains_reader role, so the tests above reach No verified domains. and a non-empty Requests tab. These states are still out of reach:
| State | Where the app decides | Why |
|---|---|---|
No members sections are available. on Members |
OrganizationMembersView.kt: the viewer has no tab |
Unreachable by design. The viewer has no tab when they can neither read nor manage memberships, and the same check hides the Members row in root/OrganizationProfileRows.kt, so the profile never opens this screen in that state. Only a role revoked while the screen is open shows it, for a moment. |
No members found. on the Members tab |
OrganizationMembersView.kt: the list is empty and the search field is empty |
Nothing a role gives: the viewer is always in the list. It shows only after the members request fails. A search that matches no one shows No members found without the period. |
Seeding also reaches these states, and no spec drives them yet: the Members screen with no tab row (it shows only when the member can see two or more of Members, Invitations, and Requests) and no Invite, and no Update profile or Delete organization, for the org:e2e_domains_reader member; another member's row, with changing their role and removing them, for an admin with a second member.
A change to a state no spec reaches is shown on a build with a local change that is not part of the pull request, and the pull request says so. Name the change and the screens it affects, and keep the spec in specs/explored/.
Gotchas
- No row, tab, or button of the profile has a test tag except the name, slug, and submit of
Update profile, which share theclerk.organization.profileForm.*tags with the create form. The spec finds rows and tabs by text with{ exact: true }and taps them withhost.tap(middleOf(...)).Membersis both a row and a tab label, and the Members screen's title. Verified domainsshows only when the instance has domains on and the member can read or manage them. On the standard instance the creator always sees it.- The
Requeststab shows only when the instance has domains on and the member can manage memberships (OrganizationMembersState.kt). On the standard instance the creator always sees it. - Back from
Verified domainsreturns to the profile. The spec taps the top bar's back arrow withhost.back(). - The Members row of the creator shows the email twice, as the name and the identifier, because a seeded user has no name. The email can be cut off on screen, but the screen tree holds all of it, so
getByText(email)finds it. A row on theRequeststab shows the requester's email twice too, so the spec takes the first match withgetByText(email).first(). - The slug of an organization comes from its name, and Clerk refuses a slug that another organization in the instance holds with "That slug is taken. Please try another." The message shows in a snackbar that closes itself, and the create form stays. Every test in a run shares the run id, and so does every attempt of a test that
--retriesruns again. Name each organization withhost.newOrganizationName(), which claims a word for the run on this machine and adds the run tag, asHarbor 7c1e. No other test of the run and no retry gets that word, so a retry does not create the slug its first attempt took.