diff options
Diffstat (limited to 'spec/frontend/language_switcher/components')
-rw-r--r-- | spec/frontend/language_switcher/components/app_spec.js | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/spec/frontend/language_switcher/components/app_spec.js b/spec/frontend/language_switcher/components/app_spec.js index 6a1b94cd813..effb71c2775 100644 --- a/spec/frontend/language_switcher/components/app_spec.js +++ b/spec/frontend/language_switcher/components/app_spec.js @@ -1,3 +1,4 @@ +import { GlLink } from '@gitlab/ui'; import { mountExtended } from 'helpers/vue_test_utils_helper'; import LanguageSwitcherApp from '~/language_switcher/components/app.vue'; import { PREFERRED_LANGUAGE_COOKIE_KEY } from '~/language_switcher/constants'; @@ -29,6 +30,7 @@ describe('<LanguageSwitcher />', () => { const getPreferredLanguage = () => wrapper.find('.gl-dropdown-button-text').text(); const findLanguageDropdownItem = (code) => wrapper.findByTestId(`language_switcher_lang_${code}`); + const findFooter = () => wrapper.findByTestId('footer'); it('preferred language', () => { expect(getPreferredLanguage()).toBe(EN.text); @@ -59,4 +61,12 @@ describe('<LanguageSwitcher />', () => { expect(utils.setCookie).toHaveBeenCalledWith(PREFERRED_LANGUAGE_COOKIE_KEY, ES.value); window.location = originalLocation; }); + + it('renders footer link', () => { + const link = findFooter().findComponent(GlLink); + + // Assert against actual value so we can implicitly test `helpPagePath` call + expect(link.attributes('href')).toBe('/help/development/i18n/translation.md'); + expect(link.text()).toBe(LanguageSwitcherApp.HELP_TRANSLATE_MSG); + }); }); |