fix(tests): expand client testing for Espanol (#41574)
This commit is contained in:
committed by
GitHub
parent
8e22962523
commit
92dfb3065c
@ -229,21 +229,27 @@ const hasProfileAndSettingsNavItems = (component, username) => {
|
|||||||
|
|
||||||
const hasForumNavItem = component => {
|
const hasForumNavItem = component => {
|
||||||
const { children, to } = navigationLinks(component, 'forum');
|
const { children, to } = navigationLinks(component, 'forum');
|
||||||
|
const localizedForums = {
|
||||||
|
chinese: 'https://chinese.freecodecamp.org/forum',
|
||||||
|
espanol: 'https://forum.freecodecamp.org/c/espanol/',
|
||||||
|
english: 'https://forum.freecodecamp.org/'
|
||||||
|
};
|
||||||
return (
|
return (
|
||||||
children[0].props.children === 'buttons.forum' &&
|
children[0].props.children === 'buttons.forum' &&
|
||||||
(clientLocale === 'chinese'
|
to === localizedForums[clientLocale]
|
||||||
? to === 'https://chinese.freecodecamp.org/forum'
|
|
||||||
: to === 'https://forum.freecodecamp.org/')
|
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
const hasNewsNavItem = component => {
|
const hasNewsNavItem = component => {
|
||||||
const { children, to } = navigationLinks(component, 'news');
|
const { children, to } = navigationLinks(component, 'news');
|
||||||
|
const localizedNews = {
|
||||||
|
chinese: 'https://chinese.freecodecamp.org/news',
|
||||||
|
espanol: 'https://www.freecodecamp.org/espanol/news',
|
||||||
|
english: 'https://www.freecodecamp.org/news'
|
||||||
|
};
|
||||||
return (
|
return (
|
||||||
children[0].props.children === 'buttons.news' &&
|
children[0].props.children === 'buttons.news' &&
|
||||||
(clientLocale === 'chinese'
|
to === localizedNews[clientLocale]
|
||||||
? to === 'https://chinese.freecodecamp.org/news'
|
|
||||||
: to === 'https://www.freecodecamp.org/news')
|
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user