From 783ce01ba898724af0384a36243e551792002414 Mon Sep 17 00:00:00 2001 From: jay23606 <4602056+jay23606@users.noreply.github.com> Date: Wed, 21 Oct 2026 14:29:05 -0400 Subject: [PATCH] Mark integration title field as required in integration dialog --- src/components/dialog/IntegrationDialog.vue | 2 +- tests/component/IntegrationDialog.spec.ts | 50 +++++++++++++++++++++ 2 files changed, 51 insertions(+), 1 deletion(-) create mode 100644 tests/component/IntegrationDialog.spec.ts diff --git a/src/components/dialog/IntegrationDialog.vue b/src/components/dialog/IntegrationDialog.vue index ce428bd1..6bbc2981 100644 --- a/src/components/dialog/IntegrationDialog.vue +++ b/src/components/dialog/IntegrationDialog.vue @@ -86,7 +86,7 @@ Licensed under the Apache 2.0 license (see https://www.apache.org/licenses/LICEN >
- {{ $t('integration.dialog.label.integrationTitle') }} + {{ $t('integration.dialog.label.integrationTitle') }}*
diff --git a/tests/component/IntegrationDialog.spec.ts b/tests/component/IntegrationDialog.spec.ts new file mode 100644 index 00000000..4c6ec430 --- /dev/null +++ b/tests/component/IntegrationDialog.spec.ts @@ -0,0 +1,50 @@ +/* + Copyright LBI-DHP and/or licensed to LBI-DHP under one or more + contributor license agreements (LBI-DHP: Ludwig Boltzmann Institute + for Digital Health and Prevention -- A research institute of the + Ludwig Boltzmann Gesellschaft, Oesterreichische Vereinigung zur + Foerderung der wissenschaftlichen Forschung). + Licensed under the Apache 2.0 license (see https://www.apache.org/licenses/LICENSE-2.0). + */ +import { mount } from '@vue/test-utils'; +import { ref } from 'vue'; +import { expect, describe, it, vi } from 'vitest'; +import IntegrationDialog from '../../src/components/dialog/IntegrationDialog.vue'; + +vi.mock('vue-i18n', () => ({ + useI18n: (): { t: (key: string) => string } => ({ t: (key: string) => key }), +})); + +vi.mock('../../src/stores/studyStore', () => ({ + useStudyStore: (): { study: { status: string } } => ({ + study: { status: 'DRAFT' }, + }), +})); + +describe('IntegrationDialog', () => { + it('marks the integration title label as required', () => { + const wrapper = mount(IntegrationDialog, { + global: { + mocks: { + $t: (key: string): string => key, + }, + provide: { + dialogRef: ref({ data: { observationList: [], factories: [] } }), + }, + stubs: { + InputText: true, + Dropdown: true, + Button: true, + }, + }, + }); + + const titleLabel = wrapper + .findAll('h5') + .find((h) => + h.text().includes('integration.dialog.label.integrationTitle'), + ); + + expect(titleLabel?.text()).toMatch(/\*$/); + }); +});