Skip to content

Commit

Permalink
Update pending tests
Browse files Browse the repository at this point in the history
* Rescheduling is inherent to the fact that define an `interval` for our
  schedule; no need to test that explicitly
* Also removes tests around failure conditions; the entire task run is
  wrapped in a try/catch such that we don't need to do that ourselves.
  • Loading branch information
rylnd committed Aug 24, 2023
1 parent bcb1cee commit fe475d4
Showing 1 changed file with 16 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -211,8 +211,6 @@ describe('Risk Scoring Task', () => {
});
expect(mockRiskScoreService.calculateAndPersistScores).toHaveBeenCalledTimes(1);
});

it.todo('schedules the next run');
});

describe('when there are scores to calculate', () => {
Expand Down Expand Up @@ -328,7 +326,22 @@ describe('Risk Scoring Task', () => {
});
});

it.todo('updates the task state');
it('updates the task state', async () => {
const { state: initialState } = riskScoringTaskInstanceMock;
const { state: nextState } = await runTask({
getRiskScoreService,
logger: mockLogger,
taskInstance: riskScoringTaskInstanceMock,
});

expect(initialState).not.toEqual(nextState);
expect(nextState).toEqual(
expect.objectContaining({
runs: 1,
scoresWritten: 10,
})
);
});

describe('short-circuiting', () => {
it('does not execute if the risk engine is not enabled', async () => {
Expand Down Expand Up @@ -380,11 +393,6 @@ describe('Risk Scoring Task', () => {
);
});
});

describe('failure conditions', () => {
it.todo('logs an error and does not execute if the configured range is invalid');
it.todo('logs an error if the configured filter is invalid');
});
});
});
});

0 comments on commit fe475d4

Please sign in to comment.