fix(tests): expand client testing for Espanol (#41574)

This commit is contained in:
Oliver Eyton-Williams
2021-03-25 16:55:13 +01:00
committed by GitHub
parent 8e22962523
commit 92dfb3065c

View File

@ -229,21 +229,27 @@ const hasProfileAndSettingsNavItems = (component, username) => {
const hasForumNavItem = component => {
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 (
children[0].props.children === 'buttons.forum' &&
(clientLocale === 'chinese'
? to === 'https://chinese.freecodecamp.org/forum'
: to === 'https://forum.freecodecamp.org/')
to === localizedForums[clientLocale]
);
};
const hasNewsNavItem = component => {
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 (
children[0].props.children === 'buttons.news' &&
(clientLocale === 'chinese'
? to === 'https://chinese.freecodecamp.org/news'
: to === 'https://www.freecodecamp.org/news')
to === localizedNews[clientLocale]
);
};