57 Commits

Author SHA1 Message Date
jakob.scheid 1473dcf060 test(settings): add test cases for the selection setting allowMultiple property to the settings validator unit test 2026-06-04 17:27:42 +02:00
jakob.scheid 8702648624 test(settings): add unit test for the settings validator validateSettingsConfig function 2026-06-04 17:27:42 +02:00
jakob.scheid 88819f5684 test(settings): add test cases for the settings validator validateSelectionOptions function for test cases that should throw an error 2026-06-04 17:27:42 +02:00
jakob.scheid 98940eeec4 test(settings): add test cases for the settings validator validateEntry function for test cases that should throw an error 2026-06-04 17:27:42 +02:00
jakob.scheid 775e206322 fix(settings): check selection default value in the settings validator 2026-06-04 17:27:42 +02:00
jakob.scheid 7407366f45 fix(settings): check the selection options and allowMultiple before and not after the default check in the settings validator 2026-06-04 17:27:42 +02:00
jakob.scheid deaf3935c9 fix(settings): fix indentation in validateEntry in the settings validator 2026-06-04 17:27:42 +02:00
jakob.scheid 5f07e66915 fix(settings): check the selection options and allowMultiple after and not in the default check in the settings validator 2026-06-04 17:27:42 +02:00
jakob.scheid 122663e2e3 fix(settings): check the name and i18n before the checks for a section in validateEntry in the settings validator 2026-06-04 17:27:42 +02:00
jakob.scheid 5c8073d264 test(settings): add unit test for the settings validator validateEntry function for test cases that should throw an error 2026-06-04 17:27:42 +02:00
jakob.scheid 970f4a74d1 fix(settings): do not enforce allowMultiple set for selection settings 2026-06-04 17:27:42 +02:00
jakob.scheid ecf9074522 test(settings): add unit test for the settings validator validateEntry function for test cases that should not throw an error 2026-06-04 17:27:42 +02:00
jakob.scheid ea87e0832a test(settings): add unit test for the settings validator validateSelectionOptions function for test cases that should throw an error 2026-06-04 17:27:42 +02:00
jakob.scheid f4121bf419 test(settings): add unit test for the settings validator validateSelectionOptions function for test cases that should not throw an error 2026-06-04 17:27:42 +02:00
jakob.scheid bf317eea35 test(settings): update test description for the unit test for the settings validator assertString function for test cases that should throw an error 2026-06-04 17:27:42 +02:00
jakob.scheid 948d6d41e8 test(settings): add unit test for the settings validator assertType function for test cases that should throw an error 2026-06-04 17:27:42 +02:00
jakob.scheid 867b3a41f8 test(settings): add unit test for the settings validator assertType function for test cases that should not throw an error 2026-06-04 17:27:42 +02:00
jakob.scheid e0268b6e6c test(settings): add unit test for the settings validator assertString function for test cases that should not throw an error 2026-06-04 17:27:42 +02:00
jakob.scheid 156b3b552c test(settings): add unit test for the settings validator assertString function for test cases that should throw an error 2026-06-04 17:27:42 +02:00
jakob.scheid 39e6c94d09 test(settings): Add settings validator utility test boilerplate 2026-06-04 17:27:42 +02:00
jakob.scheid 76fda9e5c6 Merge pull request 'Fix centering of search bar on small screens' (#112) from bug/center-searchbar into main
Deploy on dev / Deploy on dev (push) Successful in 37s
Reviewed-on: #112
Reviewed-by: Jakob Scheid
2026-06-04 15:33:15 +02:00
jakob.scheid d9c19b252e fix(search-bar): re-add left padding 2026-06-04 15:32:46 +02:00
johannes.vos 91fa06898f style(searchbar): apply internal text indentation to the input field 2026-06-04 14:19:34 +02:00
johannes.vos 6d7dd7dc40 style(searchbar): make wrapper padding symmetric and set width to 100% 2026-06-04 14:19:04 +02:00
jakob.scheid 5122d93072 Merge pull request 'Language switch button unit test' (#108) from testing/language-switch into main
Deploy on dev / Deploy on dev (push) Successful in 38s
Reviewed-on: #108
Reviewed-by: Jakob Scheid
2026-06-04 13:46:17 +02:00
jakob.scheid dc4c47e2ef test(language-switch-button): remove redundant test file 2026-06-04 13:45:22 +02:00
jakob.scheid a5dede3485 Merge remote-tracking branch 'refs/remotes/origin/testing/language-switch' into testing/language-switch 2026-06-04 13:44:26 +02:00
jakob.scheid eb892d9725 test(language-switch-button): move test file to the correct directory 2026-06-04 13:43:55 +02:00
johannes.vos 27f696247d test: move language switch test, fix header comments and code indentation 2026-06-04 13:43:07 +02:00
johannes.vos 3a07b0482f chore: add @vue/test-utils to devDependencies 2026-06-04 13:43:07 +02:00
johannes.vos 88634e10cd validate dropdown closes on click outside the component 2026-06-04 13:43:07 +02:00
johannes.vos 98cc6b7556 assert language selection updates localStorage and HTML attributes 2026-06-04 13:43:07 +02:00
johannes.vos 0bb0f23347 verify initial closed state and toggle opening of dropdown 2026-06-04 13:43:07 +02:00
johannes.vos 02af96a07d initialize language switch test suite with beforeEach setup 2026-06-04 13:43:07 +02:00
johannes.vos a6194bb874 mock i18n and icon dependencies for language switch 2026-06-04 13:43:07 +02:00
johannes.vos d6700d6965 add imports 2026-06-04 13:43:07 +02:00
johannes.vos 54ffaf73e3 add license 2026-06-04 13:43:07 +02:00
johannes.vos ebe21f7f4d add LanguageSwitchButton.test.js file - empty 2026-06-04 13:43:07 +02:00
jakob.scheid 37515268d7 Merge pull request 'Fix navbar alignment on mobile devices' (#110) from feature/fix-navbar-alignment-on-mobile-devices into main
Deploy on dev / Deploy on dev (push) Successful in 32s
Reviewed-on: #110
Reviewed-by: Jakob Gregory <7+jakob.gregory@noreply.localhost>
Reviewed-by: Jakob Scheid
2026-06-04 13:40:29 +02:00
jakob.scheid c919263c36 feat(navbar-padding): use the responsivity of the main content padding CSS variables 2026-06-04 13:39:58 +02:00
jakob.scheid 592eb7222f move main content padding CSS variables to the app wrapper 2026-06-04 13:39:58 +02:00
johannes.vos 98579b726b style(nav): reduce navbar horizontal padding on small screens for better alignment 2026-06-04 13:39:58 +02:00
johannes.vos 918d6768e8 test: move language switch test, fix header comments and code indentation 2026-06-04 13:34:48 +02:00
johannes.vos 924698df24 chore: add @vue/test-utils to devDependencies 2026-06-04 13:33:46 +02:00
jakob.scheid 4e6c94afc8 Merge pull request 'Fix spacing between Seekra logo and slogan' (#109) from feature/vertical-spacing-slogan-logo into main
Deploy on dev / Deploy on dev (push) Successful in 32s
Reviewed-on: #109
Reviewed-by: Jakob Gregory
2026-06-04 13:22:17 +02:00
johannes.vos f2f7e9e23c remove unnecesary empty code lines 2026-06-04 13:16:31 +02:00
johannes.vos 08949d5bb4 remove @media (max-width: 48rem) - unneccesary 2026-06-04 13:13:58 +02:00
johannes.vos 65153db414 style(search): implement responsive mobile spacing for slogan via media query 2026-06-04 13:11:55 +02:00
johannes.vos 58e4640965 style(search): add desktop vertical spacing and fix line-height for slogan 2026-06-04 13:10:43 +02:00
johannes.vos 521f1becb4 validate dropdown closes on click outside the component 2026-06-04 12:59:59 +02:00
johannes.vos dc1caac2ed assert language selection updates localStorage and HTML attributes 2026-06-04 12:59:41 +02:00
johannes.vos e8cb978a61 verify initial closed state and toggle opening of dropdown 2026-06-04 12:59:08 +02:00
johannes.vos 1c3175a3e4 initialize language switch test suite with beforeEach setup 2026-06-04 12:58:47 +02:00
johannes.vos a97ee3c660 mock i18n and icon dependencies for language switch 2026-06-04 12:58:20 +02:00
johannes.vos baa1f6ed44 add imports 2026-06-04 12:56:46 +02:00
johannes.vos d5b76b0a17 add license 2026-06-04 12:51:24 +02:00
johannes.vos 5c3d7ce535 add LanguageSwitchButton.test.js file - empty 2026-06-04 12:50:35 +02:00
6 changed files with 128 additions and 7 deletions
+1
View File
@@ -17,6 +17,7 @@
"vue-router": "^5.0.6"
},
"devDependencies": {
"@vue/test-utils": "^2.4.6",
"@vitejs/plugin-vue": "^6.0.6",
"jsdom": "^29.1.1",
"vite": "^8.0.10",
+5 -2
View File
@@ -42,15 +42,18 @@ watch(colorScheme, val => updateColorScheme(val))
</template>
<style scoped>
.main-content {
#app-wrapper {
--main-content-padding-x: 30px;
--main-content-padding-y: 40px;
--main-content-padding: var(--main-content-padding-y) var(--main-content-padding-x);
}
.main-content {
flex-grow: 1;
}
@media (max-width: 48rem) {
.main-content {
#app-wrapper {
--main-content-padding-x: 15px;
}
}
@@ -0,0 +1,114 @@
/*
Copyright 2026 Seekra
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
import { expect, test, describe, vi, beforeEach } from 'vitest';
import { mount } from '@vue/test-utils';
import LanguageSwitchButton from '../LanguageSwitchButton.vue';
import { loadLanguage } from '@/i18n';
vi.mock('@/i18n', () => ({
loadLanguage: vi.fn(() => Promise.resolve()),
LANGUAGES_RTL: ['ar', 'he'],
SUPPORTED_LANGUAGES: ['en', 'de', 'ar']
}));
vi.mock('vue-i18n', () => ({
useI18n: () => ({
t: (key) => key,
locale: { value: 'de' }
})
}));
vi.mock('@/features/icons/components/Icon.vue', () => ({
default: {
name: 'Icon',
template: '<span>Icon</span>'
}
}));
describe('LanguageSwitchButton.vue', () => {
beforeEach(() => {
vi.clearAllMocks();
localStorage.clear();
document.documentElement.lang = '';
document.documentElement.dir = '';
});
test('renders correctly with initial state closed', () => {
const wrapper = mount(LanguageSwitchButton);
expect(wrapper.find('.language-button').exists()).toBe(true);
expect(wrapper.find('.language-dropdown').exists()).toBe(false);
expect(wrapper.find('.language-button').attributes('aria-expanded')).toBe('false');
});
test('opens the dropdown when language button is clicked', async () => {
const wrapper = mount(LanguageSwitchButton);
const button = wrapper.find('.language-button');
await button.trigger('click');
expect(wrapper.find('.language-dropdown').exists()).toBe(true);
expect(button.attributes('aria-expanded')).toBe('true');
});
const languageTestCases = [
{ code: 'en', expectedDir: 'ltr' },
{ code: 'de', expectedDir: 'ltr' },
{ code: 'ar', expectedDir: 'rtl' }
];
test.for(languageTestCases)('selectLanguage($code) sets localStorage, html attributes and changes layout direction to $expectedDir', async ({ code, expectedDir }) => {
const wrapper = mount(LanguageSwitchButton);
await wrapper.find('.language-button').trigger('click');
const options = wrapper.findAll('.language-dropdown li');
const optionToClick = options.find(opt => opt.text().includes(code));
await optionToClick.trigger('click');
expect(loadLanguage).toHaveBeenCalledWith(code);
expect(localStorage.getItem('locale')).toBe(code);
expect(document.documentElement.lang).toBe(code);
expect(document.documentElement.dir).toBe(expectedDir);
expect(wrapper.find('.language-dropdown').exists()).toBe(false);
});
test('closes the dropdown when clicking outside the component', async () => {
const wrapper = mount(LanguageSwitchButton, {
attachTo: document.body
});
await wrapper.find('.language-button').trigger('click');
expect(wrapper.find('.language-dropdown').exists()).toBe(true);
await new Promise(resolve => setTimeout(resolve, 0));
const externalDiv = document.createElement('div');
document.body.appendChild(externalDiv);
const clickEvent = new MouseEvent('click', { bubbles: true });
externalDiv.dispatchEvent(clickEvent);
await wrapper.vm.$nextTick();
expect(wrapper.find('.language-dropdown').exists()).toBe(false);
wrapper.unmount();
externalDiv.remove();
});
});
+1 -1
View File
@@ -42,7 +42,7 @@ import NavbarSearchBarWrapper from './NavbarSearchBarWrapper.vue';
display: flex;
justify-content: space-between;
align-items: center;
padding: 18px 40px;
padding: 18px var(--main-content-padding-x);
height: 42px;
}
+3 -1
View File
@@ -73,7 +73,8 @@ const submitSearch = function () {
border-radius: calc(var(--content-height) * 0.5 + var(--submit-button-padding-y) + var(--padding));
padding: var(--padding);
padding-left: var(--padding-left);
width: calc(100% - var(--padding-left));
width: 100%;
box-sizing: border-box;
}
.search-wrapper input {
@@ -83,6 +84,7 @@ const submitSearch = function () {
font-size: 1rem;
background: transparent;
height: calc(var(--content-height) + 2 * var(--submit-button-padding-y));
padding-left: 12px;
}
.search-button {
+2 -1
View File
@@ -68,8 +68,9 @@ const submitSearch = function () {
}
.slogan {
margin: 0;
margin-top: 1rem;
font-size: small;
line-height: normal;
}
.search-container {