Skip to content

Commit

Permalink
feat(test): WIP
Browse files Browse the repository at this point in the history
Signed-off-by: Laurentiu Niculae <[email protected]>
  • Loading branch information
laurentiuNiculae committed Mar 1, 2024
1 parent 8a18a6d commit 2316a4c
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions src/components/Header/SearchSuggestion.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -134,13 +134,8 @@ function SearchSuggestion({ setSearchCurrentValue = () => {} }) {
const { key, type } = event;
const name = event.target.value;
if (key === 'Enter' || type === 'click') {
const splitName = name.split(':');
let inputInSuggestions = false;

if (splitName.length > 1) {
inputInSuggestions = suggestionData.some((sd) => sd.repoName === splitName[0] && sd.tag === splitName[1]);
}
if (inputInSuggestions) {
if (name?.includes(':')) {
const splitName = name.split(':');
navigate(`/image/${encodeURIComponent(splitName[0])}/tag/${splitName[1]}`);
} else {

Check warning on line 140 in src/components/Header/SearchSuggestion.jsx

View check run for this annotation

Codecov / codecov/patch

src/components/Header/SearchSuggestion.jsx#L138-L140

Added lines #L138 - L140 were not covered by tests
navigate({ pathname: `/explore`, search: createSearchParams({ search: inputValue || '' }).toString() });
Expand Down

0 comments on commit 2316a4c

Please sign in to comment.