Skip to content

Commit

Permalink
Increase saved recent searches cap to 10 (#437)
Browse files Browse the repository at this point in the history
  • Loading branch information
arkadyan authored Feb 3, 2020
1 parent 6c37a20 commit 3fa4588
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 3 deletions.
2 changes: 1 addition & 1 deletion assets/src/state/searchPageState.ts
Original file line number Diff line number Diff line change
Expand Up @@ -103,4 +103,4 @@ export const addSavedQuery = (
.concat(
previouslySaved.filter(savedQuery => savedQuery.text !== newSearch.text)
)
.slice(0, 5)
.slice(0, 10)
14 changes: 12 additions & 2 deletions assets/tests/state/searchPageState.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -114,19 +114,29 @@ describe("addSavedQuery", () => {
).toEqual([{ text: "a" }, { text: "b" }])
})

test("caps at 5 saved queries", () => {
test("caps at 10 saved queries", () => {
expect(
addSavedQuery(
[
{ text: "j" },
{ text: "i" },
{ text: "h" },
{ text: "g" },
{ text: "f" },
{ text: "e" },
{ text: "d" },
{ text: "c" },
{ text: "b" },
{ text: "a" },
],
{ text: "f" }
{ text: "k" }
)
).toEqual([
{ text: "k" },
{ text: "j" },
{ text: "i" },
{ text: "h" },
{ text: "g" },
{ text: "f" },
{ text: "e" },
{ text: "d" },
Expand Down

0 comments on commit 3fa4588

Please sign in to comment.