fix(rpc): sync verification icon envelope coverage
Follow up gramsrv#27 with the remaining peer-bearing messages.Messages boundaries and route-level wire regression coverage from the telesrv canonical implementation. Origin-PR: gramsrv#27 Origin-Head:f0bd6c9699Origin-Merge:7713847b2aCanonical: f1ba406015a2d5e37802b963757a5cac8ee3eb0e Co-authored-by: epilepticseizureee <business.egor.sg@gmail.com>
This commit is contained in:
parent
7713847b2a
commit
3fa0c6f1e4
12 changed files with 156 additions and 16 deletions
|
|
@ -447,6 +447,16 @@ func TestMessagesGetSavedDialogsByID(t *testing.T) {
|
|||
func TestMessagesGetSavedHistoryFiltersBySavedPeer(t *testing.T) {
|
||||
ctx := context.Background()
|
||||
r, _, alice, bob, noteID, fwdID := savedDialogsFixture(t)
|
||||
verify := newFakeBotVerifications()
|
||||
r.deps.BotVerifications = verify
|
||||
const savedHistoryIcon = int64(8800022)
|
||||
bobPeer := domain.Peer{Type: domain.PeerTypeUser, ID: bob.ID}
|
||||
verify.marks[bobPeer] = domain.CustomVerification{
|
||||
VerifierBotID: 777000123,
|
||||
Peer: bobPeer,
|
||||
IconDocumentID: savedHistoryIcon,
|
||||
Description: "Verified saved peer",
|
||||
}
|
||||
|
||||
bobHistory, err := r.onMessagesGetSavedHistory(WithUserID(ctx, alice.ID), &tg.MessagesGetSavedHistoryRequest{
|
||||
Peer: &tg.InputPeerUser{UserID: bob.ID, AccessHash: bob.AccessHash},
|
||||
|
|
@ -455,6 +465,7 @@ func TestMessagesGetSavedHistoryFiltersBySavedPeer(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatalf("getSavedHistory bob: %v", err)
|
||||
}
|
||||
assertMessagesEnvelopeBotVerificationIcon(t, bobHistory, bobPeer, savedHistoryIcon)
|
||||
bobMsgs := savedHistoryMessages(t, bobHistory)
|
||||
if len(bobMsgs) != 1 || bobMsgs[0].ID != fwdID {
|
||||
t.Fatalf("bob saved history = %+v, want forwarded message only", bobMsgs)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue