From 5e68dffd511b18c83679d5320225e6831f2c6dad Mon Sep 17 00:00:00 2001 From: Till Faelligen <2353100+S7evinK@users.noreply.github.com> Date: Thu, 15 Sep 2022 12:59:39 +0200 Subject: [PATCH 1/7] Add tests/43search.pl --- tests/csapi/apidoc_search_test.go | 347 ++++++++++++++++++++++++++++++ 1 file changed, 347 insertions(+) create mode 100644 tests/csapi/apidoc_search_test.go diff --git a/tests/csapi/apidoc_search_test.go b/tests/csapi/apidoc_search_test.go new file mode 100644 index 00000000..1ac68b81 --- /dev/null +++ b/tests/csapi/apidoc_search_test.go @@ -0,0 +1,347 @@ +package csapi_tests + +import ( + "fmt" + "net/http" + "net/url" + "strconv" + "testing" + + "github.com/tidwall/gjson" + + "github.com/matrix-org/complement/internal/b" + "github.com/matrix-org/complement/internal/client" + "github.com/matrix-org/complement/internal/match" + "github.com/matrix-org/complement/internal/must" +) + +// Note: In contrast to Sytest, we define a filter.rooms on each request, this allows us to run in parallel. +func TestSearch(t *testing.T) { + deployment := Deploy(t, b.BlueprintAlice) + defer deployment.Destroy(t) + + alice := deployment.Client(t, "hs1", "@alice:hs1") + + t.Run("parallel", func(t *testing.T) { + // sytest: Can search for an event by body + t.Run("Can search for an event by body", func(t *testing.T) { + t.Parallel() + roomID := alice.CreateRoom(t, map[string]interface{}{ + "preset": "private_chat", + }) + eventID := alice.SendEventSynced(t, roomID, b.Event{ + Type: "m.room.message", + Content: map[string]interface{}{ + "body": "hello, world", + }, + }) + + searchRequest := client.WithJSONBody(t, map[string]interface{}{ + "search_categories": map[string]interface{}{ + "room_events": map[string]interface{}{ + "keys": []string{"content.body"}, + "search_term": "hello", + "filter": map[string]interface{}{ + "rooms": []string{roomID}, + }, + }, + }, + }) + + resp := alice.MustDoFunc(t, "POST", []string{"_matrix", "client", "v3", "search"}, searchRequest) + sce := "search_categories.room_events" + result0 := sce + ".results.0.result" + must.MatchResponse(t, resp, match.HTTPResponse{ + StatusCode: http.StatusOK, + JSON: []match.JSON{ + match.JSONKeyPresent(sce + ".count"), + match.JSONKeyPresent(sce + ".results"), + match.JSONKeyEqual(sce+".count", float64(1)), + match.JSONKeyEqual(result0+".event_id", eventID), + match.JSONKeyEqual(result0+".room_id", roomID), + match.JSONKeyPresent(result0 + ".content"), + match.JSONKeyPresent(result0 + ".type"), + match.JSONKeyEqual(result0+".content.body", "hello, world"), + }, + }) + }) + + // sytest: Can get context around search results + t.Run("Can get context around search results", func(t *testing.T) { + t.Parallel() + roomID := alice.CreateRoom(t, map[string]interface{}{ + "preset": "private_chat", + }) + + for i := 1; i <= 7; i++ { + alice.SendEventSynced(t, roomID, b.Event{ + Type: "m.room.message", + Content: map[string]interface{}{ + "body": fmt.Sprintf("Message number %d", i), + }, + }) + } + + searchRequest := client.WithJSONBody(t, map[string]interface{}{ + "search_categories": map[string]interface{}{ + "room_events": map[string]interface{}{ + "keys": []string{"content.body"}, + "search_term": "Message 4", + "order_by": "recent", + "filter": map[string]interface{}{ + "limit": 1, + "rooms": []string{roomID}, + }, + "event_context": map[string]interface{}{ + "before_limit": 2, + "after_limit": 2, + }, + }, + }, + }) + + resp := alice.MustDoFunc(t, "POST", []string{"_matrix", "client", "v3", "search"}, searchRequest) + sce := "search_categories.room_events" + result0 := sce + ".results.0.result" + resBefore := sce + ".results.0.context.events_before" + resAfter := sce + ".results.0.context.events_after" + must.MatchResponse(t, resp, match.HTTPResponse{ + StatusCode: http.StatusOK, + JSON: []match.JSON{ + match.JSONKeyPresent(sce + ".count"), + match.JSONKeyPresent(sce + ".results"), + match.JSONKeyPresent(sce + ".next_batch"), + match.JSONKeyEqual(sce+".count", float64(1)), + match.JSONKeyEqual(result0+".room_id", roomID), + match.JSONKeyPresent(result0 + ".content"), + match.JSONKeyPresent(result0 + ".type"), + match.JSONKeyEqual(result0+".content.body", "Message number 4"), + match.JSONKeyEqual(resBefore+".0.content.body", "Message number 3"), + match.JSONKeyEqual(resBefore+".1.content.body", "Message number 2"), + match.JSONKeyEqual(resAfter+".0.content.body", "Message number 5"), + match.JSONKeyEqual(resAfter+".1.content.body", "Message number 6"), + }, + }) + }) + + // sytest: Can back-paginate search results + t.Run("Can back-paginate search results", func(t *testing.T) { + t.Parallel() + roomID := alice.CreateRoom(t, map[string]interface{}{ + "preset": "private_chat", + }) + + eventIDs := make([]string, 20) + for i := 0; i <= 19; i++ { + eventID := alice.SendEventSynced(t, roomID, b.Event{ + Type: "m.room.message", + Content: map[string]interface{}{ + "body": fmt.Sprintf("Message number %d", i), + }, + }) + eventIDs[i] = eventID + } + + searchRequest := client.WithJSONBody(t, map[string]interface{}{ + "search_categories": map[string]interface{}{ + "room_events": map[string]interface{}{ + "keys": []string{"content.body"}, + "search_term": "Message", + "order_by": "recent", + "filter": map[string]interface{}{ + "limit": 10, + "rooms": []string{roomID}, + }, + }, + }, + }) + + resp := alice.MustDoFunc(t, "POST", []string{"_matrix", "client", "v3", "search"}, searchRequest) + + // First search result + nextBatch := checkBackpaginateResult(t, resp, 20, eventIDs[19], eventIDs[10]) + + if nextBatch == "" { + t.Fatalf("no next batch set!") + } + + values := url.Values{} + values.Set("next_batch", nextBatch) + params := client.WithQueries(values) + resp = alice.MustDoFunc(t, "POST", []string{"_matrix", "client", "v3", "search"}, searchRequest, params) + // Second search result + nextBatch = checkBackpaginateResult(t, resp, 20, eventIDs[9], eventIDs[0]) + + // At this point we expect next_batch to be empty + values.Set("next_batch", nextBatch) + params = client.WithQueries(values) + resp = alice.MustDoFunc(t, "POST", []string{"_matrix", "client", "v3", "search"}, searchRequest, params) + // third search result + sce := "search_categories.room_events" + result0 := sce + ".results.0.result" + must.MatchResponse(t, resp, match.HTTPResponse{ + StatusCode: http.StatusOK, + JSON: []match.JSON{ + match.JSONKeyPresent(sce + ".count"), + match.JSONKeyPresent(sce + ".results"), + match.JSONKeyEqual(sce+".count", float64(20)), + match.JSONKeyMissing(result0), + match.JSONKeyMissing(sce + ".next_batch"), + }, + }) + }) + + // sytest: Search works across an upgraded room and its predecessor + t.Run("Search works across an upgraded room and its predecessor", func(t *testing.T) { + t.Parallel() + roomID := alice.CreateRoom(t, map[string]interface{}{ + "preset": "private_chat", + "version": "8", + }) + + eventBeforeUpgrade := alice.SendEventSynced(t, roomID, b.Event{ + Type: "m.room.message", + Content: map[string]interface{}{ + "body": fmt.Sprintf("Message before upgrade"), + }, + }) + + upgradeBody := client.WithJSONBody(t, map[string]string{ + "new_version": "9", + }) + upgradeResp := alice.MustDoFunc(t, "POST", []string{"_matrix", "client", "v3", "rooms", roomID, "upgrade"}, upgradeBody) + body := must.ParseJSON(t, upgradeResp.Body) + newRoomID := must.GetJSONFieldStr(t, body, "replacement_room") + + eventAfterUpgrade := alice.SendEventSynced(t, newRoomID, b.Event{ + Type: "m.room.message", + Content: map[string]interface{}{ + "body": fmt.Sprintf("Message after upgrade"), + }, + }) + + searchRequest := client.WithJSONBody(t, map[string]interface{}{ + "search_categories": map[string]interface{}{ + "room_events": map[string]interface{}{ + "keys": []string{"content.body"}, + "search_term": "upgrade", + "filter": map[string]interface{}{ + "rooms": []string{roomID, newRoomID}, + }, + }, + }, + }) + + resp := alice.MustDoFunc(t, "POST", []string{"_matrix", "client", "v3", "search"}, searchRequest) + sce := "search_categories.room_events" + result0 := sce + ".results.0.result" + result1 := sce + ".results.1.result" + must.MatchResponse(t, resp, match.HTTPResponse{ + StatusCode: http.StatusOK, + JSON: []match.JSON{ + match.JSONKeyPresent(sce + ".count"), + match.JSONKeyPresent(sce + ".results"), + match.JSONKeyPresent(sce + ".next_batch"), + match.JSONKeyEqual(sce+".count", float64(2)), + match.JSONKeyPresent(result0 + ".content"), + match.JSONKeyPresent(result0 + ".type"), + match.JSONKeyEqual(result0+".event_id", eventBeforeUpgrade), + match.JSONKeyEqual(result1+".event_id", eventAfterUpgrade), + match.JSONKeyEqual(result0+".content.body", "Message before upgrade"), + match.JSONKeyEqual(result1+".content.body", "Message after upgrade"), + }, + }) + }) + + var txnID int + for _, ordering := range []string{"rank", "recent"} { + // sytest: Search results with $ordering_type ordering do not include redacted events + t.Run(fmt.Sprintf("Search results with %s ordering do not include redacted events", ordering), func(t *testing.T) { + t.Parallel() + roomID := alice.CreateRoom(t, map[string]interface{}{ + "preset": "private_chat", + }) + + redactedEventID := alice.SendEventSynced(t, roomID, b.Event{ + Type: "m.room.message", + Content: map[string]interface{}{ + "body": fmt.Sprintf("This message is going to be redacted"), + }, + }) + + visibleEventID := alice.SendEventSynced(t, roomID, b.Event{ + Type: "m.room.message", + Content: map[string]interface{}{ + "body": fmt.Sprintf("This message is not going to be redacted"), + }, + }) + + // redact the event + redactBody := client.WithJSONBody(t, map[string]interface{}{"reason": "testing"}) + resp := alice.MustDoFunc(t, "PUT", []string{"_matrix", "client", "v3", "rooms", roomID, "redact", redactedEventID, strconv.Itoa(txnID)}, redactBody) + txnID++ + j := must.ParseJSON(t, resp.Body) + redactionEventID := must.GetJSONFieldStr(t, j, "event_id") + // wait for the redaction to come down sync + alice.MustSyncUntil(t, client.SyncReq{}, client.SyncTimelineHasEventID(roomID, redactionEventID)) + + searchRequest := client.WithJSONBody(t, map[string]interface{}{ + "search_categories": map[string]interface{}{ + "room_events": map[string]interface{}{ + "keys": []string{"content.body"}, + "order_by": ordering, + "search_term": "redacted", + "filter": map[string]interface{}{ + "rooms": []string{roomID}, + }, + }, + }, + }) + + resp = alice.MustDoFunc(t, "POST", []string{"_matrix", "client", "v3", "search"}, searchRequest) + sce := "search_categories.room_events" + result0 := sce + ".results.0.result" + must.MatchResponse(t, resp, match.HTTPResponse{ + StatusCode: http.StatusOK, + JSON: []match.JSON{ + match.JSONKeyPresent(sce + ".count"), + match.JSONKeyPresent(sce + ".results"), + match.JSONKeyPresent(sce + ".next_batch"), + match.JSONKeyEqual(sce+".count", float64(1)), + match.JSONKeyPresent(result0 + ".content"), + match.JSONKeyPresent(result0 + ".type"), + match.JSONKeyEqual(result0+".event_id", visibleEventID), + match.JSONKeyEqual(result0+".content.body", "This message is not going to be redacted"), + }, + }) + }) + } + + }) +} + +func checkBackpaginateResult(t *testing.T, resp *http.Response, wantCount float64, lastEventID, firstEventID string) (nextBatch string) { + sce := "search_categories.room_events" + result0 := sce + ".results.0.result" + result9 := sce + ".results.9.result" + must.MatchResponse(t, resp, match.HTTPResponse{ + StatusCode: http.StatusOK, + JSON: []match.JSON{ + match.JSONKeyPresent(sce + ".count"), + match.JSONKeyPresent(sce + ".results"), + match.JSONMapEach(sce, func(k, v gjson.Result) error { + if k.Str == "next_batch" { + nextBatch = v.Str + return nil + } + return nil + }), + match.JSONKeyEqual(sce+".count", wantCount), + match.JSONKeyPresent(result0 + ".content"), + match.JSONKeyPresent(result0 + ".type"), + match.JSONKeyEqual(result0+".event_id", lastEventID), + match.JSONKeyEqual(result9+".event_id", firstEventID), + }, + }) + return +} From 7f26e5bd17194eb67710274d20469ff06f4dbed4 Mon Sep 17 00:00:00 2001 From: Till Faelligen <2353100+S7evinK@users.noreply.github.com> Date: Thu, 15 Sep 2022 13:28:40 +0200 Subject: [PATCH 2/7] Fix duplicate transaction ID --- tests/csapi/apidoc_search_test.go | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/tests/csapi/apidoc_search_test.go b/tests/csapi/apidoc_search_test.go index 1ac68b81..24ca03e4 100644 --- a/tests/csapi/apidoc_search_test.go +++ b/tests/csapi/apidoc_search_test.go @@ -4,9 +4,9 @@ import ( "fmt" "net/http" "net/url" - "strconv" "testing" + "github.com/matrix-org/util" "github.com/tidwall/gjson" "github.com/matrix-org/complement/internal/b" @@ -253,7 +253,6 @@ func TestSearch(t *testing.T) { }) }) - var txnID int for _, ordering := range []string{"rank", "recent"} { // sytest: Search results with $ordering_type ordering do not include redacted events t.Run(fmt.Sprintf("Search results with %s ordering do not include redacted events", ordering), func(t *testing.T) { @@ -278,8 +277,8 @@ func TestSearch(t *testing.T) { // redact the event redactBody := client.WithJSONBody(t, map[string]interface{}{"reason": "testing"}) - resp := alice.MustDoFunc(t, "PUT", []string{"_matrix", "client", "v3", "rooms", roomID, "redact", redactedEventID, strconv.Itoa(txnID)}, redactBody) - txnID++ + txnID := util.RandomString(8) // random string, as time.Now().Unix() might create the same txnID + resp := alice.MustDoFunc(t, "PUT", []string{"_matrix", "client", "v3", "rooms", roomID, "redact", redactedEventID, txnID}, redactBody) j := must.ParseJSON(t, resp.Body) redactionEventID := must.GetJSONFieldStr(t, j, "event_id") // wait for the redaction to come down sync From 7e9371c681fb607501baed4118c73e0efafc0811 Mon Sep 17 00:00:00 2001 From: Till Faelligen <2353100+S7evinK@users.noreply.github.com> Date: Thu, 15 Sep 2022 13:57:32 +0200 Subject: [PATCH 3/7] Add missing msgtype, skip on Dendrite --- tests/csapi/apidoc_search_test.go | 25 +++++++++++++++++-------- 1 file changed, 17 insertions(+), 8 deletions(-) diff --git a/tests/csapi/apidoc_search_test.go b/tests/csapi/apidoc_search_test.go index 24ca03e4..574a803d 100644 --- a/tests/csapi/apidoc_search_test.go +++ b/tests/csapi/apidoc_search_test.go @@ -13,10 +13,12 @@ import ( "github.com/matrix-org/complement/internal/client" "github.com/matrix-org/complement/internal/match" "github.com/matrix-org/complement/internal/must" + "github.com/matrix-org/complement/runtime" ) -// Note: In contrast to Sytest, we define a filter.rooms on each request, this allows us to run in parallel. +// Note: In contrast to Sytest, we define a filter.rooms on each search request, this allows us to run in parallel. func TestSearch(t *testing.T) { + runtime.SkipIf(t, runtime.Dendrite) // https://github.com/matrix-org/dendrite/pull/2675 deployment := Deploy(t, b.BlueprintAlice) defer deployment.Destroy(t) @@ -32,7 +34,8 @@ func TestSearch(t *testing.T) { eventID := alice.SendEventSynced(t, roomID, b.Event{ Type: "m.room.message", Content: map[string]interface{}{ - "body": "hello, world", + "msgtype": "m.text", + "body": "hello, world", }, }) @@ -77,7 +80,8 @@ func TestSearch(t *testing.T) { alice.SendEventSynced(t, roomID, b.Event{ Type: "m.room.message", Content: map[string]interface{}{ - "body": fmt.Sprintf("Message number %d", i), + "body": fmt.Sprintf("Message number %d", i), + "msgtype": "m.text", }, }) } @@ -136,7 +140,8 @@ func TestSearch(t *testing.T) { eventID := alice.SendEventSynced(t, roomID, b.Event{ Type: "m.room.message", Content: map[string]interface{}{ - "body": fmt.Sprintf("Message number %d", i), + "body": fmt.Sprintf("Message number %d", i), + "msgtype": "m.text", }, }) eventIDs[i] = eventID @@ -202,7 +207,8 @@ func TestSearch(t *testing.T) { eventBeforeUpgrade := alice.SendEventSynced(t, roomID, b.Event{ Type: "m.room.message", Content: map[string]interface{}{ - "body": fmt.Sprintf("Message before upgrade"), + "body": fmt.Sprintf("Message before upgrade"), + "msgtype": "m.text", }, }) @@ -216,7 +222,8 @@ func TestSearch(t *testing.T) { eventAfterUpgrade := alice.SendEventSynced(t, newRoomID, b.Event{ Type: "m.room.message", Content: map[string]interface{}{ - "body": fmt.Sprintf("Message after upgrade"), + "body": fmt.Sprintf("Message after upgrade"), + "msgtype": "m.text", }, }) @@ -264,14 +271,16 @@ func TestSearch(t *testing.T) { redactedEventID := alice.SendEventSynced(t, roomID, b.Event{ Type: "m.room.message", Content: map[string]interface{}{ - "body": fmt.Sprintf("This message is going to be redacted"), + "body": fmt.Sprintf("This message is going to be redacted"), + "msgtype": "m.text", }, }) visibleEventID := alice.SendEventSynced(t, roomID, b.Event{ Type: "m.room.message", Content: map[string]interface{}{ - "body": fmt.Sprintf("This message is not going to be redacted"), + "body": fmt.Sprintf("This message is not going to be redacted"), + "msgtype": "m.text", }, }) From ac0708ee1851c620f91f7f31d66c55eb6de7ad64 Mon Sep 17 00:00:00 2001 From: Till Faelligen <2353100+S7evinK@users.noreply.github.com> Date: Thu, 15 Sep 2022 14:38:01 +0200 Subject: [PATCH 4/7] Remove next_batch where it's not returned --- tests/csapi/apidoc_search_test.go | 3 --- 1 file changed, 3 deletions(-) diff --git a/tests/csapi/apidoc_search_test.go b/tests/csapi/apidoc_search_test.go index 574a803d..8f27b63d 100644 --- a/tests/csapi/apidoc_search_test.go +++ b/tests/csapi/apidoc_search_test.go @@ -114,7 +114,6 @@ func TestSearch(t *testing.T) { JSON: []match.JSON{ match.JSONKeyPresent(sce + ".count"), match.JSONKeyPresent(sce + ".results"), - match.JSONKeyPresent(sce + ".next_batch"), match.JSONKeyEqual(sce+".count", float64(1)), match.JSONKeyEqual(result0+".room_id", roomID), match.JSONKeyPresent(result0 + ".content"), @@ -248,7 +247,6 @@ func TestSearch(t *testing.T) { JSON: []match.JSON{ match.JSONKeyPresent(sce + ".count"), match.JSONKeyPresent(sce + ".results"), - match.JSONKeyPresent(sce + ".next_batch"), match.JSONKeyEqual(sce+".count", float64(2)), match.JSONKeyPresent(result0 + ".content"), match.JSONKeyPresent(result0 + ".type"), @@ -314,7 +312,6 @@ func TestSearch(t *testing.T) { JSON: []match.JSON{ match.JSONKeyPresent(sce + ".count"), match.JSONKeyPresent(sce + ".results"), - match.JSONKeyPresent(sce + ".next_batch"), match.JSONKeyEqual(sce+".count", float64(1)), match.JSONKeyPresent(result0 + ".content"), match.JSONKeyPresent(result0 + ".type"), From 559ce15a8324e2c3cb43daf94bed8baead43fd4c Mon Sep 17 00:00:00 2001 From: Till Faelligen <2353100+S7evinK@users.noreply.github.com> Date: Fri, 16 Sep 2022 07:04:25 +0200 Subject: [PATCH 5/7] Force count to be 2, remove unneeded fmt.Sprintf --- tests/csapi/apidoc_search_test.go | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/tests/csapi/apidoc_search_test.go b/tests/csapi/apidoc_search_test.go index 8f27b63d..ef51ddf3 100644 --- a/tests/csapi/apidoc_search_test.go +++ b/tests/csapi/apidoc_search_test.go @@ -206,7 +206,7 @@ func TestSearch(t *testing.T) { eventBeforeUpgrade := alice.SendEventSynced(t, roomID, b.Event{ Type: "m.room.message", Content: map[string]interface{}{ - "body": fmt.Sprintf("Message before upgrade"), + "body": "Message before upgrade", "msgtype": "m.text", }, }) @@ -221,7 +221,7 @@ func TestSearch(t *testing.T) { eventAfterUpgrade := alice.SendEventSynced(t, newRoomID, b.Event{ Type: "m.room.message", Content: map[string]interface{}{ - "body": fmt.Sprintf("Message after upgrade"), + "body": "Message after upgrade", "msgtype": "m.text", }, }) @@ -269,15 +269,16 @@ func TestSearch(t *testing.T) { redactedEventID := alice.SendEventSynced(t, roomID, b.Event{ Type: "m.room.message", Content: map[string]interface{}{ - "body": fmt.Sprintf("This message is going to be redacted"), + "body": "This message is going to be redacted", "msgtype": "m.text", }, }) + wantContentBody := "This message is not going to be redacted" visibleEventID := alice.SendEventSynced(t, roomID, b.Event{ Type: "m.room.message", Content: map[string]interface{}{ - "body": fmt.Sprintf("This message is not going to be redacted"), + "body": wantContentBody, "msgtype": "m.text", }, }) @@ -312,11 +313,11 @@ func TestSearch(t *testing.T) { JSON: []match.JSON{ match.JSONKeyPresent(sce + ".count"), match.JSONKeyPresent(sce + ".results"), - match.JSONKeyEqual(sce+".count", float64(1)), + match.JSONKeyArrayOfSize(sce+".results", 1), match.JSONKeyPresent(result0 + ".content"), match.JSONKeyPresent(result0 + ".type"), match.JSONKeyEqual(result0+".event_id", visibleEventID), - match.JSONKeyEqual(result0+".content.body", "This message is not going to be redacted"), + match.JSONKeyEqual(result0+".content.body", wantContentBody), }, }) }) From 00cd555a6a30ec119c9c7592817caad67eff7bf3 Mon Sep 17 00:00:00 2001 From: Till Faelligen <2353100+S7evinK@users.noreply.github.com> Date: Fri, 16 Sep 2022 10:52:24 +0200 Subject: [PATCH 6/7] Add next_batch again --- tests/csapi/apidoc_search_test.go | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/csapi/apidoc_search_test.go b/tests/csapi/apidoc_search_test.go index ef51ddf3..99647392 100644 --- a/tests/csapi/apidoc_search_test.go +++ b/tests/csapi/apidoc_search_test.go @@ -342,6 +342,7 @@ func checkBackpaginateResult(t *testing.T, resp *http.Response, wantCount float6 } return nil }), + match.JSONKeyPresent(sce + ".next_batch"), match.JSONKeyEqual(sce+".count", wantCount), match.JSONKeyPresent(result0 + ".content"), match.JSONKeyPresent(result0 + ".type"), From 861fc7c1be14293f713ae0e7116f1a277544dcd7 Mon Sep 17 00:00:00 2001 From: Till Faelligen <2353100+S7evinK@users.noreply.github.com> Date: Fri, 16 Sep 2022 18:27:04 +0200 Subject: [PATCH 7/7] Re-add next_batch check --- tests/csapi/apidoc_search_test.go | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/csapi/apidoc_search_test.go b/tests/csapi/apidoc_search_test.go index 99647392..7be6058d 100644 --- a/tests/csapi/apidoc_search_test.go +++ b/tests/csapi/apidoc_search_test.go @@ -114,6 +114,7 @@ func TestSearch(t *testing.T) { JSON: []match.JSON{ match.JSONKeyPresent(sce + ".count"), match.JSONKeyPresent(sce + ".results"), + match.JSONKeyPresent(sce + ".next_batch"), match.JSONKeyEqual(sce+".count", float64(1)), match.JSONKeyEqual(result0+".room_id", roomID), match.JSONKeyPresent(result0 + ".content"),