Commit c8784b3b authored by Anshul's avatar Anshul Committed by Jason Laster
Browse files

Bug 1520957 - [release 119] remove unused code project-text-search (#7675). r=dwalsh

parent 28194726
Loading
Loading
Loading
Loading
+0 −4
Original line number Diff line number Diff line
@@ -30,10 +30,6 @@ export function addOngoingSearch(ongoingSearch: SearchOperation): Action {
  return { type: "ADD_ONGOING_SEARCH", ongoingSearch };
}

export function clearSearchQuery(): Action {
  return { type: "CLEAR_QUERY" };
}

export function addSearchResult(
  sourceId: string,
  filepath: string,
+0 −13
Original line number Diff line number Diff line
@@ -61,19 +61,6 @@ describe("project text search", () => {
    expect(getTextSearchQuery(getState())).toEqual(mockQuery);
  });

  it("should remove the  project text search query", () => {
    const { dispatch, getState } = createStore();
    const mockQuery = "foo";

    dispatch(actions.addSearchQuery(mockQuery));
    expect(getTextSearchQuery(getState())).toEqual(mockQuery);
    dispatch(actions.updateSearchStatus("DONE"));
    dispatch(actions.clearSearchQuery());
    expect(getTextSearchQuery(getState())).toEqual("");
    const status = getTextSearchStatus(getState());
    expect(status).toEqual("INITIAL");
  });

  it("should search all the loaded sources based on the query", async () => {
    const { dispatch, getState } = createStore(threadClient);
    const mockQuery = "foo";
+0 −1
Original line number Diff line number Diff line
@@ -111,7 +111,6 @@ export type ProjectTextSearchAction =
      +type: "ADD_SEARCH_RESULT",
      +result: ProjectTextSearchResult
    |}
  | {| +type: "CLEAR_QUERY" |}
  | {| +type: "UPDATE_STATUS", +status: string |}
  | {| +type: "CLEAR_SEARCH_RESULTS" |}
  | {| +type: "ADD_ONGOING_SEARCH", +ongoingSearch: SearchOperation |}
+0 −7
Original line number Diff line number Diff line
@@ -60,13 +60,6 @@ function update(
    case "ADD_QUERY":
      return { ...state, query: action.query };

    case "CLEAR_QUERY":
      return {
        ...state,
        query: "",
        status: statusType.initial
      };

    case "ADD_SEARCH_RESULT":
      const results = state.results;
      if (action.result.matches.length === 0) {