Roll up messages in inbox

The inbox should work a bit like the one on your phone. You shouldn’t
see all the messages, but the latest one from each of your ‘contacts’
only.
This commit is contained in:
Chris Hill-Scott
2017-06-06 12:57:55 +01:00
parent a49e1b4f75
commit 313f669690
6 changed files with 36 additions and 13 deletions

View File

@@ -131,11 +131,11 @@ def test_inbound_messages_shows_count_of_messages(
@pytest.mark.parametrize('index, expected_row', enumerate([
'07900900000 foo 1 hour ago',
'07900900001 foo 2 hours ago',
'07900900002 foo 3 hours ago',
'07900900003 foo 4 hours ago',
'07900900004 foo 5 hours ago',
'07900 900000 message-1 1 hour ago',
'07900 900002 message-4 3 hours ago',
'07900 900004 message-5 5 hours ago',
'07900 900006 message-6 7 hours ago',
'07900 900008 message-7 9 hours ago',
]))
def test_inbox_showing_inbound_messages(
logged_in_client,
@@ -159,6 +159,9 @@ def test_inbox_showing_inbound_messages(
rows = page.select('tbody tr')
assert len(rows) == 5
assert normalize_spaces(rows[index].text) == expected_row
assert normalize_spaces(page.select('.table-show-more-link')) == (
'8 messages from 5 users'
)
def test_empty_inbox(