@@ -18,7 +18,7 @@ func (ch *Channel) refresh(ctx context.Context) error {
18
18
19
19
func TestClient_TestQuery (t * testing.T ) {
20
20
c := initClient (t )
21
- membersID := randomUsersID (t , c , 1 )
21
+ membersID := randomUsersID (t , c , 3 )
22
22
ch := initChannel (t , c , membersID ... )
23
23
ctx := context .Background ()
24
24
msg , err := ch .SendMessage (ctx , & Message {Text : "test message" , Pinned : true }, ch .CreatedBy .ID )
@@ -27,12 +27,21 @@ func TestClient_TestQuery(t *testing.T) {
27
27
q := & QueryRequest {
28
28
State : true ,
29
29
Messages : & MessagePaginationParamsRequest {PaginationParamsRequest : PaginationParamsRequest {Limit : 1 , IDLT : msg .Message .ID }},
30
- Members : & PaginationParamsRequest {Limit : 1 , Offset : 0 },
31
- Watchers : & PaginationParamsRequest {Limit : 1 , Offset : 0 },
30
+ Members : & PaginationParamsRequest {Limit : 3 , Offset : 0 },
31
+ Watchers : & PaginationParamsRequest {Limit : 3 , Offset : 0 },
32
32
}
33
33
resp , err := ch .Query (ctx , q )
34
34
require .NoError (t , err )
35
- require .Equal (t , 1 , len (resp .Members ))
35
+ require .Equal (t , 3 , len (resp .Members ))
36
+
37
+ for _ , read := range resp .Read {
38
+ if ch .CreatedBy .ID == read .User .ID {
39
+ require .Equal (t , 0 , read .UnreadMessages )
40
+ continue
41
+ }
42
+
43
+ require .Equal (t , 1 , read .UnreadMessages )
44
+ }
36
45
}
37
46
38
47
func TestClient_CreateChannel (t * testing.T ) {
0 commit comments