# Language switch button unit test
Add a unit test for the language switch component (src/features/i18n/components/LanguageSwitchButton.vue).
## Summary
* test cases for initial closed state and correct ARIA attributes
* test cases for opening the dropdown via button click
* data-driven test matrix (test.for) covering LTR and RTL language selection (including localStorage and HTML document attributes)
* test case for closing the dropdown when clicking outside the component
## Related issues
Closes: #86
johannes.vos
added this to the testing-ready milestone 2026-06-04 13:02:10 +02:00
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Language switch button unit test
Add a unit test for the language switch component (src/features/i18n/components/LanguageSwitchButton.vue).
Summary
Related issues
Closes: #86
Why did you put it into
src/utils/__tests__/instead ofsrc/features/i18n/components/__tests__/?@@ -0,0 +1,114 @@/*Can you please use the variant without the
*indentation? That is more common, cleaner and better for automated tools.@@ -0,0 +47,4 @@document.documentElement.dir = '';});test('renders correctly with initial state closed', () => {Could you please fix the indentation to make it more readable?
The test does not work. Maybe you forgot adding
@vue/test-utilsto thedevDependenciessection inpackage.json?It workes for me.
I will improve it!
@jakob.scheid Please try again.
918d6768e8to27f696247dVery nice.
Language switch button unit testto Feat: language switch button unit testFeat: language switch button unit testto Test: language switch button unit testTest: language switch button unit testto Test(i18n): language switch button unit test