mirror of
https://github.com/BerriAI/litellm.git
synced 2026-09-10 22:41:41 +00:00
test(ui): assert Projects nav item by visible text
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
This commit is contained in:
parent
7ef3d1e7e3
commit
194c06a30c
1 changed files with 3 additions and 9 deletions
|
|
@ -610,17 +610,14 @@ describe("Sidebar (leftnav)", () => {
|
|||
it("hides Projects from a plain internal user", () => {
|
||||
mockUseAuthorized.mockReturnValue(internalAuth);
|
||||
renderWithProviders(<Sidebar {...defaultProps} enableProjectsUI />);
|
||||
expect(screen.queryByRole("link", { name: "Projects" })).not.toBeInTheDocument();
|
||||
expect(screen.queryByText("Projects")).not.toBeInTheDocument();
|
||||
});
|
||||
|
||||
it("shows Projects to an internal user who administers a team", () => {
|
||||
mockUseAuthorized.mockReturnValue(internalAuth);
|
||||
teamAdminState.isTeamAdmin = true;
|
||||
renderWithProviders(<Sidebar {...defaultProps} enableProjectsUI />);
|
||||
expect(screen.getByRole("link", { name: "Projects" })).toHaveAttribute(
|
||||
"href",
|
||||
expect.stringContaining("projects"),
|
||||
);
|
||||
expect(screen.getByText("Projects")).toBeInTheDocument();
|
||||
});
|
||||
|
||||
it("shows Projects to an internal user who administers an organization", () => {
|
||||
|
|
@ -631,10 +628,7 @@ describe("Sidebar (leftnav)", () => {
|
|||
error: null,
|
||||
});
|
||||
renderWithProviders(<Sidebar {...defaultProps} enableProjectsUI />);
|
||||
expect(screen.getByRole("link", { name: "Projects" })).toHaveAttribute(
|
||||
"href",
|
||||
expect.stringContaining("projects"),
|
||||
);
|
||||
expect(screen.getByText("Projects")).toBeInTheDocument();
|
||||
});
|
||||
});
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue