Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -323,9 +323,9 @@
const { container } = renderWithProviders(<Harness />);
fireEvent.change(screen.getByPlaceholderText(/smart_router/i), { target: { value: "double-submit-router" } });

fireEvent.submit(container.querySelector("form")!);

Check warning on line 326 in ui/litellm-dashboard/src/components/add_model/add_auto_router_tab.test.tsx

View workflow job for this annotation

GitHub Actions / frontend-lint

Avoid direct Node access. Prefer using the methods from Testing Library

Check warning on line 326 in ui/litellm-dashboard/src/components/add_model/add_auto_router_tab.test.tsx

View workflow job for this annotation

GitHub Actions / frontend-lint

Avoid using container methods. Prefer using the methods from Testing Library, such as "getByRole()"
await waitFor(() => expect(screen.getByRole("button", { name: /add auto router/i })).toBeDisabled());
fireEvent.submit(container.querySelector("form")!);

Check warning on line 328 in ui/litellm-dashboard/src/components/add_model/add_auto_router_tab.test.tsx

View workflow job for this annotation

GitHub Actions / frontend-lint

Avoid direct Node access. Prefer using the methods from Testing Library

Check warning on line 328 in ui/litellm-dashboard/src/components/add_model/add_auto_router_tab.test.tsx

View workflow job for this annotation

GitHub Actions / frontend-lint

Avoid using container methods. Prefer using the methods from Testing Library, such as "getByRole()"

resolveVerdict({ valid: true });
await waitFor(() => expect(screen.getByRole("button", { name: /add auto router/i })).toBeEnabled());
Expand Down Expand Up @@ -377,7 +377,7 @@
await user.click(screen.getByRole("button", { name: /add keyword rule/i }));
expect(screen.getByRole("button", { name: /add auto router/i })).toBeDisabled();

await addKeyword(user, screen.getByText("Keywords 1").closest("div") as HTMLElement, "invoice");

Check warning on line 380 in ui/litellm-dashboard/src/components/add_model/add_auto_router_tab.test.tsx

View workflow job for this annotation

GitHub Actions / frontend-lint

Avoid direct Node access. Prefer using the methods from Testing Library

expect(screen.getByRole("button", { name: /add auto router/i })).toBeEnabled();
expect(screen.queryByText("At least one keyword is required")).not.toBeInTheDocument();
Expand All @@ -393,7 +393,7 @@
expandDetailedConfiguration();
await user.click(screen.getByText("Advanced: Keyword/Semantic Matching"));
await user.click(screen.getByRole("button", { name: /add keyword rule/i }));
await addKeyword(user, screen.getByText("Keywords 1").closest("div") as HTMLElement, "invoice");

Check warning on line 396 in ui/litellm-dashboard/src/components/add_model/add_auto_router_tab.test.tsx

View workflow job for this annotation

GitHub Actions / frontend-lint

Avoid direct Node access. Prefer using the methods from Testing Library

await user.click(screen.getByRole("button", { name: "Edit tiers" }));
await user.click(screen.getByRole("button", { name: "Remove the COMPLEX tier" }));
Expand All @@ -412,7 +412,7 @@
expandDetailedConfiguration();
await user.click(screen.getByText("Advanced: Keyword/Semantic Matching"));
await user.click(screen.getByRole("button", { name: /add keyword rule/i }));
await addKeyword(user, screen.getByText("Keywords 1").closest("div") as HTMLElement, "invoice");

Check warning on line 415 in ui/litellm-dashboard/src/components/add_model/add_auto_router_tab.test.tsx

View workflow job for this annotation

GitHub Actions / frontend-lint

Avoid direct Node access. Prefer using the methods from Testing Library
await user.click(screen.getByRole("button", { name: /add keyword rule/i }));

expect(await screen.findAllByText("At least one keyword is required")).toHaveLength(1);
Expand All @@ -429,7 +429,7 @@
expandDetailedConfiguration();
await user.click(screen.getByText("Advanced: Keyword/Semantic Matching"));
await user.click(screen.getByRole("button", { name: /add keyword rule/i }));
const keywordsField = screen.getByText("Keywords 1").closest("div") as HTMLElement;

Check warning on line 432 in ui/litellm-dashboard/src/components/add_model/add_auto_router_tab.test.tsx

View workflow job for this annotation

GitHub Actions / frontend-lint

Avoid direct Node access. Prefer using the methods from Testing Library

Check warning on line 432 in ui/litellm-dashboard/src/components/add_model/add_auto_router_tab.test.tsx

View workflow job for this annotation

GitHub Actions / frontend-lint

Avoid direct Node access. Prefer using the methods from Testing Library
await addKeyword(user, keywordsField, "invoice");
await user.click(screen.getByRole("button", { name: /add auto router/i }));

Expand Down Expand Up @@ -790,7 +790,7 @@
renderWithProviders(<Harness />);
openTemplateDropdown();

const labels = visibleOptions().map((option) => option.querySelector(".font-medium")?.textContent);

Check warning on line 793 in ui/litellm-dashboard/src/components/add_model/add_auto_router_tab.test.tsx

View workflow job for this annotation

GitHub Actions / frontend-lint

Avoid direct Node access. Prefer using the methods from Testing Library

expect(labels).toEqual([
"1M Context",
Expand Down Expand Up @@ -1046,9 +1046,7 @@
await waitFor(() => expect(handleAddAutoRouterSubmit).toHaveBeenCalled());
expect(vi.mocked(handleAddAutoRouterSubmit).mock.calls.at(-1)?.[0]).toMatchObject({
complexity_router_config: {
tier_model_configs: {
REASONING: [{ model_name: "claude-opus-5", litellm_params: { reasoning_effort: "high" } }],
},
tier_model_configs: ANTHROPIC_PRESET.complexity_router_config.tier_model_configs,

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Assertion tracks fixture

This derives expected reasoning effort from the input fixture, weakening regression coverage. Repository rules require modified tests to preserve coverage before merge

Rule Used: What: Flag any modifications to existing tests and... (source)

Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!

},
});
});
Expand Down
Loading