Skip to content

Commit

Permalink
view job profile tests
Browse files Browse the repository at this point in the history
  • Loading branch information
JohnC-80 committed Sep 29, 2023
1 parent 4467526 commit 4bfff34
Showing 1 changed file with 28 additions and 11 deletions.
39 changes: 28 additions & 11 deletions src/settings/JobProfiles/tests/ViewJobProfile.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,18 @@ import '../../../../test/jest/__mock__';
import { STATUS_CODES } from '../../../utils';

import { ViewJobProfile } from '../ViewJobProfile';
import { UploadingJobsContext } from '../../../components';

const uploadContext = (canUseObjectStorage) => (
{
uploadDefinition: {
id: 'testUploadDefinitionId'
},
uploadConfiguration: {
canUseObjectStorage,
}
}
);

global.fetch = jest.fn();

Expand Down Expand Up @@ -72,6 +84,8 @@ const viewJobProfileProps = (profile, actionMenuItems) => ({
lastName: 'lastName',
},
status: 'ERROR',
jobPartNumber: 1,
totalJobParts: 20,
}],
}],
hasLoaded: true,
Expand All @@ -96,20 +110,23 @@ const renderViewJobProfile = ({
location,
resources,
actionMenuItems,
context = uploadContext(false)
}) => {
const component = () => (
<Router>
<ViewJobProfile
resources={resources}
location={location}
match={match}
history={history}
tagsEnabled
onClose={noop}
onDelete={noop}
actionMenuItems={actionMenuItems}
stripes={stripes}
/>
<UploadingJobsContext.Provider value={context}>
<ViewJobProfile
resources={resources}
location={location}
match={match}
history={history}
tagsEnabled
onClose={noop}
onDelete={noop}
actionMenuItems={actionMenuItems}
stripes={stripes}
/>
</UploadingJobsContext.Provider>
</Router>
);

Expand Down

0 comments on commit 4bfff34

Please sign in to comment.