77package tests
88
99import (
10+ "net/url"
1011 "testing"
1112
1213 "github.com/matrix-org/complement/internal/b"
1314 "github.com/matrix-org/complement/internal/must"
15+ "github.com/sirupsen/logrus"
1416 "github.com/tidwall/gjson"
1517)
1618
@@ -49,7 +51,7 @@ func TestBackfillingHistory(t *testing.T) {
4951 })
5052
5153 // event1
52- alice .SendEventSynced (t , roomID , b.Event {
54+ event1 := alice .SendEvent (t , roomID , b.Event {
5355 Type : "m.room.message" ,
5456 PrevEvents : []string {
5557 eventA ,
@@ -60,11 +62,47 @@ func TestBackfillingHistory(t *testing.T) {
6062 },
6163 })
6264
65+ // event2
66+ event2 := alice .SendEvent (t , roomID , b.Event {
67+ Type : "m.room.message" ,
68+ PrevEvents : []string {
69+ event1 ,
70+ },
71+ Content : map [string ]interface {}{
72+ "msgtype" : "m.text" ,
73+ "body" : "Message 2" ,
74+ },
75+ })
76+
77+ // event3
78+ alice .SendEvent (t , roomID , b.Event {
79+ Type : "m.room.message" ,
80+ PrevEvents : []string {
81+ event2 ,
82+ },
83+ Content : map [string ]interface {}{
84+ "msgtype" : "m.text" ,
85+ "body" : "Message 3" ,
86+ },
87+ })
88+
89+ res := alice .MustDoRaw (t , "GET" , []string {"_matrix" , "client" , "r0" , "rooms" , roomID , "messages" }, nil , "application/json" , url.Values {
90+ "dir" : []string {"b" },
91+ "limit" : []string {"100" },
92+ })
93+
94+ t .Logf ("aweawfeefwaweafeafw" )
95+ logrus .WithFields (logrus.Fields {
96+ "res" : res ,
97+ }).Error ("messages res" )
98+
6399 t .Run ("parallel" , func (t * testing.T ) {
64100 // sytest: Room creation reports m.room.create to myself
65101 t .Run ("Room creation reports m.room.create to myself" , func (t * testing.T ) {
66102 t .Parallel ()
103+
67104 alice := deployment .Client (t , "hs1" , userID )
105+
68106 alice .SyncUntilTimelineHas (t , roomID , func (ev gjson.Result ) bool {
69107 if ev .Get ("type" ).Str != "m.room.create" {
70108 return false
0 commit comments