Skip to content

Commit

Permalink
TESTS - Added tests for search field.
Browse files Browse the repository at this point in the history
  • Loading branch information
slytherin20 committed Apr 28, 2024
1 parent eaa75d6 commit 36c234e
Show file tree
Hide file tree
Showing 3 changed files with 1,601 additions and 16 deletions.
3 changes: 2 additions & 1 deletion src/Components/Nav/Search.js
Original file line number Diff line number Diff line change
Expand Up @@ -77,13 +77,14 @@ export default function Search({ searchResults }) {
/>
</div>
{showRecommendations && search && (
<ul className="recommendation absolute bg-white shadow-md top-6 w-full pt-2 pb-2 border-t-2 border-t-gray-200">
<ul className="recommendation absolute bg-white shadow-md top-6 w-full pt-2 pb-2 border-t-2 border-t-gray-200" data-testid="recommendations">
{recommendations && recommendations.length > 0 ? (
recommendations.map((restaurant) => (
<li
className="p-2 hover:bg-slate-200 cursor-pointer restaurant-link"
key={restaurant.id}
onClick={() => goToSearchResult(restaurant.id)}
data-testid="recommend-result"
>
{restaurant.name}
</li>
Expand Down
Loading

0 comments on commit 36c234e

Please sign in to comment.