mirror of
https://github.com/BerriAI/litellm.git
synced 2026-09-12 23:01:41 +00:00
test(ui): restore empty-string searchEmail guard for useInfiniteUsers
Re-add the regression test verifying useInfiniteUsers(50, "") sends no user_email query param, so a future change from the truthiness check to a strict undefined check would fail instead of silently forwarding empty strings.
This commit is contained in:
parent
21bbba687f
commit
bab23bbbbc
1 changed files with 8 additions and 0 deletions
|
|
@ -130,6 +130,14 @@ describe("useInfiniteUsers", () => {
|
|||
expect(lastRequestUrl(mock).searchParams.has("user_email")).toBe(false);
|
||||
});
|
||||
|
||||
it("omits user_email when searchEmail is an empty string", async () => {
|
||||
const mock = stubPagedFetch(1);
|
||||
const { result } = renderHook(() => useInfiniteUsers(50, ""), { wrapper });
|
||||
|
||||
await waitFor(() => expect(result.current.isSuccess).toBe(true));
|
||||
expect(lastRequestUrl(mock).searchParams.has("user_email")).toBe(false);
|
||||
});
|
||||
|
||||
it("fetches the next page with an incremented page param", async () => {
|
||||
const mock = stubPagedFetch(3);
|
||||
const { result } = renderHook(() => useInfiniteUsers(), { wrapper });
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue