feat(ui): label the caller's team spend line My Spend
Some checks failed
Terraform Modules / fmt, validate, test (aws) (push) Has been cancelled
Terraform Modules / fmt, validate, test (gcp) (push) Has been cancelled
LiteLLM Rust / rust-lint (push) Has been cancelled
LiteLLM Rust / rust-test (push) Has been cancelled
LiteLLM Rust / rust-wheel (push) Has been cancelled
Terraform Provider / gofmt, vet, build, test (push) Has been cancelled
Terraform Provider / Provider endpoints vs proxy OpenAPI schema (push) Has been cancelled

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
This commit is contained in:
jesus 2026-10-16 23:49:39 +00:00
parent 365df6578d
commit 661bd2e5fc
3 changed files with 8 additions and 8 deletions

View file

@ -20,12 +20,12 @@ describe("TeamMemberSpendBudgetCell", () => {
expect(screen.getByText("Team")).toBeInTheDocument();
expect(screen.getByText("$600.00")).toBeInTheDocument();
expect(screen.getByText("/ $1,000.00")).toBeInTheDocument();
expect(screen.getByText("Member")).toBeInTheDocument();
expect(screen.getByText("My Spend")).toBeInTheDocument();
expect(screen.getByText("$50.00")).toBeInTheDocument();
expect(screen.getByText("/ $100.00")).toBeInTheDocument();
expect(screen.getByText("Resets Oct 20, 2026 UTC")).toBeInTheDocument();
expect(screen.getAllByRole("meter")[0]).toHaveAttribute("aria-valuetext", "Team $600.00 of $1,000.00");
expect(screen.getAllByRole("meter")[1]).toHaveAttribute("aria-valuetext", "Member $50.00 of $100.00");
expect(screen.getAllByRole("meter")[1]).toHaveAttribute("aria-valuetext", "My Spend $50.00 of $100.00");
});
it("shows the team budget and Unlimited for a member without a budget", () => {
@ -39,7 +39,7 @@ describe("TeamMemberSpendBudgetCell", () => {
expect(screen.getByText("Team")).toBeInTheDocument();
expect(screen.getByText("$600.00")).toBeInTheDocument();
expect(screen.getByText("Member")).toBeInTheDocument();
expect(screen.getByText("My Spend")).toBeInTheDocument();
expect(screen.getByText("/ Unlimited")).toBeInTheDocument();
expect(screen.getAllByRole("meter")).toHaveLength(1);
});
@ -60,7 +60,7 @@ describe("TeamMemberSpendBudgetCell", () => {
render(<TeamMemberSpendBudgetCell teamSpend={600} teamMaxBudget={1000} callerMembership={null} />);
expect(screen.getByText("Team")).toBeInTheDocument();
expect(screen.queryByText("Member")).not.toBeInTheDocument();
expect(screen.queryByText("My Spend")).not.toBeInTheDocument();
expect(screen.getAllByRole("meter")).toHaveLength(1);
});
@ -73,7 +73,7 @@ describe("TeamMemberSpendBudgetCell", () => {
/>,
);
expect(screen.getAllByRole("meter")[1]).toHaveAttribute("aria-valuetext", "Member $150.00 of $100.00");
expect(screen.getAllByRole("meter")[1]).toHaveAttribute("aria-valuetext", "My Spend $150.00 of $100.00");
});
it("does not render meters for zero or unlimited budgets", () => {

View file

@ -15,7 +15,7 @@ interface TeamMemberSpendBudgetCellProps {
}
interface BudgetLineProps {
label: "Team" | "Member";
label: "Team" | "My Spend";
spend: number | null | undefined;
maxBudget: number | null | undefined;
resetAt?: string | null;
@ -59,7 +59,7 @@ export function TeamMemberSpendBudgetCell({
<BudgetLine label="Team" spend={teamSpend} maxBudget={teamMaxBudget} />
{callerMembership && (
<BudgetLine
label="Member"
label="My Spend"
spend={callerMembership.spend}
maxBudget={callerMembership.max_budget}
resetAt={callerMembership.budget_reset_at}

View file

@ -131,7 +131,7 @@ it("renders caller membership spend and budget in the team row", async () => {
);
renderTable();
expect(await screen.findByText("Member")).toBeInTheDocument();
expect(await screen.findByText("My Spend")).toBeInTheDocument();
expect(screen.getByText("$50.00")).toBeInTheDocument();
expect(screen.getByText("Resets Oct 20, 2026 UTC")).toBeInTheDocument();
});