X-Git-Url: https://git.arvados.org/arvados.git/blobdiff_plain/162665e037ec2de3203e8ed34991b1f443462382..82646dcb3d8f2497de1a33d2250101749526662f:/src/store/tree-picker/tree-picker-actions.test.ts diff --git a/src/store/tree-picker/tree-picker-actions.test.ts b/src/store/tree-picker/tree-picker-actions.test.ts index b1c42409ec..7a55503e20 100644 --- a/src/store/tree-picker/tree-picker-actions.test.ts +++ b/src/store/tree-picker/tree-picker-actions.test.ts @@ -14,6 +14,8 @@ import { SHARED_PROJECT_ID, initProjectsTreePicker } from "./tree-picker-actions import { CollectionResource } from "models/collection"; import { GroupResource } from "models/group"; import { CollectionDirectory, CollectionFile, CollectionFileType } from "models/collection-file"; +import { GroupContentsResource } from "services/groups-service/groups-service"; +import { ListResults } from "services/common-service/common-service"; describe('tree-picker-actions', () => { const axiosInst = Axios.create({ headers: {} }); @@ -21,10 +23,7 @@ describe('tree-picker-actions', () => { let store: RootStore; let services: ServiceRepository; - const config: any = { - - - }; + const config: any = {}; const actions: ApiActions = { progressFn: (id: string, working: boolean) => { }, errorFn: (id: string, message: string) => { } @@ -123,6 +122,11 @@ describe('tree-picker-actions', () => { return fakeResources[uuid]?.files || []; }); + services.groupsService.contents = jest.fn(async (uuid, args) => { + const items = Object.keys(fakeResources).map(uuid => ({...fakeResources[uuid], uuid})).filter(item => item.ownerUuid === uuid); + return {items: items as GroupContentsResource[], itemsAvailable: items.length} as ListResults; + }); + const pickerId = "pickerId"; // When collection preselected