Skip to content

Commit

Permalink
fixup! fixup! fixup! fixup! fixup! fixup! fix: certificate injection
Browse files Browse the repository at this point in the history
  • Loading branch information
olexii4 committed Mar 18, 2023
1 parent 65a25cc commit 21661cc
Showing 1 changed file with 9 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ import { DevWorkspaceBuilder } from '../../../__mocks__/devWorkspaceBuilder';
import { FakeStoreBuilder } from '../../../__mocks__/storeBuilder';
import { checkRunningWorkspacesLimit } from '../checkRunningWorkspacesLimit';
import { dump } from 'js-yaml';
import { FactoryParams } from "../../../../containers/Loader/buildFactoryParams";

jest.mock('../../../../services/dashboard-backend-client/serverConfigApi');
jest.mock('../../../../services/helpers/delay', () => ({
Expand Down Expand Up @@ -636,11 +637,14 @@ describe('DevWorkspace store, actions', () => {
namespace: 'user-che',
},
};
const attr: Partial<FactoryParams> = {};

mockCreateDevWorkspace.mockResolvedValueOnce({ devWorkspace, headers: {} });
mockUpdateDevWorkspace.mockResolvedValueOnce({ devWorkspace, headers: {} });

await store.dispatch(testStore.actionCreators.createWorkspaceFromDevfile(devfile, {}, {}));
await store.dispatch(
testStore.actionCreators.createWorkspaceFromDevfile(devfile, attr as FactoryParams, {}),
);

const actions = store.getActions();

Expand Down Expand Up @@ -670,11 +674,14 @@ describe('DevWorkspace store, actions', () => {
namespace: 'user-che',
},
};
const attr: Partial<FactoryParams> = {};

mockCreateDevWorkspace.mockRejectedValueOnce(new Error('Something unexpected happened.'));

try {
await store.dispatch(testStore.actionCreators.createWorkspaceFromDevfile(devfile, {}, {}));
await store.dispatch(
testStore.actionCreators.createWorkspaceFromDevfile(devfile, attr as FactoryParams, {}),
);
} catch (e) {
// no-op
}
Expand Down

0 comments on commit 21661cc

Please sign in to comment.