mirror of
https://github.com/tiennm99/litellm.git
synced 2026-08-08 00:21:58 +00:00
Merge branch 'main' into litellm_perf_user_api_key_auth
This commit is contained in:
@@ -17,6 +17,7 @@ export interface MemberTableProps {
|
||||
roleTooltip?: string;
|
||||
extraColumns?: ColumnsType<Member>;
|
||||
showDeleteForMember?: (member: Member) => boolean;
|
||||
emptyText?: string;
|
||||
}
|
||||
|
||||
export default function MemberTable({
|
||||
@@ -29,6 +30,7 @@ export default function MemberTable({
|
||||
roleTooltip,
|
||||
extraColumns = [],
|
||||
showDeleteForMember,
|
||||
emptyText,
|
||||
}: MemberTableProps) {
|
||||
const baseColumns: ColumnsType<Member> = [
|
||||
{
|
||||
@@ -109,6 +111,7 @@ export default function MemberTable({
|
||||
pagination={false}
|
||||
size="small"
|
||||
scroll={{ x: "max-content" }}
|
||||
locale={emptyText ? { emptyText } : undefined}
|
||||
/>
|
||||
{onAddMember && canEdit && (
|
||||
<Button icon={<UserAddOutlined />} type="primary" onClick={onAddMember}>
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
import React from "react";
|
||||
import { render, screen, waitFor } from "@testing-library/react";
|
||||
import userEvent from "@testing-library/user-event";
|
||||
import { vi, test, expect } from "vitest";
|
||||
import OrganizationInfoView from "./organization_view";
|
||||
|
||||
@@ -105,6 +106,7 @@ test("should display empty state when organization has no members", async () =>
|
||||
const { organizationInfoCall } = await import("../networking");
|
||||
(organizationInfoCall as unknown as ReturnType<typeof vi.fn>).mockResolvedValueOnce(mockOrg);
|
||||
|
||||
const user = userEvent.setup();
|
||||
render(
|
||||
<OrganizationInfoView
|
||||
organizationId="org_123"
|
||||
@@ -117,6 +119,12 @@ test("should display empty state when organization has no members", async () =>
|
||||
/>,
|
||||
);
|
||||
|
||||
await waitFor(() => {
|
||||
expect(screen.getByText("Acme Corp")).toBeInTheDocument();
|
||||
});
|
||||
|
||||
await user.click(screen.getByRole("tab", { name: "Members" }));
|
||||
|
||||
await waitFor(() => {
|
||||
expect(screen.getByText("No members found")).toBeInTheDocument();
|
||||
});
|
||||
|
||||
@@ -371,6 +371,7 @@ const OrganizationInfoView: React.FC<OrganizationInfoProps> = ({
|
||||
onAddMember={() => setIsAddMemberModalVisible(true)}
|
||||
roleColumnTitle="Organization Role"
|
||||
extraColumns={orgExtraColumns}
|
||||
emptyText="No members found"
|
||||
/>
|
||||
</div>
|
||||
),
|
||||
|
||||
Reference in New Issue
Block a user