Merge branch '19143-project-list-workflows'
[arvados-workbench2.git] / src / store / workflow-panel / workflow-panel-actions.test.ts
index 86dba452030a1e9e3fe10957a8b36fd725f1e77d..1a7cad8264bd59983a2841aafeccfbc260caf894 100644 (file)
@@ -2,26 +2,27 @@
 //
 // SPDX-License-Identifier: AGPL-3.0
 
-import { getNewExtraToken, initAuth } from "./auth-action";
-import { API_TOKEN_KEY } from "~/services/auth-service/auth-service";
+import { API_TOKEN_KEY } from "services/auth-service/auth-service";
 
 import 'jest-localstorage-mock';
-import { ServiceRepository, createServices } from "~/services/services";
+import { ServiceRepository, createServices } from "services/services";
 import { configureStore, RootStore } from "../store";
 import { createBrowserHistory } from "history";
-import { Config, mockConfig } from '~/common/config';
-import { ApiActions } from "~/services/api/api-actions";
-import { ACCOUNT_LINK_STATUS_KEY } from '~/services/link-account-service/link-account-service';
+import { Config, mockConfig } from 'common/config';
+import { ApiActions } from "services/api/api-actions";
+import { ACCOUNT_LINK_STATUS_KEY } from 'services/link-account-service/link-account-service';
 import Axios from "axios";
 import MockAdapter from "axios-mock-adapter";
 import { ImportMock } from 'ts-mock-imports';
-import * as servicesModule from "~/services/services";
-import { SessionStatus } from "~/models/session";
+import * as servicesModule from "services/services";
+import { SessionStatus } from "models/session";
 import { openRunProcess } from './workflow-panel-actions';
-import { runProcessPanelActions } from '~/store/run-process-panel/run-process-panel-actions';
+import { runProcessPanelActions } from 'store/run-process-panel/run-process-panel-actions';
 import { initialize } from 'redux-form';
-import { RUN_PROCESS_BASIC_FORM } from '~/views/run-process-panel/run-process-basic-form';
-import { RUN_PROCESS_INPUTS_FORM } from '~/views/run-process-panel/run-process-inputs-form';
+import { RUN_PROCESS_BASIC_FORM } from 'views/run-process-panel/run-process-basic-form';
+import { RUN_PROCESS_INPUTS_FORM } from 'views/run-process-panel/run-process-inputs-form';
+import { ResourceKind } from 'models/resource';
+import { WorkflowResource } from 'models/workflow';
 
 describe('workflow-panel-actions', () => {
     const axiosInst = Axios.create({ headers: {} });
@@ -49,11 +50,19 @@ describe('workflow-panel-actions', () => {
     });
 
     it('opens the run process panel', async () => {
-        const wflist = [{
+        const wflist: WorkflowResource[] = [{
             uuid: "zzzzz-7fd4e-0123456789abcde",
             name: "foo",
             description: "",
-            definition: "$graph: []"
+            definition: "$graph: []",
+            kind: ResourceKind.WORKFLOW,
+            ownerUuid: "",
+            createdAt: "",
+            modifiedByClientUuid: "",
+            modifiedByUserUuid: "",
+            modifiedAt: "",
+            href: "",
+            etag: ""
         }];
         axiosMock
             .onGet("/workflows")
@@ -73,7 +82,6 @@ describe('workflow-panel-actions', () => {
         await openRunProcess("zzzzz-7fd4e-0123456789abcde", "zzzzz-tpzed-0123456789abcde", "testing", { inputparm: "value" })(dispatchWrapper, store.getState, services);
         expect(dispatchMock).toHaveBeenCalledWith(runProcessPanelActions.SET_WORKFLOWS(wflist));
         expect(dispatchMock).toHaveBeenCalledWith(runProcessPanelActions.SET_SELECTED_WORKFLOW(wflist[0]));
-        expect(dispatchMock).toHaveBeenCalledWith(runProcessPanelActions.SET_PROCESS_OWNER_UUID("zzzzz-tpzed-0123456789abcde"));
         expect(dispatchMock).toHaveBeenCalledWith(initialize(RUN_PROCESS_BASIC_FORM, { name: "testing" }));
         expect(dispatchMock).toHaveBeenCalledWith(initialize(RUN_PROCESS_INPUTS_FORM, { inputparm: "value" }));
     });