Skip to content

Commit

Permalink
Fixed unit tests
Browse files Browse the repository at this point in the history
  • Loading branch information
ekuiter committed Nov 19, 2019
1 parent 6c6dadb commit 7ee8817
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions client/src/components/featureDiagramView/export.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@ import {saveAs} from 'file-saver';
import {importSvg2PdfJs, importJspdfYworks, importCanvg} from '../../imports';
import {FeatureDiagramLayoutType, FormatType, FormatOptions, ArtifactPath, ClientFormatType, ServerFormatType} from '../../types';
import logger from '../../helpers/logger';
import actions from '../../store/actions';
import {State} from '../../store/types';
import {getCurrentArtifactPath} from '../../router';

type BlobPromise = Promise<Blob | null>;
Expand Down Expand Up @@ -81,8 +79,10 @@ const exportServer = (format: ServerFormatType) => async (): BlobPromise => {
const store = (window as any).app && (window as any).app.store;
if (!store)
throw 'store not accessible, can not export';
const state: State = store.getState();
const artifactPath: ArtifactPath | undefined = getCurrentArtifactPath(state.collaborativeSessions);
const actions = (window as any).app && (window as any).app.actions;
if (!actions)
throw 'actions not accessible, can not export';
const artifactPath: ArtifactPath | undefined = getCurrentArtifactPath(store.getState().collaborativeSessions);
if (!artifactPath)
throw 'no current artifact path';
store.dispatch(actions.server.exportArtifact({artifactPath, format}));
Expand Down

0 comments on commit 7ee8817

Please sign in to comment.