mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-07-12 17:34:16 -04:00
Fix sorting of events
Events should be sorted reverse-chronologically, no matter what order they come back from the API in, or which field in the API response they’ve been extracted from.
This commit is contained in:
@@ -3514,11 +3514,17 @@ def mock_get_service_history(mocker):
|
||||
'created_by_id': uuid4(),
|
||||
},
|
||||
{
|
||||
'name': 'Real service',
|
||||
'name': 'Before lunch',
|
||||
'created_at': '2010-10-10T01:01:01.000000Z',
|
||||
'updated_at': '2012-12-12T12:12:12.000000Z',
|
||||
'created_by_id': sample_uuid(),
|
||||
},
|
||||
{
|
||||
'name': 'After lunch',
|
||||
'created_at': '2010-10-10T01:01:01.000000Z',
|
||||
'updated_at': '2012-12-12T13:13:13.000000Z',
|
||||
'created_by_id': sample_uuid(),
|
||||
},
|
||||
],
|
||||
'api_key_history': [
|
||||
{
|
||||
@@ -3539,6 +3545,12 @@ def mock_get_service_history(mocker):
|
||||
'created_at': '2011-11-11T11:11:11.000000Z',
|
||||
'created_by_id': sample_uuid(),
|
||||
},
|
||||
{
|
||||
'name': 'Key event returned in non-chronological order',
|
||||
'updated_at': None,
|
||||
'created_at': '2010-10-10T09:09:09.000000Z',
|
||||
'created_by_id': sample_uuid(),
|
||||
},
|
||||
],
|
||||
'events': [],
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user