mirror of
https://github.com/BerriAI/litellm.git
synced 2026-10-05 02:41:56 +00:00
test(ui): cover a negative policy attachment priority typed keystroke by keystroke
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
This commit is contained in:
parent
669a66499c
commit
8164189237
1 changed files with 17 additions and 0 deletions
|
|
@ -210,6 +210,23 @@ describe("AddAttachmentForm", () => {
|
|||
});
|
||||
});
|
||||
|
||||
it("sends a negative priority typed one keystroke at a time", async () => {
|
||||
const user = userEvent.setup();
|
||||
const createAttachment = vi.fn().mockResolvedValue({});
|
||||
renderWithProviders(<AddAttachmentForm {...defaultProps} createAttachment={createAttachment} />);
|
||||
await selectPolicy(user, "policy-alpha");
|
||||
const priority = screen.getByLabelText("Priority");
|
||||
await user.type(priority, "-5");
|
||||
expect(priority).toHaveValue(-5);
|
||||
await submit(user);
|
||||
await waitFor(() => expect(createAttachment).toHaveBeenCalledTimes(1));
|
||||
expect(createAttachment).toHaveBeenCalledWith("test-token", {
|
||||
policy_name: "policy-alpha",
|
||||
scope: "*",
|
||||
priority: -5,
|
||||
});
|
||||
});
|
||||
|
||||
it("omits priority from the attachment when the field is left blank", async () => {
|
||||
const user = userEvent.setup();
|
||||
const createAttachment = vi.fn().mockResolvedValue({});
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue