mirror of
https://github.com/BerriAI/litellm.git
synced 2026-10-05 02:41:56 +00:00
test(ui): characterize organization member details
This commit is contained in:
parent
f64479e74d
commit
e2abc274d6
1 changed files with 38 additions and 0 deletions
|
|
@ -156,6 +156,44 @@ test("should display empty state when organization has no members", async () =>
|
|||
});
|
||||
});
|
||||
|
||||
test("should display organization-specific spend and creation details for members", async () => {
|
||||
const createdAt = "2026-01-15T12:00:00.000Z";
|
||||
const orgWithMember = {
|
||||
...mockOrg,
|
||||
members: [
|
||||
{
|
||||
user_id: "user_123",
|
||||
user_email: "member@example.com",
|
||||
user_role: "org_admin",
|
||||
spend: 12.34567,
|
||||
created_at: createdAt,
|
||||
},
|
||||
],
|
||||
};
|
||||
mockUseOrganization.mockReturnValue({ data: orgWithMember, isLoading: false } as unknown as ReturnType<
|
||||
typeof useOrganization
|
||||
>);
|
||||
|
||||
const user = userEvent.setup();
|
||||
renderWithProviders(
|
||||
<OrganizationInfoView
|
||||
organizationId="org_123"
|
||||
onClose={() => {}}
|
||||
accessToken="test-token"
|
||||
is_org_admin={false}
|
||||
is_proxy_admin={false}
|
||||
userModels={[]}
|
||||
editOrg={false}
|
||||
/>,
|
||||
);
|
||||
|
||||
await user.click(screen.getByRole("tab", { name: "Members" }));
|
||||
|
||||
expect(await screen.findByText("member@example.com")).toBeInTheDocument();
|
||||
expect(screen.getByText("$12.3457")).toBeInTheDocument();
|
||||
expect(screen.getByText(new Date(createdAt).toLocaleString())).toBeInTheDocument();
|
||||
});
|
||||
|
||||
test("should display team aliases when teams are available", async () => {
|
||||
const orgWithTeams = {
|
||||
...mockOrg,
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue