feat: sync AI compose and ChatBot features
This commit is contained in:
parent
35e5d38f4d
commit
b7269b135f
75 changed files with 5426 additions and 123 deletions
34
internal/rpc/message_edit_hide_projection_test.go
Normal file
34
internal/rpc/message_edit_hide_projection_test.go
Normal file
|
|
@ -0,0 +1,34 @@
|
|||
package rpc
|
||||
|
||||
import (
|
||||
"testing"
|
||||
|
||||
"github.com/gotd/td/tg"
|
||||
"telesrv/internal/domain"
|
||||
)
|
||||
|
||||
func TestMessageProjectionSetsEditHide(t *testing.T) {
|
||||
projected, ok := tgMessage(domain.Message{
|
||||
ID: 5,
|
||||
Peer: domain.Peer{Type: domain.PeerTypeUser, ID: 1002},
|
||||
Body: "streamed",
|
||||
EditDate: 1700000400,
|
||||
HideEdited: true,
|
||||
}).(*tg.Message)
|
||||
if !ok {
|
||||
t.Fatalf("tgMessage = %T, want *tg.Message", projected)
|
||||
}
|
||||
if projected.EditDate != 1700000400 || !projected.EditHide {
|
||||
t.Fatalf("projected edit fields = edit_date %d edit_hide %v", projected.EditDate, projected.EditHide)
|
||||
}
|
||||
|
||||
plain := tgMessage(domain.Message{
|
||||
ID: 6,
|
||||
Peer: domain.Peer{Type: domain.PeerTypeUser, ID: 1002},
|
||||
Body: "edited",
|
||||
EditDate: 1700000401,
|
||||
}).(*tg.Message)
|
||||
if plain.EditHide {
|
||||
t.Fatal("plain edited message should not hide edited badge")
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue