Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/components/dialog/IntegrationDialog.vue
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ Licensed under the Apache 2.0 license (see https://www.apache.org/licenses/LICEN
>
<div class="col-start-0 col-span-8" :class="{ 'pb-4': !editable }">
<h5 class="my-1 text-base font-bold">
{{ $t('integration.dialog.label.integrationTitle') }}
{{ $t('integration.dialog.label.integrationTitle') }}*
</h5>

<div v-if="!tokenLabel" class="error col-span-8 mb-2">
Expand Down
50 changes: 50 additions & 0 deletions tests/component/IntegrationDialog.spec.ts
Original file line number Diff line number Diff line change
@@ -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(/\*$/);
});
});