mirror of
https://github.com/freeCodeCamp/freeCodeCamp.git
synced 2025-12-19 18:18:27 -05:00
fix(client): Improve navigation search bar clarity (#59140)
Co-authored-by: Huyen Nguyen <25715018+huyenltnguyen@users.noreply.github.com>
This commit is contained in:
@@ -778,13 +778,12 @@
|
||||
"search": {
|
||||
"label": "Search",
|
||||
"placeholder": {
|
||||
"default": "Search our tutorials",
|
||||
"numbered": "Search {{ roundedTotalRecords }}+ tutorials"
|
||||
"default": "Search our news articles, tutorials, and books",
|
||||
"numbered": "Search {{ roundedTotalRecords }}+ news articles, tutorials, and books"
|
||||
},
|
||||
"see-results": "See all results for {{searchQuery}}",
|
||||
"no-tutorials": "No tutorials found",
|
||||
"try": "Looking for something? Try the search bar on this page.",
|
||||
"no-results": "We could not find anything relating to <0>{{query}}</0>",
|
||||
"no-results": "No results found",
|
||||
"result-list": "Search results"
|
||||
},
|
||||
"misc": {
|
||||
|
||||
@@ -19,7 +19,7 @@ const SearchBarFooter = ({
|
||||
onMouseLeave
|
||||
}: SearchBarFooterProps) => {
|
||||
const { t } = useTranslation();
|
||||
const title = t('search.no-tutorials');
|
||||
const title = t('search.no-results');
|
||||
|
||||
if (!query) {
|
||||
return null;
|
||||
|
||||
@@ -142,7 +142,7 @@ describe('Search bar placeholder tests:', () => {
|
||||
if (clientLocale === 'english') {
|
||||
describe('Placeholder strings', () => {
|
||||
test('When the total number of hits is less than 100 the expected placeholder is generated', async () => {
|
||||
const expected = 'Search our tutorials';
|
||||
const expected = 'Search our news articles, tutorials, and books';
|
||||
const placeholderText = await generateSearchPlaceholder({
|
||||
mockRecordsNum: 99,
|
||||
locale: 'english'
|
||||
@@ -156,7 +156,7 @@ describe('Search bar placeholder tests:', () => {
|
||||
mockRecordsNum: 100,
|
||||
locale: 'english'
|
||||
});
|
||||
const expected = 'Search 100+ tutorials';
|
||||
const expected = 'Search 100+ news articles, tutorials, and books';
|
||||
|
||||
expect(placeholderText).toEqual(expected);
|
||||
});
|
||||
@@ -166,7 +166,7 @@ describe('Search bar placeholder tests:', () => {
|
||||
mockRecordsNum: 11000,
|
||||
locale: 'english'
|
||||
});
|
||||
const expected = 'Search 11,000+ tutorials';
|
||||
const expected = 'Search 11,000+ news articles, tutorials, and books';
|
||||
|
||||
expect(placeholderText).toEqual(expected);
|
||||
});
|
||||
|
||||
@@ -139,7 +139,7 @@ test.describe('Search bar', () => {
|
||||
const resultList = page.getByRole('list', { name: 'Search results' });
|
||||
await expect(resultList.getByRole('listitem')).toHaveCount(1);
|
||||
await expect(resultList.getByRole('listitem')).toHaveText(
|
||||
'No tutorials found'
|
||||
'No results found'
|
||||
);
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user