From 3bd9747d4452257250a3b459d99428ce183f6cb4 Mon Sep 17 00:00:00 2001 From: Tomas Date: Tue, 28 Jan 2025 10:48:53 +0100 Subject: [PATCH 1/4] Add mocks for option list endpoints --- frontend/packages/shared/src/api/mutations.ts | 7 +++++++ frontend/packages/shared/src/api/queries.ts | 4 ++++ .../shared/src/mocks/optionListsResponse.ts | 21 +++++++++++++++++++ .../packages/shared/src/mocks/queriesMock.ts | 6 ++++++ 4 files changed, 38 insertions(+) create mode 100644 frontend/packages/shared/src/mocks/optionListsResponse.ts diff --git a/frontend/packages/shared/src/api/mutations.ts b/frontend/packages/shared/src/api/mutations.ts index d4d5faf950d..9bf724311ad 100644 --- a/frontend/packages/shared/src/api/mutations.ts +++ b/frontend/packages/shared/src/api/mutations.ts @@ -75,6 +75,7 @@ import type { FormLayoutRequest } from 'app-shared/types/api/FormLayoutRequest'; import type { Option } from 'app-shared/types/Option'; import type { MaskinportenScopes } from 'app-shared/types/MaskinportenScope'; import type { DataType } from '../types/DataType'; +import type { OptionListData } from 'app-shared/types/OptionList'; const headers = { Accept: 'application/json', @@ -167,3 +168,9 @@ export const updateProcessDataTypes = (org: string, app: string, dataTypesChange // Maskinporten export const updateSelectedMaskinportenScopes = (org: string, app: string, appScopesUpsertRequest: MaskinportenScopes) => put(selectedMaskinportenScopesPath(org, app), appScopesUpsertRequest); + +// Organisation library: +// Todo: Replace these with real API calls when endpoints are ready. https://github.com/Altinn/altinn-studio/issues/14505 +export const createOptionListForOrg = async (org: string, payload: OptionListData): Promise => Promise.resolve(); +export const updateOptionListForOrg = async (org: string, optionListId: string, payload: Option[]): Promise => Promise.resolve(); +export const deleteOptionListForOrg = async (org: string, optionListId: string): Promise => Promise.resolve(); diff --git a/frontend/packages/shared/src/api/queries.ts b/frontend/packages/shared/src/api/queries.ts index 18941a258f3..08ee5f155a9 100644 --- a/frontend/packages/shared/src/api/queries.ts +++ b/frontend/packages/shared/src/api/queries.ts @@ -99,6 +99,7 @@ import type { OptionListReferences } from 'app-shared/types/OptionListReferences import type { LayoutSetsModel } from '../types/api/dto/LayoutSetsModel'; import type { AccessPackageResource, PolicyAccessPackageAreaGroup } from 'app-shared/types/PolicyAccessPackages'; import type { DataType } from '../types/DataType'; +import { optionListsResponse } from 'app-shared/mocks/optionListsResponse'; export const getIsLoggedInWithAnsattporten = () => get<{ isLoggedIn: boolean }>(authStatusAnsattporten()); export const getMaskinportenScopes = (org: string, app: string) => get(availableMaskinportenScopesPath(org, app)); @@ -176,3 +177,6 @@ export const getProcessTaskType = (org: string, app: string, taskId: string) => // Contact Page export const fetchBelongsToGiteaOrg = () => get(belongsToOrg()); + +// Organisation library +export const getOptionListsForOrg = async (org: string): Promise => Promise.resolve(optionListsResponse); // Todo: Replace with real API call when endpoint is ready. https://github.com/Altinn/altinn-studio/issues/14505 diff --git a/frontend/packages/shared/src/mocks/optionListsResponse.ts b/frontend/packages/shared/src/mocks/optionListsResponse.ts new file mode 100644 index 00000000000..d226d330ce4 --- /dev/null +++ b/frontend/packages/shared/src/mocks/optionListsResponse.ts @@ -0,0 +1,21 @@ +import type { OptionListsResponse } from '../types/api/OptionListsResponse'; +import type { OptionListData } from '../types/OptionList'; + +const optionList1: OptionListData = { + title: 'optionList1', + data: [ + { label: 'Option 1', value: 'option1' }, + { label: 'Option 2', value: 'option2' }, + ], +}; + +const optionList2: OptionListData = { + title: 'optionList2', + data: [ + { label: 'A', value: 'a' }, + { label: 'B', value: 'b' }, + { label: 'C', value: 'c' }, + ], +}; + +export const optionListsResponse: OptionListsResponse = [optionList1, optionList2]; diff --git a/frontend/packages/shared/src/mocks/queriesMock.ts b/frontend/packages/shared/src/mocks/queriesMock.ts index 80ce56357c7..fb3113f5b5a 100644 --- a/frontend/packages/shared/src/mocks/queriesMock.ts +++ b/frontend/packages/shared/src/mocks/queriesMock.ts @@ -113,6 +113,9 @@ export const queriesMock: ServicesContextProps = { getOptionListIds: jest.fn().mockImplementation(() => Promise.resolve([])), getOptionList: jest.fn().mockImplementation(() => Promise.resolve([])), getOptionLists: jest.fn().mockImplementation(() => Promise.resolve([])), + getOptionListsForOrg: jest + .fn() + .mockImplementation(() => Promise.resolve([])), getOptionListsReferences: jest .fn() .mockImplementation(() => Promise.resolve([])), @@ -217,6 +220,7 @@ export const queriesMock: ServicesContextProps = { createDataModel: jest.fn().mockImplementation(() => Promise.resolve({})), updateDataType: jest.fn().mockImplementation(() => Promise.resolve({})), createDeployment: jest.fn().mockImplementation(() => Promise.resolve()), + createOptionListForOrg: jest.fn().mockImplementation(() => Promise.resolve()), createRelease: jest.fn().mockImplementation(() => Promise.resolve()), createRepoCommit: jest .fn() @@ -229,6 +233,7 @@ export const queriesMock: ServicesContextProps = { deleteLanguageCode: jest.fn().mockImplementation(() => Promise.resolve()), deleteLayoutSet: jest.fn().mockImplementation(() => Promise.resolve()), deleteOptionList: jest.fn().mockImplementation(() => Promise.resolve()), + deleteOptionListForOrg: jest.fn().mockImplementation(() => Promise.resolve()), generateModels: jest.fn().mockImplementation(() => Promise.resolve()), logout: jest.fn().mockImplementation(() => Promise.resolve()), pushRepoChanges: jest.fn().mockImplementation(() => Promise.resolve()), @@ -249,6 +254,7 @@ export const queriesMock: ServicesContextProps = { updateAppMetadata: jest.fn().mockImplementation(() => Promise.resolve()), updateAppConfig: jest.fn().mockImplementation(() => Promise.resolve()), updateOptionList: jest.fn().mockImplementation(() => Promise.resolve()), + updateOptionListForOrg: jest.fn().mockImplementation(() => Promise.resolve()), updateOptionListId: jest.fn().mockImplementation(() => Promise.resolve()), uploadDataModel: jest.fn().mockImplementation(() => Promise.resolve({})), uploadOptionList: jest.fn().mockImplementation(() => Promise.resolve()), From 530e8abe7fc8c11483986a6fbcfadde9d26b9634 Mon Sep 17 00:00:00 2001 From: Tomas Date: Tue, 28 Jan 2025 12:09:25 +0100 Subject: [PATCH 2/4] Fix naming and add code list types --- frontend/packages/shared/src/api/mutations.ts | 7 ++--- frontend/packages/shared/src/api/queries.ts | 5 ++-- .../shared/src/mocks/codeListsResponse.ts | 26 +++++++++++++++++++ .../shared/src/mocks/optionListsResponse.ts | 21 --------------- .../packages/shared/src/mocks/queriesMock.ts | 11 ++++---- .../packages/shared/src/types/CodeList.ts | 1 + .../packages/shared/src/types/CodeListData.ts | 7 +++++ .../shared/src/types/api/CodeListsResponse.ts | 3 +++ 8 files changed, 49 insertions(+), 32 deletions(-) create mode 100644 frontend/packages/shared/src/mocks/codeListsResponse.ts delete mode 100644 frontend/packages/shared/src/mocks/optionListsResponse.ts create mode 100644 frontend/packages/shared/src/types/CodeList.ts create mode 100644 frontend/packages/shared/src/types/CodeListData.ts create mode 100644 frontend/packages/shared/src/types/api/CodeListsResponse.ts diff --git a/frontend/packages/shared/src/api/mutations.ts b/frontend/packages/shared/src/api/mutations.ts index 9bf724311ad..b9b1149fb24 100644 --- a/frontend/packages/shared/src/api/mutations.ts +++ b/frontend/packages/shared/src/api/mutations.ts @@ -76,6 +76,7 @@ import type { Option } from 'app-shared/types/Option'; import type { MaskinportenScopes } from 'app-shared/types/MaskinportenScope'; import type { DataType } from '../types/DataType'; import type { OptionListData } from 'app-shared/types/OptionList'; +import type { CodeList } from 'app-shared/types/CodeList'; const headers = { Accept: 'application/json', @@ -171,6 +172,6 @@ export const updateSelectedMaskinportenScopes = (org: string, app: string, appSc // Organisation library: // Todo: Replace these with real API calls when endpoints are ready. https://github.com/Altinn/altinn-studio/issues/14505 -export const createOptionListForOrg = async (org: string, payload: OptionListData): Promise => Promise.resolve(); -export const updateOptionListForOrg = async (org: string, optionListId: string, payload: Option[]): Promise => Promise.resolve(); -export const deleteOptionListForOrg = async (org: string, optionListId: string): Promise => Promise.resolve(); +export const createCodeListForOrg = async (org: string, payload: OptionListData): Promise => Promise.resolve(); +export const updateCodeListForOrg = async (org: string, optionListId: string, payload: CodeList): Promise => Promise.resolve(); +export const deleteCodeListForOrg = async (org: string, optionListId: string): Promise => Promise.resolve(); diff --git a/frontend/packages/shared/src/api/queries.ts b/frontend/packages/shared/src/api/queries.ts index 08ee5f155a9..eece7ba6c50 100644 --- a/frontend/packages/shared/src/api/queries.ts +++ b/frontend/packages/shared/src/api/queries.ts @@ -99,7 +99,8 @@ import type { OptionListReferences } from 'app-shared/types/OptionListReferences import type { LayoutSetsModel } from '../types/api/dto/LayoutSetsModel'; import type { AccessPackageResource, PolicyAccessPackageAreaGroup } from 'app-shared/types/PolicyAccessPackages'; import type { DataType } from '../types/DataType'; -import { optionListsResponse } from 'app-shared/mocks/optionListsResponse'; +import { codeListsResponse } from '../mocks/codeListsResponse'; +import type { CodeListsResponse } from '../types/api/CodeListsResponse'; export const getIsLoggedInWithAnsattporten = () => get<{ isLoggedIn: boolean }>(authStatusAnsattporten()); export const getMaskinportenScopes = (org: string, app: string) => get(availableMaskinportenScopesPath(org, app)); @@ -179,4 +180,4 @@ export const getProcessTaskType = (org: string, app: string, taskId: string) => export const fetchBelongsToGiteaOrg = () => get(belongsToOrg()); // Organisation library -export const getOptionListsForOrg = async (org: string): Promise => Promise.resolve(optionListsResponse); // Todo: Replace with real API call when endpoint is ready. https://github.com/Altinn/altinn-studio/issues/14505 +export const getCodeListsForOrg = async (org: string): Promise => Promise.resolve(codeListsResponse); // Todo: Replace with real API call when endpoint is ready. https://github.com/Altinn/altinn-studio/issues/14505 diff --git a/frontend/packages/shared/src/mocks/codeListsResponse.ts b/frontend/packages/shared/src/mocks/codeListsResponse.ts new file mode 100644 index 00000000000..4efcce8a1bc --- /dev/null +++ b/frontend/packages/shared/src/mocks/codeListsResponse.ts @@ -0,0 +1,26 @@ +import type { CodeListsResponse } from '../types/api/CodeListsResponse'; +import type { CodeListData } from '@studio/content-library'; + +const codeList1: CodeListData = { + title: 'optionList1', + data: [ + { label: 'Option 1', value: 'option1' }, + { label: 'Option 2', value: 'option2' }, + ], +}; + +const codeList2: CodeListData = { + title: 'optionList2', + data: [ + { label: 'A', value: 'a' }, + { label: 'B', value: 'b' }, + { label: 'C', value: 'c' }, + ], +}; + +const codeListWithError: CodeListData = { + title: 'optionListWithError', + hasError: true, +}; + +export const codeListsResponse: CodeListsResponse = [codeList1, codeList2, codeListWithError]; diff --git a/frontend/packages/shared/src/mocks/optionListsResponse.ts b/frontend/packages/shared/src/mocks/optionListsResponse.ts deleted file mode 100644 index d226d330ce4..00000000000 --- a/frontend/packages/shared/src/mocks/optionListsResponse.ts +++ /dev/null @@ -1,21 +0,0 @@ -import type { OptionListsResponse } from '../types/api/OptionListsResponse'; -import type { OptionListData } from '../types/OptionList'; - -const optionList1: OptionListData = { - title: 'optionList1', - data: [ - { label: 'Option 1', value: 'option1' }, - { label: 'Option 2', value: 'option2' }, - ], -}; - -const optionList2: OptionListData = { - title: 'optionList2', - data: [ - { label: 'A', value: 'a' }, - { label: 'B', value: 'b' }, - { label: 'C', value: 'c' }, - ], -}; - -export const optionListsResponse: OptionListsResponse = [optionList1, optionList2]; diff --git a/frontend/packages/shared/src/mocks/queriesMock.ts b/frontend/packages/shared/src/mocks/queriesMock.ts index fb3113f5b5a..6fc54616824 100644 --- a/frontend/packages/shared/src/mocks/queriesMock.ts +++ b/frontend/packages/shared/src/mocks/queriesMock.ts @@ -74,6 +74,7 @@ import type { OptionListReferences } from 'app-shared/types/OptionListReferences import type { LayoutSetsModel } from '../types/api/dto/LayoutSetsModel'; import { layoutSetsExtendedMock } from '@altinn/ux-editor/testing/layoutSetsMock'; import type { OptionListsResponse } from 'app-shared/types/api/OptionListsResponse'; +import { CodeListsResponse } from 'app-shared/types/api/CodeListsResponse'; export const queriesMock: ServicesContextProps = { // Queries @@ -83,6 +84,7 @@ export const queriesMock: ServicesContextProps = { .mockImplementation(() => Promise.resolve(appReleasesResponse)), getAppVersion: jest.fn().mockImplementation(() => Promise.resolve(appVersion)), getBranchStatus: jest.fn().mockImplementation(() => Promise.resolve(branchStatus)), + getCodeListsForOrg: jest.fn().mockImplementation(() => Promise.resolve([])), getDataModel: jest.fn().mockImplementation(() => Promise.resolve({})), getDataModelMetadata: jest .fn() @@ -113,9 +115,6 @@ export const queriesMock: ServicesContextProps = { getOptionListIds: jest.fn().mockImplementation(() => Promise.resolve([])), getOptionList: jest.fn().mockImplementation(() => Promise.resolve([])), getOptionLists: jest.fn().mockImplementation(() => Promise.resolve([])), - getOptionListsForOrg: jest - .fn() - .mockImplementation(() => Promise.resolve([])), getOptionListsReferences: jest .fn() .mockImplementation(() => Promise.resolve([])), @@ -217,15 +216,16 @@ export const queriesMock: ServicesContextProps = { .fn() .mockImplementation(() => Promise.resolve(createRepoCommitPayload)), copyApp: jest.fn().mockImplementation(() => Promise.resolve()), + createCodeListForOrg: jest.fn().mockImplementation(() => Promise.resolve()), createDataModel: jest.fn().mockImplementation(() => Promise.resolve({})), updateDataType: jest.fn().mockImplementation(() => Promise.resolve({})), createDeployment: jest.fn().mockImplementation(() => Promise.resolve()), - createOptionListForOrg: jest.fn().mockImplementation(() => Promise.resolve()), createRelease: jest.fn().mockImplementation(() => Promise.resolve()), createRepoCommit: jest .fn() .mockImplementation(() => Promise.resolve(createRepoCommitPayload)), deleteAppAttachmentMetadata: jest.fn().mockImplementation(() => Promise.resolve()), + deleteCodeListForOrg: jest.fn().mockImplementation(() => Promise.resolve()), deleteDataModel: jest.fn().mockImplementation(() => Promise.resolve()), deleteDataTypeFromAppMetadata: jest.fn().mockImplementation(() => Promise.resolve()), deleteFormLayout: jest.fn().mockImplementation(() => Promise.resolve()), @@ -233,7 +233,6 @@ export const queriesMock: ServicesContextProps = { deleteLanguageCode: jest.fn().mockImplementation(() => Promise.resolve()), deleteLayoutSet: jest.fn().mockImplementation(() => Promise.resolve()), deleteOptionList: jest.fn().mockImplementation(() => Promise.resolve()), - deleteOptionListForOrg: jest.fn().mockImplementation(() => Promise.resolve()), generateModels: jest.fn().mockImplementation(() => Promise.resolve()), logout: jest.fn().mockImplementation(() => Promise.resolve()), pushRepoChanges: jest.fn().mockImplementation(() => Promise.resolve()), @@ -253,8 +252,8 @@ export const queriesMock: ServicesContextProps = { updateAppPolicy: jest.fn().mockImplementation(() => Promise.resolve()), updateAppMetadata: jest.fn().mockImplementation(() => Promise.resolve()), updateAppConfig: jest.fn().mockImplementation(() => Promise.resolve()), + updateCodeListForOrg: jest.fn().mockImplementation(() => Promise.resolve()), updateOptionList: jest.fn().mockImplementation(() => Promise.resolve()), - updateOptionListForOrg: jest.fn().mockImplementation(() => Promise.resolve()), updateOptionListId: jest.fn().mockImplementation(() => Promise.resolve()), uploadDataModel: jest.fn().mockImplementation(() => Promise.resolve({})), uploadOptionList: jest.fn().mockImplementation(() => Promise.resolve()), diff --git a/frontend/packages/shared/src/types/CodeList.ts b/frontend/packages/shared/src/types/CodeList.ts new file mode 100644 index 00000000000..bd336bfa537 --- /dev/null +++ b/frontend/packages/shared/src/types/CodeList.ts @@ -0,0 +1 @@ +export type { CodeList } from '@studio/components'; diff --git a/frontend/packages/shared/src/types/CodeListData.ts b/frontend/packages/shared/src/types/CodeListData.ts new file mode 100644 index 00000000000..d4e27905582 --- /dev/null +++ b/frontend/packages/shared/src/types/CodeListData.ts @@ -0,0 +1,7 @@ +import { CodeListItem } from '@studio/components'; + +export type CodeListData = { + title: string; + data?: CodeListItem[]; + hasError?: boolean; +}; diff --git a/frontend/packages/shared/src/types/api/CodeListsResponse.ts b/frontend/packages/shared/src/types/api/CodeListsResponse.ts new file mode 100644 index 00000000000..875fa3b26dd --- /dev/null +++ b/frontend/packages/shared/src/types/api/CodeListsResponse.ts @@ -0,0 +1,3 @@ +import type { CodeListData } from '../CodeListData'; + +export type CodeListsResponse = CodeListData[]; From 2a68890845c89bf003cf70af87f5957d3d03fc0d Mon Sep 17 00:00:00 2001 From: Tomas Date: Tue, 28 Jan 2025 12:14:32 +0100 Subject: [PATCH 3/4] Fix more naming --- frontend/packages/shared/src/api/mutations.ts | 8 ++++---- .../packages/shared/src/mocks/codeListsResponse.ts | 10 +++++----- frontend/packages/shared/src/mocks/queriesMock.ts | 2 +- frontend/packages/shared/src/types/CodeListData.ts | 2 +- 4 files changed, 11 insertions(+), 11 deletions(-) diff --git a/frontend/packages/shared/src/api/mutations.ts b/frontend/packages/shared/src/api/mutations.ts index b9b1149fb24..3192dd95f56 100644 --- a/frontend/packages/shared/src/api/mutations.ts +++ b/frontend/packages/shared/src/api/mutations.ts @@ -75,7 +75,7 @@ import type { FormLayoutRequest } from 'app-shared/types/api/FormLayoutRequest'; import type { Option } from 'app-shared/types/Option'; import type { MaskinportenScopes } from 'app-shared/types/MaskinportenScope'; import type { DataType } from '../types/DataType'; -import type { OptionListData } from 'app-shared/types/OptionList'; +import type { CodeListData } from 'app-shared/types/CodeListData'; import type { CodeList } from 'app-shared/types/CodeList'; const headers = { @@ -172,6 +172,6 @@ export const updateSelectedMaskinportenScopes = (org: string, app: string, appSc // Organisation library: // Todo: Replace these with real API calls when endpoints are ready. https://github.com/Altinn/altinn-studio/issues/14505 -export const createCodeListForOrg = async (org: string, payload: OptionListData): Promise => Promise.resolve(); -export const updateCodeListForOrg = async (org: string, optionListId: string, payload: CodeList): Promise => Promise.resolve(); -export const deleteCodeListForOrg = async (org: string, optionListId: string): Promise => Promise.resolve(); +export const createCodeListForOrg = async (org: string, payload: CodeListData): Promise => Promise.resolve(); +export const updateCodeListForOrg = async (org: string, codeListId: string, payload: CodeList): Promise => Promise.resolve(); +export const deleteCodeListForOrg = async (org: string, codeListId: string): Promise => Promise.resolve(); diff --git a/frontend/packages/shared/src/mocks/codeListsResponse.ts b/frontend/packages/shared/src/mocks/codeListsResponse.ts index 4efcce8a1bc..8304d94bb5a 100644 --- a/frontend/packages/shared/src/mocks/codeListsResponse.ts +++ b/frontend/packages/shared/src/mocks/codeListsResponse.ts @@ -2,15 +2,15 @@ import type { CodeListsResponse } from '../types/api/CodeListsResponse'; import type { CodeListData } from '@studio/content-library'; const codeList1: CodeListData = { - title: 'optionList1', + title: 'codeList1', data: [ - { label: 'Option 1', value: 'option1' }, - { label: 'Option 2', value: 'option2' }, + { label: 'Item 1', value: 'item1' }, + { label: 'Item 2', value: 'item2' }, ], }; const codeList2: CodeListData = { - title: 'optionList2', + title: 'codeList2', data: [ { label: 'A', value: 'a' }, { label: 'B', value: 'b' }, @@ -19,7 +19,7 @@ const codeList2: CodeListData = { }; const codeListWithError: CodeListData = { - title: 'optionListWithError', + title: 'codeListWithError', hasError: true, }; diff --git a/frontend/packages/shared/src/mocks/queriesMock.ts b/frontend/packages/shared/src/mocks/queriesMock.ts index 6fc54616824..7c823512ae0 100644 --- a/frontend/packages/shared/src/mocks/queriesMock.ts +++ b/frontend/packages/shared/src/mocks/queriesMock.ts @@ -74,7 +74,7 @@ import type { OptionListReferences } from 'app-shared/types/OptionListReferences import type { LayoutSetsModel } from '../types/api/dto/LayoutSetsModel'; import { layoutSetsExtendedMock } from '@altinn/ux-editor/testing/layoutSetsMock'; import type { OptionListsResponse } from 'app-shared/types/api/OptionListsResponse'; -import { CodeListsResponse } from 'app-shared/types/api/CodeListsResponse'; +import type { CodeListsResponse } from 'app-shared/types/api/CodeListsResponse'; export const queriesMock: ServicesContextProps = { // Queries diff --git a/frontend/packages/shared/src/types/CodeListData.ts b/frontend/packages/shared/src/types/CodeListData.ts index d4e27905582..d09e909f0c4 100644 --- a/frontend/packages/shared/src/types/CodeListData.ts +++ b/frontend/packages/shared/src/types/CodeListData.ts @@ -1,4 +1,4 @@ -import { CodeListItem } from '@studio/components'; +import type { CodeListItem } from '@studio/components'; export type CodeListData = { title: string; From 047d3c7b722793d0524769ca4af9307f74f8871f Mon Sep 17 00:00:00 2001 From: Tomas Date: Tue, 28 Jan 2025 12:17:37 +0100 Subject: [PATCH 4/4] Add upload endpoint mock --- frontend/packages/shared/src/api/mutations.ts | 1 + frontend/packages/shared/src/mocks/queriesMock.ts | 1 + 2 files changed, 2 insertions(+) diff --git a/frontend/packages/shared/src/api/mutations.ts b/frontend/packages/shared/src/api/mutations.ts index 3192dd95f56..465f8edc356 100644 --- a/frontend/packages/shared/src/api/mutations.ts +++ b/frontend/packages/shared/src/api/mutations.ts @@ -175,3 +175,4 @@ export const updateSelectedMaskinportenScopes = (org: string, app: string, appSc export const createCodeListForOrg = async (org: string, payload: CodeListData): Promise => Promise.resolve(); export const updateCodeListForOrg = async (org: string, codeListId: string, payload: CodeList): Promise => Promise.resolve(); export const deleteCodeListForOrg = async (org: string, codeListId: string): Promise => Promise.resolve(); +export const uploadCodeListForOrg = async (org: string, app: string, payload: FormData): Promise => Promise.resolve(); diff --git a/frontend/packages/shared/src/mocks/queriesMock.ts b/frontend/packages/shared/src/mocks/queriesMock.ts index 7c823512ae0..e01db32ee86 100644 --- a/frontend/packages/shared/src/mocks/queriesMock.ts +++ b/frontend/packages/shared/src/mocks/queriesMock.ts @@ -255,6 +255,7 @@ export const queriesMock: ServicesContextProps = { updateCodeListForOrg: jest.fn().mockImplementation(() => Promise.resolve()), updateOptionList: jest.fn().mockImplementation(() => Promise.resolve()), updateOptionListId: jest.fn().mockImplementation(() => Promise.resolve()), + uploadCodeListForOrg: jest.fn().mockImplementation(() => Promise.resolve()), uploadDataModel: jest.fn().mockImplementation(() => Promise.resolve({})), uploadOptionList: jest.fn().mockImplementation(() => Promise.resolve()), upsertTextResources: jest