Sync telesrv 570ccf8 (feat(ephemeral): implement Layer 228 transient messages). Skipped telesrv docs changes per public sync rules; normalized the public appearance seed label.
25 lines
668 B
Go
25 lines
668 B
Go
package rpc
|
|
|
|
import (
|
|
"testing"
|
|
|
|
"telesrv/internal/domain"
|
|
)
|
|
|
|
func TestTGBotInfoPreservesEphemeralCommandMarker(t *testing.T) {
|
|
got := tgBotInfoFromProfile(42, domain.BotProfile{
|
|
Commands: []domain.BotCommand{
|
|
{Command: "public", Description: "visible everywhere"},
|
|
{Command: "private", Description: "Layer 228 only", Ephemeral: true},
|
|
},
|
|
}, true)
|
|
if len(got.Commands) != 2 {
|
|
t.Fatalf("commands = %+v, want two", got.Commands)
|
|
}
|
|
if got.Commands[0].Ephemeral {
|
|
t.Fatalf("public command = %+v, want ephemeral=false", got.Commands[0])
|
|
}
|
|
if !got.Commands[1].Ephemeral {
|
|
t.Fatalf("private command = %+v, want ephemeral=true", got.Commands[1])
|
|
}
|
|
}
|