From 8926f3fca6c059c08271600d6d26a1f2f195fbbb Mon Sep 17 00:00:00 2001 From: Chris Hill-Scott Date: Mon, 15 Mar 2021 10:05:46 +0000 Subject: [PATCH] Fix sort order on performance page This commit makes both the tables sort in reverse chronological order. --- app/templates/views/performance.html | 2 +- tests/app/main/views/test_performance.py | 14 ++++++++------ 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/app/templates/views/performance.html b/app/templates/views/performance.html index d8ad5e34a..c20f99c6e 100644 --- a/app/templates/views/performance.html +++ b/app/templates/views/performance.html @@ -53,7 +53,7 @@
{% call(item, row_number) list_table( - notifications_by_type, + notifications_by_type|reverse, caption='Messages sent since May 2016', caption_visible=False, field_headings=[ diff --git a/tests/app/main/views/test_performance.py b/tests/app/main/views/test_performance.py index 6418d6d5f..e22e0cea2 100644 --- a/tests/app/main/views/test_performance.py +++ b/tests/app/main/views/test_performance.py @@ -132,13 +132,15 @@ def test_should_render_performance_page( '' 'Messages sent since May 2016 ' 'Date Emails Text messages Letters ' - '21 February 2021 1,234,567 123,456 123 ' - '22 February 2021 1 2 3 ' - '23 February 2021 1 2 3 ' - '24 February 2021 1 2 3 ' - '25 February 2021 1 2 3 ' - '26 February 2021 1 2 3 ' '27 February 2021 1 2 3 ' + '26 February 2021 1 2 3 ' + '25 February 2021 1 2 3 ' + '24 February 2021 1 2 3 ' + '23 February 2021 1 2 3 ' + '22 February 2021 1 2 3 ' + '21 February 2021 1,234,567 123,456 123 ' + + 'Only showing the last 7 days ' '' 'Messages sent within 10 seconds '