blob: e6db18eba0eddda85ade8aef2e2dba349aa7901a (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
|
Feature: chat/unread-messages
Background:
Given user "participant1" exists
Given user "participant2" exists
Scenario: sending a message clears unread counter for sender
Given user "participant1" creates room "group room" (v4)
| roomType | 2 |
| roomName | room |
And user "participant1" adds user "participant2" to room "group room" with 200 (v4)
When user "participant1" sends message "Message 1" to room "group room" with 201
Then user "participant1" is participant of room "group room" (v4)
| unreadMessages |
| 0 |
And user "participant2" is participant of room "group room" (v4)
| unreadMessages |
| 1 |
Scenario: sending several messages clears unread counter for sender
Given user "participant1" creates room "group room" (v4)
| roomType | 2 |
| roomName | room |
And user "participant1" adds user "participant2" to room "group room" with 200 (v4)
When user "participant1" sends message "Message 1" to room "group room" with 201
And user "participant1" sends message "Message 2" to room "group room" with 201
And user "participant1" sends message "Message 3" to room "group room" with 201
Then user "participant1" is participant of room "group room" (v4)
| unreadMessages |
| 0 |
And user "participant2" is participant of room "group room" (v4)
| unreadMessages |
| 3 |
Scenario: sending a message with previously unread messages clears unread counter for sender
Given user "participant1" creates room "group room" (v4)
| roomType | 2 |
| roomName | room |
And user "participant1" adds user "participant2" to room "group room" with 200 (v4)
And user "participant2" sends message "Message 1" to room "group room" with 201
And user "participant2" sends message "Message 2" to room "group room" with 201
When user "participant1" sends message "Message 3" to room "group room" with 201
Then user "participant1" is participant of room "group room" (v4)
| unreadMessages |
| 0 |
And user "participant2" is participant of room "group room" (v4)
| unreadMessages |
| 1 |
Scenario: reading all messages clears unread counter for reader
Given user "participant1" creates room "group room" (v4)
| roomType | 2 |
| roomName | room |
And user "participant1" adds user "participant2" to room "group room" with 200 (v4)
And user "participant1" sends message "Message 1" to room "group room" with 201
And user "participant1" sends message "Message 2" to room "group room" with 201
And user "participant1" sends message "Message 3" to room "group room" with 201
When user "participant2" reads message "Message 3" in room "group room" with 200
Then user "participant2" is participant of room "group room" (v4)
| unreadMessages |
| 0 |
Scenario: reading some messages reduces unread counter for reader
Given user "participant1" creates room "group room" (v4)
| roomType | 2 |
| roomName | room |
And user "participant1" adds user "participant2" to room "group room" with 200 (v4)
And user "participant1" sends message "Message 1" to room "group room" with 201
And user "participant1" sends message "Message 2" to room "group room" with 201
And user "participant1" sends message "Message 3" to room "group room" with 201
When user "participant2" reads message "Message 2" in room "group room" with 200
Then user "participant2" is participant of room "group room" (v4)
| unreadMessages |
| 1 |
Scenario: replies are taken into account in unread counter
Given user "participant1" creates room "group room" (v4)
| roomType | 2 |
| roomName | room |
And user "participant1" adds user "participant2" to room "group room" with 200 (v4)
And user "participant1" sends message "Message 1" to room "group room" with 201
When user "participant1" sends reply "Message 1-1" on message "Message 1" to room "group room" with 201
Then user "participant1" is participant of room "group room" (v4)
| unreadMessages |
| 0 |
And user "participant2" is participant of room "group room" (v4)
| unreadMessages |
| 2 |
Scenario: rich object messages are taken into account in unread counter
Given user "participant1" creates room "group room" (v4)
| roomType | 2 |
| roomName | room |
And user "participant1" adds user "participant2" to room "group room" with 200 (v4)
When user "participant1" shares rich-object "call" "R4nd0mT0k3n" '{"name":"Another room","call-type":"group"}' to room "group room" with 201 (v1)
Then user "participant1" is participant of room "group room" (v4)
| unreadMessages |
| 0 |
And user "participant2" is participant of room "group room" (v4)
| unreadMessages |
| 1 |
Scenario: shared file messages are taken into account in unread counter
Given user "participant1" creates room "group room" (v4)
| roomType | 2 |
| roomName | room |
And user "participant1" adds user "participant2" to room "group room" with 200 (v4)
When user "participant1" shares "welcome.txt" with room "group room"
# Unread counter for sender is not cleared in this case, as it is not
# possible to know whether the file was shared from Talk, which could clear
# the counter, or from the Files app, which should not clear it.
Then user "participant1" is participant of room "group room" (v4)
| unreadMessages |
| 1 |
And user "participant2" is participant of room "group room" (v4)
| unreadMessages |
| 1 |
Scenario: system messages are not taken into account in unread counter
Given user "participant1" creates room "group room" (v4)
| roomType | 2 |
| roomName | room |
And user "participant1" adds user "participant2" to room "group room" with 200 (v4)
When user "participant1" makes room "group room" private with 200 (v4)
Then user "participant1" is participant of room "group room" (v4)
| unreadMessages |
| 0 |
And user "participant2" is participant of room "group room" (v4)
| unreadMessages |
| 0 |
|