This is an automated email from the ASF dual-hosted git repository.
mengw15 pushed a commit to branch
backport/9090-clear-the-search-bar-s-suggestions-when-v1.3
in repository https://gitbox.apache.org/repos/asf/texera.git
The following commit(s) were added to
refs/heads/backport/9090-clear-the-search-bar-s-suggestions-when-v1.3 by this
push:
new f91d6e7433 fix(frontend, v1.3): resolve the search-bar spec conflict
(keep only the #9090 test)
f91d6e7433 is described below
commit f91d6e743312691f298ebb92ae75209aef363982
Author: mengw15 <[email protected]>
AuthorDate: Thu Oct 29 23:43:45 2026 -0700
fix(frontend, v1.3): resolve the search-bar spec conflict (keep only the
#9090 test)
#9090 added its test right before three tests from #8701, which is not on
release/v1.3, so the cherry-pick conflicted. Keep only the #9090 test; the
#8701 tests use helpers this branch does not have.
---
.../user/search-bar/search-bar.component.spec.ts | 50 ----------------------
1 file changed, 50 deletions(-)
diff --git
a/frontend/src/app/dashboard/component/user/search-bar/search-bar.component.spec.ts
b/frontend/src/app/dashboard/component/user/search-bar/search-bar.component.spec.ts
index 0c0525145e..884d4e6c84 100644
---
a/frontend/src/app/dashboard/component/user/search-bar/search-bar.component.spec.ts
+++
b/frontend/src/app/dashboard/component/user/search-bar/search-bar.component.spec.ts
@@ -145,8 +145,6 @@ describe("SearchBarComponent", () => {
expect(component.listOfResult).toEqual(["hello"]);
}));
-<<<<<<< HEAD
-=======
it("drops the previous user's cached suggestions when the user changes",
fakeAsync(() => {
searchSpy.search.mockReturnValue(of({ results:
[makeWorkflowItem("private-wf")], more: false } as SearchResult));
component.onSearchInputChange("private");
@@ -167,54 +165,6 @@ describe("SearchBarComponent", () => {
expect(component.listOfResult).toEqual([]);
}));
- it("lists a model hit by name, as the all-kinds search returns model rows",
fakeAsync(() => {
- searchSpy.search.mockReturnValue(of({ results:
[makeModelItem("my-model")], more: false } as SearchResult));
-
- component.onSearchInputChange("my");
- tick(200);
-
- expect(component.listOfResult).toEqual(["my-model"]);
- }));
-
- it("reports a row it cannot name instead of hiding it behind an empty
dropdown", fakeAsync(() => {
- // SearchService only keeps rows convertToName can name, so this row means
the two disagree: a bug that has
- // to reach the console.
- const unhandled = vi.fn();
- const previousHandler = config.onUnhandledError;
- config.onUnhandledError = unhandled;
- try {
- searchSpy.search.mockReturnValueOnce(of({ results: [{ resourceType:
"computing-unit" } as any], more: false }));
-
- component.onSearchInputChange("bad");
- tick(200);
-
- expect(unhandled).toHaveBeenCalledTimes(1);
- expect((unhandled.mock.calls[0][0] as Error).message).toBe("Unexpected
type in SearchResult.");
- } finally {
- config.onUnhandledError = previousHandler;
- }
- }));
-
- it("keeps autocomplete working after a failed request, and retries rather
than caching the failure", fakeAsync(() => {
- component.listOfResult = ["stale"];
- searchSpy.search.mockReturnValueOnce(throwError(() => new
HttpErrorResponse({ status: 500 })));
-
- component.onSearchInputChange("x");
- tick(200);
-
- expect(component.listOfResult).toEqual([]);
- expect((component as any).searchCache.has("x")).toBe(false);
-
- searchSpy.search.mockReturnValueOnce(of({ results:
[makeWorkflowItem("x-wf")], more: false } as SearchResult));
- // Same query again: the failure was not cached, so this goes back to the
server.
- component.onSearchInputChange("x");
- tick(200);
-
- expect(searchSpy.search).toHaveBeenCalledTimes(2);
- expect(component.listOfResult).toEqual(["x-wf"]);
- }));
-
->>>>>>> 553ab15b3 (fix(frontend): clear the search bar’s suggestions when the
user changes (#9090))
it("addToCache evicts the oldest entry once 20 queries are cached", () => {
const cache = (component as any).searchCache as Map<string, string[]>;