diff --git a/app/frontend/tests/unit/components/base/BaseDialog.spec.js b/app/frontend/tests/unit/components/base/BaseDialog.spec.js index fe51b6699..d4f282486 100644 --- a/app/frontend/tests/unit/components/base/BaseDialog.spec.js +++ b/app/frontend/tests/unit/components/base/BaseDialog.spec.js @@ -6,14 +6,17 @@ import { createTestingPinia } from '@pinia/testing'; import BaseDialog from '~/components/base/BaseDialog.vue'; import { useFormStore } from '~/store/form'; +import { useAppStore } from '~/store/app'; describe('BaseDialog.vue', () => { const pinia = createTestingPinia(); setActivePinia(pinia); const formStore = useFormStore(); + const appStore = useAppStore(pinia); beforeEach(() => { formStore.$reset(); + appStore.$reset(); }); it('renders with ok button', async () => { diff --git a/app/frontend/tests/unit/components/base/BaseFilter.spec.js b/app/frontend/tests/unit/components/base/BaseFilter.spec.js index 00dc15d34..dc683cf05 100644 --- a/app/frontend/tests/unit/components/base/BaseFilter.spec.js +++ b/app/frontend/tests/unit/components/base/BaseFilter.spec.js @@ -3,13 +3,16 @@ import { describe, it } from 'vitest'; import { createTestingPinia } from '@pinia/testing'; import BaseFilter from '~/components/base/BaseFilter.vue'; import { useFormStore } from '~/store/form'; +import { useAppStore } from '~/store/app'; describe('BaseFilter.vue', () => { const pinia = createTestingPinia(); const formStore = useFormStore(); + const appStore = useAppStore(pinia); beforeEach(() => { formStore.$reset(); + appStore.$reset(); }); it('renders', async () => { diff --git a/app/frontend/tests/unit/components/base/BaseInternationalization.spec.js b/app/frontend/tests/unit/components/base/BaseInternationalization.spec.js index 378fe02fd..2ace70ff4 100644 --- a/app/frontend/tests/unit/components/base/BaseInternationalization.spec.js +++ b/app/frontend/tests/unit/components/base/BaseInternationalization.spec.js @@ -4,14 +4,17 @@ import { beforeEach, describe, it } from 'vitest'; import BaseInternationalization from '~/components/base/BaseInternationalization.vue'; import { useFormStore } from '~/store/form'; +import { useAppStore } from '~/store/app'; describe('BaseInternationalization.vue', () => { const pinia = createPinia(); setActivePinia(pinia); const formStore = useFormStore(pinia); + const appStore = useAppStore(pinia); beforeEach(() => { formStore.$reset(); + appStore.$reset(); formStore.isRTL = false; }); diff --git a/app/frontend/tests/unit/components/designer/FormViewer.spec.js b/app/frontend/tests/unit/components/designer/FormViewer.spec.js index 77c8f0090..277f8e82c 100644 --- a/app/frontend/tests/unit/components/designer/FormViewer.spec.js +++ b/app/frontend/tests/unit/components/designer/FormViewer.spec.js @@ -8,6 +8,7 @@ import getRouter from '~/router'; import FormViewer from '~/components/designer/FormViewer.vue'; import { useAuthStore } from '~/store/auth'; import { useFormStore } from '~/store/form'; +import { useAppStore } from '~/store/app'; describe('FormViewer.vue', () => { const formId = '123-456'; @@ -22,10 +23,12 @@ describe('FormViewer.vue', () => { setActivePinia(pinia); const authStore = useAuthStore(pinia); const formStore = useFormStore(pinia); + const appStore = useAppStore(pinia); beforeEach(() => { authStore.$reset(); formStore.$reset(); + appStore.$reset(); authStore.keycloak = { tokenParsed: { diff --git a/app/frontend/tests/unit/components/designer/profile/FormAPIProfile.spec.js b/app/frontend/tests/unit/components/designer/profile/FormAPIProfile.spec.js index bcbb6c94b..31d0ac25d 100644 --- a/app/frontend/tests/unit/components/designer/profile/FormAPIProfile.spec.js +++ b/app/frontend/tests/unit/components/designer/profile/FormAPIProfile.spec.js @@ -4,14 +4,17 @@ import { createTestingPinia } from '@pinia/testing'; import { setActivePinia } from 'pinia'; import { mount } from '@vue/test-utils'; import { nextTick } from 'vue'; +import { useAppStore } from '~/store/app'; describe('FormAPIProfile.vue', () => { const pinia = createTestingPinia(); setActivePinia(pinia); const formStore = useFormStore(pinia); + const appStore = useAppStore(pinia); beforeEach(() => { formStore.$reset(); + appStore.$reset(); }); it('renders properly', () => { diff --git a/app/frontend/tests/unit/components/designer/profile/FormDeploymentProfile.spec.js b/app/frontend/tests/unit/components/designer/profile/FormDeploymentProfile.spec.js index 4aed65007..7aa8a1992 100644 --- a/app/frontend/tests/unit/components/designer/profile/FormDeploymentProfile.spec.js +++ b/app/frontend/tests/unit/components/designer/profile/FormDeploymentProfile.spec.js @@ -5,14 +5,17 @@ import { setActivePinia } from 'pinia'; import { mount } from '@vue/test-utils'; import { FormProfileValues } from '~/utils/constants'; import { nextTick } from 'vue'; +import { useAppStore } from '~/store/app'; describe('FormDeploymentProfile.vue', () => { const pinia = createTestingPinia(); setActivePinia(pinia); const formStore = useFormStore(pinia); + const appStore = useAppStore(pinia); beforeEach(() => { formStore.$reset(); + appStore.$reset(); }); it('renders properly', () => { diff --git a/app/frontend/tests/unit/components/designer/profile/FormLabelProfile.spec.js b/app/frontend/tests/unit/components/designer/profile/FormLabelProfile.spec.js index d145f1888..1a014a118 100644 --- a/app/frontend/tests/unit/components/designer/profile/FormLabelProfile.spec.js +++ b/app/frontend/tests/unit/components/designer/profile/FormLabelProfile.spec.js @@ -7,18 +7,21 @@ import FormLabelProfile from '~/components/designer/profile/FormLabelProfile.vue import { userService } from '~/services'; import { useFormStore } from '~/store/form'; import { useNotificationStore } from '~/store/notification'; +import { useAppStore } from '~/store/app'; describe('FormLabelProfile.vue', () => { const pinia = createTestingPinia(); setActivePinia(pinia); const formStore = useFormStore(pinia); const notificationStore = useNotificationStore(pinia); + const appStore = useAppStore(pinia); const getUserLabelsSpy = vi.spyOn(userService, 'getUserLabels'); const addNotificationSpy = vi.spyOn(notificationStore, 'addNotification'); beforeEach(() => { formStore.$reset(); + appStore.$reset(); notificationStore.$reset(); getUserLabelsSpy.mockReset(); }); diff --git a/app/frontend/tests/unit/components/designer/profile/FormUseCaseProfile.spec.js b/app/frontend/tests/unit/components/designer/profile/FormUseCaseProfile.spec.js index 7faa37120..d2f44d546 100644 --- a/app/frontend/tests/unit/components/designer/profile/FormUseCaseProfile.spec.js +++ b/app/frontend/tests/unit/components/designer/profile/FormUseCaseProfile.spec.js @@ -5,14 +5,17 @@ import { FormProfileValues } from '~/utils/constants'; import { createTestingPinia } from '@pinia/testing'; import { setActivePinia } from 'pinia'; import { mount } from '@vue/test-utils'; +import { useAppStore } from '~/store/app'; describe('FormUseCaseProfile.vue', () => { const pinia = createTestingPinia(); setActivePinia(pinia); const formStore = useFormStore(pinia); + const appStore = useAppStore(pinia); beforeEach(() => { formStore.$reset(); + appStore.$reset(); }); it('renders properly', () => { @@ -36,6 +39,7 @@ describe('FormUseCaseProfile.vue', () => { const select = wrapper.findComponent('[data-test="case-select"]'); const items = select.componentVM.items; + // eslint-disable-next-line no-console console.log(items); expect(items).toEqual(FormProfileValues.USE_CASE); }); diff --git a/app/frontend/tests/unit/components/designer/settings/FormAccessSettings.spec.js b/app/frontend/tests/unit/components/designer/settings/FormAccessSettings.spec.js index 98590f307..82f8b5bf3 100644 --- a/app/frontend/tests/unit/components/designer/settings/FormAccessSettings.spec.js +++ b/app/frontend/tests/unit/components/designer/settings/FormAccessSettings.spec.js @@ -7,15 +7,18 @@ import { nextTick, ref } from 'vue'; import { useFormStore } from '~/store/form'; import FormAccessSettings from '~/components/designer/settings/FormAccessSettings.vue'; import { IdentityMode } from '~/utils/constants'; +import { useAppStore } from '~/store/app'; describe('FormAccessSettings.vue', () => { const pinia = createTestingPinia(); setActivePinia(pinia); const formStore = useFormStore(pinia); + const appStore = useAppStore(pinia); beforeEach(() => { formStore.$reset(); + appStore.$reset(); }); it('renders and displays 3 radio buttons', () => { diff --git a/app/frontend/tests/unit/components/designer/settings/FormFunctionalitySettings.spec.js b/app/frontend/tests/unit/components/designer/settings/FormFunctionalitySettings.spec.js index 4981b3489..8ab0c6a25 100644 --- a/app/frontend/tests/unit/components/designer/settings/FormFunctionalitySettings.spec.js +++ b/app/frontend/tests/unit/components/designer/settings/FormFunctionalitySettings.spec.js @@ -9,6 +9,7 @@ import { useFormStore } from '~/store/form'; import { useIdpStore } from '~/store/identityProviders'; import FormFunctionalitySettings from '~/components/designer/settings/FormFunctionalitySettings.vue'; import { FormRoleCodes, AppPermissions } from '~/utils/constants'; +import { useAppStore } from '~/store/app'; const IDIR = { active: true, @@ -109,11 +110,13 @@ describe('FormFunctionalitySettings.vue', () => { const authStore = useAuthStore(pinia); const formStore = useFormStore(pinia); const idpStore = useIdpStore(pinia); + const appStore = useAppStore(pinia); beforeEach(() => { authStore.$reset(); formStore.$reset(); idpStore.$reset(); + appStore.$reset(); authStore.identityProvider = ref({ code: 'idir', diff --git a/app/frontend/tests/unit/components/designer/settings/FormScheduleSettings.spec.js b/app/frontend/tests/unit/components/designer/settings/FormScheduleSettings.spec.js index 2fd74f621..5c3ec9f1e 100644 --- a/app/frontend/tests/unit/components/designer/settings/FormScheduleSettings.spec.js +++ b/app/frontend/tests/unit/components/designer/settings/FormScheduleSettings.spec.js @@ -9,15 +9,18 @@ import { useFormStore } from '~/store/form'; import FormScheduleSettings from '~/components/designer/settings/FormScheduleSettings.vue'; import { ScheduleType } from '~/utils/constants'; import { getSubmissionPeriodDates } from '~/utils/transformUtils'; +import { useAppStore } from '~/store/app'; describe('FormScheduleSettings.vue', () => { const pinia = createTestingPinia(); setActivePinia(pinia); const formStore = useFormStore(pinia); + const appStore = useAppStore(pinia); beforeEach(() => { formStore.$reset(); + appStore.$reset(); formStore.form = ref({ schedule: { enabled: null, diff --git a/app/frontend/tests/unit/components/designer/settings/FormSubmissionSettings.spec.js b/app/frontend/tests/unit/components/designer/settings/FormSubmissionSettings.spec.js index 9d323d0eb..acd2ea015 100644 --- a/app/frontend/tests/unit/components/designer/settings/FormSubmissionSettings.spec.js +++ b/app/frontend/tests/unit/components/designer/settings/FormSubmissionSettings.spec.js @@ -6,15 +6,18 @@ import { beforeEach, describe, expect, it } from 'vitest'; import { useFormStore } from '~/store/form'; import FormSubmissionSettings from '~/components/designer/settings/FormSubmissionSettings.vue'; import { nextTick } from 'vue'; +import { useAppStore } from '~/store/app'; describe('FormSubmissionSettings.vue', () => { const pinia = createTestingPinia(); setActivePinia(pinia); const formStore = useFormStore(pinia); + const appStore = useAppStore(pinia); beforeEach(() => { formStore.$reset(); + appStore.$reset(); }); it('renders and tests default values', () => { diff --git a/app/frontend/tests/unit/components/forms/ExportSubmissions.spec.js b/app/frontend/tests/unit/components/forms/ExportSubmissions.spec.js index 84b7a29e0..dd46e3a0a 100644 --- a/app/frontend/tests/unit/components/forms/ExportSubmissions.spec.js +++ b/app/frontend/tests/unit/components/forms/ExportSubmissions.spec.js @@ -8,6 +8,7 @@ import getRouter from '~/router'; import ExportSubmissions from '~/components/forms/ExportSubmissions.vue'; import { useAuthStore } from '~/store/auth'; import { useFormStore } from '~/store/form'; +import { useAppStore } from '~/store/app'; describe('ExportSubmissions.vue', () => { const formId = '123-456'; @@ -22,10 +23,12 @@ describe('ExportSubmissions.vue', () => { setActivePinia(pinia); const authStore = useAuthStore(pinia); const formStore = useFormStore(pinia); + const appStore = useAppStore(pinia); beforeEach(() => { authStore.$reset(); formStore.$reset(); + appStore.$reset(); }); it('renders', () => { diff --git a/app/frontend/tests/unit/components/forms/SubmissionsTable.spec.js b/app/frontend/tests/unit/components/forms/SubmissionsTable.spec.js index 490cfd583..b0e5c1e9d 100644 --- a/app/frontend/tests/unit/components/forms/SubmissionsTable.spec.js +++ b/app/frontend/tests/unit/components/forms/SubmissionsTable.spec.js @@ -8,6 +8,7 @@ import getRouter from '~/router'; import SubmissionsTable from '~/components/forms/SubmissionsTable.vue'; import { useAuthStore } from '~/store/auth'; import { useFormStore } from '~/store/form'; +import { useAppStore } from '~/store/app'; describe('SubmissionsTable.vue', () => { const formId = '123-456'; @@ -22,10 +23,12 @@ describe('SubmissionsTable.vue', () => { setActivePinia(pinia); const authStore = useAuthStore(pinia); const formStore = useFormStore(pinia); + const appStore = useAppStore(pinia); beforeEach(() => { authStore.$reset(); formStore.$reset(); + appStore.$reset(); }); it('renders', () => { diff --git a/app/frontend/tests/unit/components/forms/manage/ApiKey.spec.js b/app/frontend/tests/unit/components/forms/manage/ApiKey.spec.js index e58d6a1ca..7e4b35809 100644 --- a/app/frontend/tests/unit/components/forms/manage/ApiKey.spec.js +++ b/app/frontend/tests/unit/components/forms/manage/ApiKey.spec.js @@ -7,6 +7,7 @@ import { describe, beforeEach, vi } from 'vitest'; import ApiKey from '~/components/forms/manage/ApiKey.vue'; import { useFormStore } from '~/store/form'; import { FormPermissions } from '~/utils/constants'; +import { useAppStore } from '~/store/app'; const STUBS = { BaseCopyToClipboard: { @@ -32,9 +33,11 @@ describe('ApiKey.vue', () => { setActivePinia(pinia); const formStore = useFormStore(pinia); + const appStore = useAppStore(pinia); beforeEach(() => { formStore.$reset(); + appStore.$reset(); }); it('renders', () => { diff --git a/app/frontend/tests/unit/components/forms/manage/DocumentTemplate.spec.js b/app/frontend/tests/unit/components/forms/manage/DocumentTemplate.spec.js index e9514c10b..d4b8f8b8b 100644 --- a/app/frontend/tests/unit/components/forms/manage/DocumentTemplate.spec.js +++ b/app/frontend/tests/unit/components/forms/manage/DocumentTemplate.spec.js @@ -15,6 +15,7 @@ import { useFormStore } from '~/store/form'; import { useNotificationStore } from '~/store/notification'; import getRouter from '~/router'; import { ref } from 'vue'; +import { useAppStore } from '~/store/app'; const STUBS = { VDataTableServer: { @@ -33,7 +34,7 @@ const STUBS = { }; describe('DocumentTemplate.vue', () => { - let router, pinia, formStore, notificationStore; + let router, pinia, formStore, notificationStore, appStore; let createObjectURLSpy = vi.spyOn(window.URL, 'createObjectURL'); beforeEach(() => { @@ -47,9 +48,11 @@ describe('DocumentTemplate.vue', () => { formStore = useFormStore(pinia); notificationStore = useNotificationStore(pinia); + appStore = useAppStore(pinia); formStore.$reset(); notificationStore.$reset(); + appStore.$reset(); // Explicitly mock/spy on global functions createObjectURLSpy.mockImplementation(() => '#'); diff --git a/app/frontend/tests/unit/components/forms/manage/EmailTemplate.spec.js b/app/frontend/tests/unit/components/forms/manage/EmailTemplate.spec.js index a2df1ab67..7d225484b 100644 --- a/app/frontend/tests/unit/components/forms/manage/EmailTemplate.spec.js +++ b/app/frontend/tests/unit/components/forms/manage/EmailTemplate.spec.js @@ -7,6 +7,7 @@ import { ref } from 'vue'; import EmailTemplate from '~/components/forms/manage/EmailTemplate.vue'; import { useFormStore } from '~/store/form'; import { useNotificationStore } from '~/store/notification'; +import { useAppStore } from '~/store/app'; const STUBS = {}; @@ -16,10 +17,11 @@ describe('EmailTemplate.vue', () => { const formStore = useFormStore(pinia); const notificationStore = useNotificationStore(pinia); + const appStore = useAppStore(pinia); beforeEach(() => { formStore.$reset(); - + appStore.$reset(); formStore.emailTemplates = ref([ { body: 'Thank you for your {{ form.name }} submission. You can view your submission details by visiting the following links:', diff --git a/app/frontend/tests/unit/components/forms/manage/ManageForm.spec.js b/app/frontend/tests/unit/components/forms/manage/ManageForm.spec.js index ec93f2a50..d2701c888 100644 --- a/app/frontend/tests/unit/components/forms/manage/ManageForm.spec.js +++ b/app/frontend/tests/unit/components/forms/manage/ManageForm.spec.js @@ -10,6 +10,7 @@ import getRouter from '~/router'; import { useFormStore } from '~/store/form'; import { useNotificationStore } from '~/store/notification'; import { FormPermissions } from '~/utils/constants'; +import { useAppStore } from '~/store/app'; const STUBS = { VDataTable: { @@ -42,12 +43,14 @@ describe('ManageForm.vue', () => { setActivePinia(pinia); const formStore = useFormStore(pinia); const notificationStore = useNotificationStore(pinia); + const appStore = useAppStore(pinia); const readFormSpy = vi.spyOn(formStore, 'readFormSubscriptionData'); const addNotificationSpy = vi.spyOn(notificationStore, 'addNotification'); beforeEach(() => { formStore.$reset(); notificationStore.$reset(); + appStore.$reset(); readFormSpy.mockReset(); addNotificationSpy.mockReset(); readFormSpy.mockImplementationOnce(async () => {}); diff --git a/app/frontend/tests/unit/components/forms/manage/ManageFormActions.spec.js b/app/frontend/tests/unit/components/forms/manage/ManageFormActions.spec.js index 7b7257561..3fa13bbfb 100644 --- a/app/frontend/tests/unit/components/forms/manage/ManageFormActions.spec.js +++ b/app/frontend/tests/unit/components/forms/manage/ManageFormActions.spec.js @@ -8,6 +8,7 @@ import ManageFormActions from '~/components/forms/manage/ManageFormActions.vue'; import { useFormStore } from '~/store/form'; import { FormPermissions } from '~/utils/constants'; import { ref } from 'vue'; +import { useAppStore } from '~/store/app'; vi.mock('vue-router', () => ({ useRouter: vi.fn(() => ({ @@ -30,9 +31,11 @@ describe('ManageForm.vue', () => { setActivePinia(pinia); const formStore = useFormStore(pinia); + const appStore = useAppStore(pinia); beforeEach(() => { formStore.$reset(); + appStore.$reset(); }); it('renders', async () => { diff --git a/app/frontend/tests/unit/components/forms/manage/ManageLayout.spec.js b/app/frontend/tests/unit/components/forms/manage/ManageLayout.spec.js index ffa573558..9e274eaf4 100644 --- a/app/frontend/tests/unit/components/forms/manage/ManageLayout.spec.js +++ b/app/frontend/tests/unit/components/forms/manage/ManageLayout.spec.js @@ -9,6 +9,7 @@ import ManageLayout from '~/components/forms/manage/ManageLayout.vue'; import { useFormStore } from '~/store/form'; import { FormPermissions } from '~/utils/constants'; import { ref } from 'vue'; +import { useAppStore } from '~/store/app'; describe('ManageLayout.vue', () => { const pinia = createTestingPinia(); @@ -19,9 +20,11 @@ describe('ManageLayout.vue', () => { setActivePinia(pinia); const formStore = useFormStore(pinia); + const appStore = useAppStore(pinia); beforeEach(() => { formStore.$reset(); + appStore.$reset(); }); it('renders', () => { diff --git a/app/frontend/tests/unit/components/forms/manage/ManageVersions.spec.js b/app/frontend/tests/unit/components/forms/manage/ManageVersions.spec.js index eef6a06cd..7796f8eb0 100644 --- a/app/frontend/tests/unit/components/forms/manage/ManageVersions.spec.js +++ b/app/frontend/tests/unit/components/forms/manage/ManageVersions.spec.js @@ -13,6 +13,7 @@ import ManageVersions from '~/components/forms/manage/ManageVersions.vue'; import { formService } from '~/services'; import { useFormStore } from '~/store/form'; import { useNotificationStore } from '~/store/notification'; +import { useAppStore } from '~/store/app'; vi.mock('vue-router', () => ({ useRouter: vi.fn(() => ({ @@ -32,10 +33,12 @@ describe('ManageVersions.vue', () => { setActivePinia(pinia); const formStore = useFormStore(pinia); const notificationStore = useNotificationStore(pinia); + const appStore = useAppStore(pinia); beforeEach(() => { formStore.$reset(); notificationStore.$reset(); + appStore.$reset(); }); it('renders', async () => { diff --git a/app/frontend/tests/unit/components/forms/manage/ShareForm.spec.js b/app/frontend/tests/unit/components/forms/manage/ShareForm.spec.js index 4be51d4c7..adeb85427 100644 --- a/app/frontend/tests/unit/components/forms/manage/ShareForm.spec.js +++ b/app/frontend/tests/unit/components/forms/manage/ShareForm.spec.js @@ -7,6 +7,7 @@ import { useRouter } from 'vue-router'; import ShareForm from '~/components/forms/manage/ShareForm.vue'; import { useFormStore } from '~/store/form'; +import { useAppStore } from '~/store/app'; const STUBS = { BaseCopyToClipboard: { @@ -41,9 +42,11 @@ describe('ShareForm.vue', () => { const pinia = createTestingPinia(); setActivePinia(pinia); const formStore = useFormStore(pinia); + const appStore = useAppStore(pinia); beforeEach(() => { formStore.$reset(); + appStore.$reset(); }); it('formLink resolves a URL and returns the href', async () => { diff --git a/app/frontend/tests/unit/components/forms/manage/Subscription.spec.js b/app/frontend/tests/unit/components/forms/manage/Subscription.spec.js index 03f882412..a4d645c38 100644 --- a/app/frontend/tests/unit/components/forms/manage/Subscription.spec.js +++ b/app/frontend/tests/unit/components/forms/manage/Subscription.spec.js @@ -5,14 +5,17 @@ import { beforeEach, vi } from 'vitest'; import Subscription from '~/components/forms/manage/Subscription.vue'; import { useFormStore } from '~/store/form'; +import { useAppStore } from '~/store/app'; describe('Subscription.vue', () => { const pinia = createTestingPinia(); setActivePinia(pinia); const formStore = useFormStore(pinia); + const appStore = useAppStore(pinia); beforeEach(() => { formStore.$reset(); + appStore.$reset(); }); it('showHideKey should toggle the value', async () => { diff --git a/app/frontend/tests/unit/components/forms/manage/TeamManagement.spec.js b/app/frontend/tests/unit/components/forms/manage/TeamManagement.spec.js index c5f210b1b..c166430e6 100644 --- a/app/frontend/tests/unit/components/forms/manage/TeamManagement.spec.js +++ b/app/frontend/tests/unit/components/forms/manage/TeamManagement.spec.js @@ -11,6 +11,8 @@ import { useAuthStore } from '~/store/auth'; import { useFormStore } from '~/store/form'; import { useIdpStore } from '~/store/identityProviders'; import { useNotificationStore } from '~/store/notification'; +import { useAppStore } from '~/store/app'; + import { AppPermissions, FormPermissions, @@ -275,6 +277,7 @@ describe('TeamManagement.vue', () => { const formStore = useFormStore(pinia); const idpStore = useIdpStore(pinia); const notificationStore = useNotificationStore(pinia); + const appStore = useAppStore(pinia); const fetchFormSpy = vi.spyOn(formStore, 'fetchForm'); const listRolesSpy = vi.spyOn(roleService, 'list'); @@ -282,6 +285,7 @@ describe('TeamManagement.vue', () => { authStore.$reset(); formStore.$reset(); idpStore.$reset(); + appStore.$reset(); notificationStore.$reset(); fetchFormSpy.mockReset(); listRolesSpy.mockReset(); diff --git a/app/frontend/tests/unit/components/forms/submission/ManageSubmissionUsers.spec.js b/app/frontend/tests/unit/components/forms/submission/ManageSubmissionUsers.spec.js index 6d08b408c..bfb3ff7c0 100644 --- a/app/frontend/tests/unit/components/forms/submission/ManageSubmissionUsers.spec.js +++ b/app/frontend/tests/unit/components/forms/submission/ManageSubmissionUsers.spec.js @@ -11,6 +11,7 @@ import { useFormStore } from '~/store/form'; import { useNotificationStore } from '~/store/notification'; import { useIdpStore } from '~/store/identityProviders'; import { FormPermissions } from '~/utils/constants'; +import { useAppStore } from '~/store/app'; const providers = require('../../../fixtures/identityProviders.json'); @@ -34,6 +35,8 @@ describe('ManageSubmissionUsers.vue', () => { const pinia = createTestingPinia({ stubActions: false }); setActivePinia(pinia); const formStore = useFormStore(pinia); + useAppStore(pinia); + formStore.form.name = 'myForm'; getSubmissionUsersSpy.mockImplementation(() => ({ data: [] })); const wrapper = mount(ManageSubmissionUsers, { diff --git a/app/frontend/tests/unit/components/forms/submission/MySubmissionsActions.spec.js b/app/frontend/tests/unit/components/forms/submission/MySubmissionsActions.spec.js index 81d35de05..b31fd7fc8 100644 --- a/app/frontend/tests/unit/components/forms/submission/MySubmissionsActions.spec.js +++ b/app/frontend/tests/unit/components/forms/submission/MySubmissionsActions.spec.js @@ -8,6 +8,7 @@ import MySubmissionsActions from '~/components/forms/submission/MySubmissionsAct import getRouter from '~/router'; import { useFormStore } from '~/store/form'; import { FormPermissions } from '~/utils/constants'; +import { useAppStore } from '~/store/app'; const FORM_ID = '123'; const STUBS = { @@ -24,6 +25,8 @@ const STUBS = { describe('MySubmissionsActions', () => { const pinia = createTestingPinia(); const formStore = useFormStore(pinia); + const appStore = useAppStore(pinia); + setActivePinia(pinia); const router = createRouter({ history: createWebHistory(), @@ -32,6 +35,7 @@ describe('MySubmissionsActions', () => { beforeEach(() => { formStore.$reset(); + appStore.$reset(); }); it('renders', () => { diff --git a/app/frontend/tests/unit/components/forms/submission/MySubmissionsTable.spec.js b/app/frontend/tests/unit/components/forms/submission/MySubmissionsTable.spec.js index efb9afaa9..5ef54adb6 100644 --- a/app/frontend/tests/unit/components/forms/submission/MySubmissionsTable.spec.js +++ b/app/frontend/tests/unit/components/forms/submission/MySubmissionsTable.spec.js @@ -7,6 +7,7 @@ import { createRouter, createWebHistory } from 'vue-router'; import getRouter from '~/router'; import MySubmissionsTable from '~/components/forms/submission/MySubmissionsTable.vue'; import { useFormStore } from '~/store/form'; +import { useAppStore } from '~/store/app'; describe('MySubmissionsTable.vue', () => { const formId = '123-456'; @@ -20,6 +21,7 @@ describe('MySubmissionsTable.vue', () => { setActivePinia(pinia); const formStore = useFormStore(pinia); + const appStore = useAppStore(pinia); const fetchFormSpy = vi.spyOn(formStore, 'fetchForm').mockResolvedValue({}); const fetchFormFieldsSpy = vi @@ -30,6 +32,7 @@ describe('MySubmissionsTable.vue', () => { fetchFormSpy.mockReset(); fetchFormFieldsSpy.mockReset(); formStore.$reset(); + appStore.$reset(); formStore.form = { versions: [ diff --git a/app/frontend/tests/unit/components/forms/submission/NotesPanel.spec.js b/app/frontend/tests/unit/components/forms/submission/NotesPanel.spec.js index cf18090bf..e7c1449fa 100644 --- a/app/frontend/tests/unit/components/forms/submission/NotesPanel.spec.js +++ b/app/frontend/tests/unit/components/forms/submission/NotesPanel.spec.js @@ -8,6 +8,7 @@ import { useFormStore } from '~/store/form'; import { useNotificationStore } from '~/store/notification'; import { formService } from '~/services'; import { rbacService } from '~/services'; +import { useAppStore } from '~/store/app'; const SUBMISSION_ID = 'submissionId'; const USER_ID = 'userId'; @@ -29,6 +30,7 @@ describe('NotesPanel', () => { setActivePinia(pinia); const formStore = useFormStore(pinia); const notificationStore = useNotificationStore(pinia); + const appStore = useAppStore(pinia); const addNotificationSpy = vi .spyOn(notificationStore, 'addNotification') @@ -37,6 +39,7 @@ describe('NotesPanel', () => { beforeEach(() => { formStore.$reset(); notificationStore.$reset(); + appStore.$reset(); addNotificationSpy.mockReset(); }); diff --git a/app/frontend/tests/unit/components/forms/submission/StatusPanel.spec.js b/app/frontend/tests/unit/components/forms/submission/StatusPanel.spec.js index 3272fbb74..f41cd9af8 100644 --- a/app/frontend/tests/unit/components/forms/submission/StatusPanel.spec.js +++ b/app/frontend/tests/unit/components/forms/submission/StatusPanel.spec.js @@ -10,6 +10,7 @@ import { useFormStore } from '~/store/form'; import { useNotificationStore } from '~/store/notification'; import { formService } from '~/services'; import { rbacService } from '~/services'; +import { useAppStore } from '~/store/app'; const FORM_ID = 'formId'; const SUBMISSION_ID = 'submissionId'; @@ -53,6 +54,7 @@ describe('StatusPanel', () => { const authStore = useAuthStore(pinia); const formStore = useFormStore(pinia); const notificationStore = useNotificationStore(pinia); + const appStore = useAppStore(pinia); const addNotificationSpy = vi .spyOn(notificationStore, 'addNotification') @@ -64,6 +66,7 @@ describe('StatusPanel', () => { authStore.$reset(); formStore.$reset(); notificationStore.$reset(); + appStore.$reset(); addNotificationSpy.mockReset(); getFormUsersSpy.mockReset(); diff --git a/app/frontend/tests/unit/components/forms/submission/StatusTable.spec.js b/app/frontend/tests/unit/components/forms/submission/StatusTable.spec.js index 7ba8def34..2bda04208 100644 --- a/app/frontend/tests/unit/components/forms/submission/StatusTable.spec.js +++ b/app/frontend/tests/unit/components/forms/submission/StatusTable.spec.js @@ -7,6 +7,7 @@ import { formService } from '~/services'; import StatusTable from '~/components/forms/submission/StatusTable.vue'; import { useFormStore } from '~/store/form'; import { useNotificationStore } from '~/store/notification'; +import { useAppStore } from '~/store/app'; describe('StatusTable.vue', () => { const submissionId = '123-456'; @@ -16,10 +17,12 @@ describe('StatusTable.vue', () => { setActivePinia(pinia); const formStore = useFormStore(pinia); const notificationStore = useNotificationStore(pinia); + const appStore = useAppStore(pinia); beforeEach(() => { formStore.$reset(); notificationStore.$reset(); + appStore.$reset(); }); it('renders', async () => { diff --git a/app/frontend/tests/unit/components/forms/submission/UserDuplicateSubmission.spec.js b/app/frontend/tests/unit/components/forms/submission/UserDuplicateSubmission.spec.js index 85531594e..620ca2dd3 100644 --- a/app/frontend/tests/unit/components/forms/submission/UserDuplicateSubmission.spec.js +++ b/app/frontend/tests/unit/components/forms/submission/UserDuplicateSubmission.spec.js @@ -6,6 +6,7 @@ import { beforeEach, vi } from 'vitest'; import UserDuplicateSubmission from '~/components/forms/submission/UserDuplicateSubmission.vue'; import { useFormStore } from '~/store/form'; import { useNotificationStore } from '~/store/notification'; +import { useAppStore } from '~/store/app'; const STUBS = { VSkeletonLoader: { @@ -22,10 +23,12 @@ describe('UserDuplicateSubmission.vue', () => { setActivePinia(pinia); const formStore = useFormStore(pinia); const notificationStore = useNotificationStore(pinia); + const appStore = useAppStore(pinia); beforeEach(() => { formStore.$reset(); notificationStore.$reset(); + appStore.$reset(); }); it('renders', async () => { diff --git a/app/frontend/tests/unit/components/forms/submission/UserSubmission.spec.js b/app/frontend/tests/unit/components/forms/submission/UserSubmission.spec.js index 83f0038d3..2c6712567 100644 --- a/app/frontend/tests/unit/components/forms/submission/UserSubmission.spec.js +++ b/app/frontend/tests/unit/components/forms/submission/UserSubmission.spec.js @@ -7,6 +7,7 @@ import { useRouter } from 'vue-router'; import UserSubmission from '~/components/forms/submission/UserSubmission.vue'; import { useFormStore } from '~/store/form'; import { useNotificationStore } from '~/store/notification'; +import { useAppStore } from '~/store/app'; vi.mock('vue-router', () => ({ useRouter: vi.fn(() => ({ @@ -31,10 +32,12 @@ describe('UserSubmission.vue', () => { setActivePinia(pinia); const formStore = useFormStore(pinia); const notificationStore = useNotificationStore(pinia); + const appStore = useAppStore(pinia); beforeEach(() => { formStore.$reset(); notificationStore.$reset(); + appStore.$reset(); }); it('renders', async () => { diff --git a/app/frontend/tests/unit/components/infolinks/ProactiveHelpPreviewDialog.spec.js b/app/frontend/tests/unit/components/infolinks/ProactiveHelpPreviewDialog.spec.js index 1eb4add91..c5a767b12 100644 --- a/app/frontend/tests/unit/components/infolinks/ProactiveHelpPreviewDialog.spec.js +++ b/app/frontend/tests/unit/components/infolinks/ProactiveHelpPreviewDialog.spec.js @@ -8,6 +8,7 @@ import { rbacService } from '~/services'; import getRouter from '~/router'; import ProactiveHelpPreviewDialog from '~/components/infolinks/ProactiveHelpPreviewDialog.vue'; import { useFormStore } from '~/store/form'; +import { useAppStore } from '~/store/app'; describe('ProactiveHelpPreviewDialog.vue', () => { const getSubmissionUsersSpy = vi.spyOn(rbacService, 'getSubmissionUsers'); @@ -19,10 +20,12 @@ describe('ProactiveHelpPreviewDialog.vue', () => { setActivePinia(pinia); const formStore = useFormStore(pinia); + const appStore = useAppStore(pinia); beforeEach(() => { getSubmissionUsersSpy.mockReset(); formStore.$reset(); + appStore.$reset(); }); afterAll(() => { diff --git a/app/frontend/tests/unit/store/modules/auth.actions.spec.js b/app/frontend/tests/unit/store/modules/auth.actions.spec.js index f3c87da42..03dbe633f 100644 --- a/app/frontend/tests/unit/store/modules/auth.actions.spec.js +++ b/app/frontend/tests/unit/store/modules/auth.actions.spec.js @@ -26,6 +26,7 @@ describe('auth actions', () => { beforeEach(() => { mockStore.$reset(); formStore.$reset(); + appStore.$reset(); mockStore.keycloak = { createLoginUrl: vi.fn(() => 'about:blank'), createLogoutUrl: vi.fn(() => 'about:blank'), diff --git a/app/frontend/tests/unit/store/modules/form.actions.spec.js b/app/frontend/tests/unit/store/modules/form.actions.spec.js index 6d559c41a..79c9f5835 100644 --- a/app/frontend/tests/unit/store/modules/form.actions.spec.js +++ b/app/frontend/tests/unit/store/modules/form.actions.spec.js @@ -9,12 +9,14 @@ import { } from '~/services'; import { useFormStore } from '~/store/form'; import { useNotificationStore } from '~/store/notification'; +import { useAppStore } from '../../../../src/store/app'; vi.mock('~/services'); describe('form actions', () => { setActivePinia(createPinia()); const mockStore = useFormStore(); + const appStore = useAppStore(); const notificationStore = useNotificationStore(); const addNotificationSpy = vi.spyOn(notificationStore, 'addNotification'); const listSubmissionsSpy = vi.spyOn(formService, 'listSubmissions'); @@ -24,6 +26,7 @@ describe('form actions', () => { beforeEach(() => { mockStore.$reset(); mockConsoleError.mockReset(); + appStore.$reset(); notificationStore.$reset(); addNotificationSpy.mockReset(); listSubmissionsSpy.mockReset(); diff --git a/app/frontend/tests/unit/utils/constants.spec.js b/app/frontend/tests/unit/utils/constants.spec.js index 17546e6f5..3ab18eb66 100644 --- a/app/frontend/tests/unit/utils/constants.spec.js +++ b/app/frontend/tests/unit/utils/constants.spec.js @@ -16,6 +16,8 @@ describe('Constants', () => { UTILS: '/utils', FILES_API_ACCESS: '/filesApiAccess', PROXY: '/proxy', + ENCRYPTION_KEY: '/encryptionKey', + EVENT_STREAM_CONFIG: '/eventStreamConfig', }); }); diff --git a/app/frontend/tests/unit/views/file/Download.spec.js b/app/frontend/tests/unit/views/file/Download.spec.js index 33facc393..76b5165e8 100644 --- a/app/frontend/tests/unit/views/file/Download.spec.js +++ b/app/frontend/tests/unit/views/file/Download.spec.js @@ -10,6 +10,7 @@ import { useFormStore } from '~/store/form'; import { useNotificationStore } from '~/store/notification'; import Download from '~/views/file/Download.vue'; import * as transformUtils from '~/utils/transformUtils'; +import { useAppStore } from '~/store/app'; describe('Download.vue', () => { let pinia; @@ -37,6 +38,8 @@ describe('Download.vue', () => { formStore.$reset(); const notificationStore = useNotificationStore(); notificationStore.$reset(); + const appStore = useAppStore(pinia); + appStore.$reset(); }); it('renders and downloads json', async () => { diff --git a/app/frontend/tests/unit/views/form/Create.spec.js b/app/frontend/tests/unit/views/form/Create.spec.js index baf063a73..3d3f69bff 100644 --- a/app/frontend/tests/unit/views/form/Create.spec.js +++ b/app/frontend/tests/unit/views/form/Create.spec.js @@ -11,6 +11,7 @@ import { useFormStore } from '~/store/form'; import Create from '~/views/form/Create.vue'; import { IdentityMode } from '~/utils/constants'; import { nextTick } from 'vue'; +import { useAppStore } from '~/store/app'; vi.mock('vue-router', () => ({ ...vi.importActual('vue-router'), @@ -25,9 +26,11 @@ describe('Create.vue', () => { setActivePinia(pinia); const formStore = useFormStore(pinia); + const appStore = useAppStore(pinia); beforeEach(async () => { formStore.$reset(); + appStore.$reset(); mockWindowConfirm.mockReset(); }); diff --git a/app/frontend/tests/unit/views/form/Design.spec.js b/app/frontend/tests/unit/views/form/Design.spec.js index 74365ff19..404158c48 100644 --- a/app/frontend/tests/unit/views/form/Design.spec.js +++ b/app/frontend/tests/unit/views/form/Design.spec.js @@ -8,6 +8,7 @@ import { beforeEach, describe, expect, it, vi } from 'vitest'; import { useFormStore } from '~/store/form'; import Design from '~/views/form/Design.vue'; +import { useAppStore } from '~/store/app'; vi.mock('vue-router', () => ({ ...vi.importActual('vue-router'), @@ -21,9 +22,11 @@ describe('Design.vue', () => { setActivePinia(pinia); const formStore = useFormStore(pinia); + const appStore = useAppStore(pinia); beforeEach(() => { formStore.$reset(); + appStore.$reset(); mockWindowConfirm.mockReset(); }); @@ -47,10 +50,6 @@ describe('Design.vue', () => { }, template: '
', }, - BaseSecure: { - name: 'BaseSecure', - template: '
', - }, }, }, });