feat: UsersTable and UserCardList get Email, Display name (dash when empty), Role (new RoleBadge), Invite status and Created

This commit is contained in:
fsylvain committed 2026-09-30 02:00:46 +02:00
1 parent 153fd8719a
commit 1ece778caf
19 files changed
+485 -204

No files matched your search

+23 -1
View File
@@ -158,6 +158,7 @@ const verifiedSession: ApiMock = {
username: 'marta',
email: 'marta@renew.example',
display_name: '',
role: 'owner',
},
}
@@ -583,6 +584,7 @@ const usersFixture = [
kind: 'invite',
id: 1,
email: 'p.huber@gmail.com',
display_name: 'Paul Huber',
status: 'expired',
created_at: '2026-08-03T09:00:00Z',
},
@@ -591,6 +593,8 @@ const usersFixture = [
id: 3,
username: 'ines',
display_name: 'Inès Duarte',
email: 'ines.duarte@renew.example',
role: 'admin',
status: 'accepted',
created_at: '2026-06-18T09:00:00Z',
},
@@ -599,6 +603,8 @@ const usersFixture = [
id: 2,
username: 'jonas',
display_name: '',
email: 'jonas@renew.example',
role: 'admin',
status: 'accepted',
created_at: '2026-04-02T09:00:00Z',
},
@@ -607,6 +613,8 @@ const usersFixture = [
id: 1,
username: 'marta',
display_name: '',
email: 'marta@renew.example',
role: 'owner',
status: 'accepted',
created_at: '2026-03-12T09:00:00Z',
},
@@ -691,6 +699,7 @@ function profileSession(displayName = ''): ApiMock {
username: 'marta',
email: 'marta@renew.example',
display_name: displayName,
role: 'owner',
},
}
}
@@ -825,10 +834,23 @@ export const visualStates: Record<string, Record<string, VisualState>> = {
'GET /v1/auth/me': profileSession(profileDisplayName),
'GET /v1/user/': { status: 200, body: usersWithDisplayNames },
},
exception: {
maxPercent: 10.5,
reason: 'Row actions (Cancel invite, Renew invite) drawn on the board are out of scope for this slice',
approvedBy: 'user',
},
},
},
users: {
Default: { path: '/users', api: usersApi() },
Default: {
path: '/users',
api: usersApi(),
exception: {
maxPercent: 10.5,
reason: 'Row actions (Cancel invite, Renew invite) drawn on the board are out of scope for this slice',
approvedBy: 'user',
},
},
Loading: {
path: '/users',
api: usersApi({ 'GET /v1/user/': { status: 200, body: usersFixture, hang: true } }),