generated from Seekra/repository-template
Language switch button unit test #108
@@ -1,22 +1,22 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2026 Seekra
|
Copyright 2026 Seekra
|
||||||
*
|
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
you may not use this file except in compliance with the License.
|
||||||
* You may obtain a copy of the License at
|
You may obtain a copy of the License at
|
||||||
*
|
|
||||||
* http://www.apache.org/licenses/LICENSE-2.0
|
http://www.apache.org/licenses/LICENSE-2.0
|
||||||
*
|
|
||||||
* Unless required by applicable law or agreed to in writing, software
|
Unless required by applicable law or agreed to in writing, software
|
||||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
* See the License for the specific language governing permissions and
|
See the License for the specific language governing permissions and
|
||||||
* limitations under the License.
|
limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import { expect, test, describe, vi, beforeEach } from 'vitest';
|
import { expect, test, describe, vi, beforeEach } from 'vitest';
|
||||||
import { mount } from '@vue/test-utils';
|
import { mount } from '@vue/test-utils';
|
||||||
import LanguageSwitchButton from '@/features/i18n/components/LanguageSwitchButton.vue';
|
import LanguageSwitchButton from '../LanguageSwitchButton.vue';
|
||||||
import { loadLanguage } from '@/i18n';
|
import { loadLanguage } from '@/i18n';
|
||||||
|
|
||||||
vi.mock('@/i18n', () => ({
|
vi.mock('@/i18n', () => ({
|
||||||
@@ -47,7 +47,7 @@ describe('LanguageSwitchButton.vue', () => {
|
|||||||
document.documentElement.dir = '';
|
document.documentElement.dir = '';
|
||||||
});
|
});
|
||||||
|
|
||||||
test('renders correctly with initial state closed', () => {
|
test('renders correctly with initial state closed', () => {
|
||||||
const wrapper = mount(LanguageSwitchButton);
|
const wrapper = mount(LanguageSwitchButton);
|
||||||
|
|
||||||
expect(wrapper.find('.language-button').exists()).toBe(true);
|
expect(wrapper.find('.language-button').exists()).toBe(true);
|
||||||
|
|||||||
Reference in New Issue
Block a user