Skip to content

Commit

Permalink
fix: show search exhausted message on empty results (#6205)
Browse files Browse the repository at this point in the history
  • Loading branch information
pranavosu authored Nov 25, 2024
1 parent 2af4ab7 commit 0e666ef
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,13 @@ exports[`LocationDetailView display text \`getListResultsMessage\` returns the e
}
`;

exports[`LocationDetailView display text \`getListResultsMessage\` returns the expected values in the search exhausted with no results scenario 1`] = `
{
"content": "No results found in the first 10,000 items.",
"type": "info",
}
`;

exports[`LocationDetailView display text \`getListResultsMessage\` returns the expected values in the search failed scenario 1`] = `
{
"content": "Network got confused",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -323,6 +323,14 @@ export const LIST_ITEMS_SCENARIOS: [
hasExhaustedSearch: true,
},
],
[
'search exhausted with no results',
{
items: [],
query: 'something to look for',
hasExhaustedSearch: true,
},
],
[
'loading',
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,13 @@ export const DEFAULT_LOCATION_DETAIL_VIEW_DISPLAY_TEXT: DefaultLocationDetailVie
};
}

if (!items?.length && hasExhaustedSearch) {
return {
type: 'info',
content: `No results found in the first 10,000 items.`,
};
}

if (!items?.length) {
return {
type: 'info',
Expand Down

0 comments on commit 0e666ef

Please sign in to comment.