Skip to content

Commit

Permalink
fix test to mock workflow route
Browse files Browse the repository at this point in the history
  • Loading branch information
LizBaldo committed Feb 4, 2025
1 parent d6880f0 commit 8321a34
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,12 @@ import React from 'react';
import { FindWorkflowModal } from 'src/pages/workspaces/workspace/modals/FindWorkflowModal';
import { renderWithAppContexts as render } from 'src/testing/test-utils';

jest.mock('src/libs/ajax');
jest.mock('src/libs/nav', () => ({
...jest.requireActual('src/libs/nav'),
getLink: jest.fn(() => '#workflows'),
}));

describe('FindWorkflowModal', () => {
it('renders elements in the modal', async () => {
// Act
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ export const FindWorkflowModal = (props: FindWorkflowModalProps) => {
const { onDismiss } = props;

const dockstoreUrl = `${getConfig().dockstoreUrlRoot}/search?_type=workflow&descriptorType=WDL&searchMode=files`;
const workflowsRepoUrl: string = Nav.getLink('workflows');
const workflowsRepoUrl = Nav.getLink('workflows');

return (
<Modal onDismiss={onDismiss} title='Find a workflow' showCancel okButton={false} showX width={870}>
Expand Down

0 comments on commit 8321a34

Please sign in to comment.