Skip to content

Commit

Permalink
update DataFetcher tests
Browse files Browse the repository at this point in the history
  • Loading branch information
JohnC-80 committed Sep 20, 2023
1 parent d90e474 commit faa88d3
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/components/DataFetcher/DataFetcher.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -107,19 +107,19 @@ describe('DataFetcher component', () => {
});

describe('getJobSplittingURL', () => {
const trueResources = { splitStatus: { isPending: false, records: [{ splitStatus: true }] } };
const falseResources = { splitStatus: { isPending: false, records: [{ splitStatus: false }] } };
const pendingResources = { splitStatus: { isPending: true, records: [] } };
const trueResources = { split_status: { isPending: false, records: [{ splitStatus: true }] } };
const falseResources = { split_status: { isPending: false, records: [{ splitStatus: false }] } };
const pendingResources = { split_status: { isPending: true, records: [] } };
it('given a splitStatus of true, it provides the "trueUrl" parameter', () => {
expect(getJobSplittingURL({ resources: trueResources }, 'trueUrl', 'falseUrl')).toBe('trueUrl');
expect(getJobSplittingURL(trueResources, 'trueUrl', 'falseUrl')).toBe('trueUrl');
});

it('given a splitStatus of true, it provides the "falseUrl" parameter', () => {
expect(getJobSplittingURL({ resources: falseResources }, 'trueUrl', 'falseUrl')).toBe('falseUrl');
expect(getJobSplittingURL(falseResources, 'trueUrl', 'falseUrl')).toBe('falseUrl');
});

it('given a pending split status, it returns undefined', () => {
expect(getJobSplittingURL({ resources: pendingResources }, 'trueUrl', 'falseUrl')).toBeUndefined();
expect(getJobSplittingURL(pendingResources, 'trueUrl', 'falseUrl')).toBeUndefined();
});
});
});

0 comments on commit faa88d3

Please sign in to comment.