Skip to content

Commit

Permalink
cleaner
Browse files Browse the repository at this point in the history
  • Loading branch information
carolineBda committed Jan 27, 2025
1 parent 42b4247 commit 8d264b1
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 26 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -150,32 +150,26 @@ export const Autocomplete = <K,>({
{value.length > 1 &&
(isOpen && suggestions.length
? suggestions.map((item, index) => (
<>
<li
{...getItemProps({
item,
index,
key: `${displayLabel(item)}${index}`,
})}
className={`${fr.cx("fr-p-3v")} ${suggestion} ${highlightedIndex === index ? isHighlighted : ""}`}
>
{lineAsLink ? (
<Link href={lineAsLink(item)} className={link}>
{displayLabel(item)}
</Link>
) : (
<>{displayLabel(item)}</>
)}
</li>
</>
<li
{...getItemProps({
item,
index,
})}
key={`${displayLabel(item)}${index}`}
className={`${fr.cx("fr-p-3v")} ${suggestion} ${highlightedIndex === index ? isHighlighted : ""}`}
>
{lineAsLink ? (
<Link href={lineAsLink(item)} className={link}>
{displayLabel(item)}
</Link>
) : (
<>{displayLabel(item)}</>
)}
</li>
))
: displayNoResult &&
!selectedResult && (
<>
<li className={`${fr.cx("fr-p-3v")} }`}>
<>Aucun résultat</>
</li>
</>
<li className={`${fr.cx("fr-p-3v")} }`}>Aucun résultat</li>
))}
</ul>
</div>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
import { HomeSearch } from "../Components";
import { fireEvent, render, waitFor } from "@testing-library/react";
import React from "react";
import { byTestId } from "testing-library-selector";
import { byTestId, byLabelText } from "testing-library-selector";
import { fetchSuggestResults } from "../../layout/header/fetchSuggestResults";
import { useLayoutTracking } from "../../layout/tracking";
import { UserAction } from "../../../common";

const pushRouter = jest.fn();

jest.mock("../../layout/header/fetchSuggestResults");
jest.mock("../../layout/tracking");

Expand Down

0 comments on commit 8d264b1

Please sign in to comment.