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: f0bd6c9699
Origin-Merge: 7713847b2a
Canonical: f1ba406015a2d5e37802b963757a5cac8ee3eb0e

Co-authored-by: epilepticseizureee <business.egor.sg@gmail.com>
This commit is contained in:
iamxvbaba 2026-07-30 14:06:39 +08:00
parent 7713847b2a
commit 3fa0c6f1e4
12 changed files with 156 additions and 16 deletions

View file

@ -961,6 +961,16 @@ func TestTDesktopPassiveChannelStubs(t *testing.T) {
}); err == nil || !strings.Contains(err.Error(), "MESSAGE_ID_INVALID") {
t.Fatalf("messages.deletePollAnswer err = %v, want MESSAGE_ID_INVALID without poll store", err)
}
verify := newFakeBotVerifications()
r.deps.BotVerifications = verify
const unreadPollIcon = int64(8800024)
unreadPollPeer := domain.Peer{Type: domain.PeerTypeChannel, ID: channel.ID}
verify.marks[unreadPollPeer] = domain.CustomVerification{
VerifierBotID: 777000123,
Peer: unreadPollPeer,
IconDocumentID: unreadPollIcon,
Description: "Verified poll peer",
}
unreadPollVotes, err := r.onMessagesGetUnreadPollVotes(ownerCtx, &tg.MessagesGetUnreadPollVotesRequest{
Peer: inputPeerChannel(channel),
Limit: 10,
@ -968,6 +978,7 @@ func TestTDesktopPassiveChannelStubs(t *testing.T) {
if err != nil {
t.Fatalf("messages.getUnreadPollVotes: %v", err)
}
assertMessagesEnvelopeBotVerificationIcon(t, unreadPollVotes, unreadPollPeer, unreadPollIcon)
if len(unreadPollVotes.(*tg.MessagesMessages).Messages) != 0 {
t.Fatalf("messages.getUnreadPollVotes = %+v, want empty messages", unreadPollVotes)
}