Skip to content

Commit

Permalink
Update tests
Browse files Browse the repository at this point in the history
  • Loading branch information
yansavitski committed May 1, 2023
1 parent fc9bc93 commit 7c6c4c8
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 6 deletions.
19 changes: 15 additions & 4 deletions packages/search-ui-analytics-plugin/src/__tests__/index.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,20 @@ describe("analytics plugin", () => {
totalResults: 0
});
expect(window["elasticAnalytics"].trackEvent).toBeCalledWith("search", {
type: "SearchQuery",
query: "test",
totalResults: 0
search: {
page: {
current: undefined,
size: undefined
},
results: {
items: [],
total_results: 0
},
sort: undefined,
search_application: "search-ui",
query: "test",
},
});
});
});
})
;
5 changes: 4 additions & 1 deletion packages/search-ui/src/__tests__/SearchDriver.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -521,9 +521,12 @@ describe("_updateSearchResults", () => {
expect(stateAfterCreation.pagingStart).toEqual(21);
expect(stateAfterCreation.pagingEnd).toEqual(40);
expect(mockPlugin.subscribe).toBeCalledWith({
currentPage: 1,
query: "test",
resultsPerPage: 20,
sort: undefined,
totalResults: 1000,
type: "SearchQuery"
type: "SearchQuery",
});
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,8 @@ describe("#trackClickThrough", () => {
position: 0,
query: "search terms",
tags: ["test"],
type: "ResultSelected"
type: "ResultSelected",
totalResults: 1000
});
});
});

0 comments on commit 7c6c4c8

Please sign in to comment.