mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-08-19 14:09:20 -04:00
Add a cancel job button
If you schedule a job you might change your mind or circumstances might change. So you need to be able to cancel it. This commit adds a button on the job page which hits the `…/cancel` API endpoint for a job.
This commit is contained in:
@@ -361,3 +361,15 @@ def test_client_parses_empty_job_stats_for_service(mocker):
|
||||
assert result['data'][1]['notifications_sent'] == 0
|
||||
assert result['data'][1]['notification_count'] == 40
|
||||
assert result['data'][1]['notifications_failed'] == 0
|
||||
|
||||
|
||||
def test_cancel_job(mocker):
|
||||
|
||||
mock_post = mocker.patch('app.notify_client.job_api_client.JobApiClient.post')
|
||||
|
||||
JobApiClient().cancel_job('service_id', 'job_id')
|
||||
|
||||
mock_post.assert_called_once_with(
|
||||
url='/service/{}/job/{}/cancel'.format('service_id', 'job_id'),
|
||||
data={}
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user