Fix profile display backfill startup
This commit is contained in:
@@ -64,10 +64,14 @@ func TestProfilePublicFromFields(t *testing.T) {
|
||||
|
||||
func TestProfileSeedFromPublic(t *testing.T) {
|
||||
nickname, avatar := profileSeedFromPublic(map[string]any{
|
||||
"fn": "旧昵称",
|
||||
"photo": "file_avatar_1",
|
||||
"fn": "旧昵称",
|
||||
"avatar_file_id": "file_avatar_1",
|
||||
})
|
||||
if nickname != "旧昵称" || avatar != "file_avatar_1" {
|
||||
t.Fatalf("unexpected profile seed nickname=%q avatar=%q", nickname, avatar)
|
||||
}
|
||||
_, avatar = profileSeedFromPublic(map[string]any{"photo": "https://example.com/avatar.png"})
|
||||
if avatar != "" {
|
||||
t.Fatalf("photo URL must not be treated as avatar_file_id: %q", avatar)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user