fix E2E Test Failure

This commit is contained in:
Medyan
2026-02-01 15:10:56 -05:00
parent 9688a507a3
commit 6119900f44
2 changed files with 3 additions and 10 deletions

View File

@@ -2,7 +2,7 @@
import { LibraryAgentSort } from "@/app/api/__generated__/models/libraryAgentSort";
import { parseAsStringEnum, useQueryState } from "nuqs";
import { useCallback, useEffect, useMemo, useState } from "react";
import { useCallback, useMemo, useState } from "react";
const sortParser = parseAsStringEnum(Object.values(LibraryAgentSort));
@@ -11,13 +11,6 @@ export function useLibraryListPage() {
const [uploadedFile, setUploadedFile] = useState<File | null>(null);
const [librarySortRaw, setLibrarySortRaw] = useQueryState("sort", sortParser);
// Ensure sort param is always present in URL (even if default)
useEffect(() => {
if (!librarySortRaw) {
setLibrarySortRaw(LibraryAgentSort.lastExecuted, { shallow: false });
}
}, [librarySortRaw, setLibrarySortRaw]);
const librarySort = librarySortRaw || LibraryAgentSort.lastExecuted;
const setLibrarySort = useCallback(

View File

@@ -182,7 +182,7 @@ test("logged in user is redirected from /login to /library", async ({
await hasUrl(page, "/marketplace");
await page.goto("/login");
await hasUrl(page, "/library?sort=lastExecuted");
await hasUrl(page, "/library");
});
test("logged in user is redirected from /signup to /library", async ({
@@ -195,5 +195,5 @@ test("logged in user is redirected from /signup to /library", async ({
await hasUrl(page, "/marketplace");
await page.goto("/signup");
await hasUrl(page, "/library?sort=lastExecuted");
await hasUrl(page, "/library");
});