fix: sync Android cursor tolerance fixes
This commit is contained in:
parent
ca79562fd8
commit
2d5a6236c2
5 changed files with 198 additions and 8 deletions
|
|
@ -298,8 +298,16 @@ func TestStoriesGetAllStoriesPaginatesByPeerState(t *testing.T) {
|
|||
finalAsCursor := &tg.StoriesGetAllStoriesRequest{}
|
||||
finalAsCursor.SetState(next.State)
|
||||
finalAsCursor.SetNext(true)
|
||||
if _, err := r.onStoriesGetAllStories(ctx, finalAsCursor); err == nil || !tgerr.Is(err, "OFFSET_INVALID") {
|
||||
t.Fatalf("final state as cursor err = %v, want OFFSET_INVALID", err)
|
||||
finalAsCursorClass, err := r.onStoriesGetAllStories(reqCtx, finalAsCursor)
|
||||
if err != nil {
|
||||
t.Fatalf("final state as cursor: %v", err)
|
||||
}
|
||||
finalAsCursorPage, ok := finalAsCursorClass.(*tg.StoriesAllStories)
|
||||
if !ok {
|
||||
t.Fatalf("final state as cursor response = %T, want stories.allStories terminal page", finalAsCursorClass)
|
||||
}
|
||||
if finalAsCursorPage.HasMore || len(finalAsCursorPage.PeerStories) != 0 || finalAsCursorPage.Count != domain.MaxStoryListLimit+1 || finalAsCursorPage.State != next.State {
|
||||
t.Fatalf("final state as cursor page = %+v, want empty terminal page preserving request count/state", finalAsCursorPage)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue