--- im.chat.member.bot.added_v1 / deleted_v1 ---
(t *testing.T)
| 147 | // --- im.chat.member.bot.added_v1 / deleted_v1 --- |
| 148 | |
| 149 | func TestImChatBotAddedProcessor_Compact(t *testing.T) { |
| 150 | p := NewImChatBotAddedProcessor() |
| 151 | if p.EventType() != "im.chat.member.bot.added_v1" { |
| 152 | t.Fatalf("EventType = %q", p.EventType()) |
| 153 | } |
| 154 | raw := makeRawEvent("im.chat.member.bot.added_v1", `{ |
| 155 | "chat_id": "oc_bot", |
| 156 | "operator_id": {"open_id": "ou_operator"}, |
| 157 | "external": false |
| 158 | }`) |
| 159 | result, ok := p.Transform(context.Background(), raw, TransformCompact).(map[string]interface{}) |
| 160 | if !ok { |
| 161 | t.Fatal("compact should return map") |
| 162 | } |
| 163 | if result["action"] != "added" { |
| 164 | t.Errorf("action = %v", result["action"]) |
| 165 | } |
| 166 | if result["chat_id"] != "oc_bot" { |
| 167 | t.Errorf("chat_id = %v", result["chat_id"]) |
| 168 | } |
| 169 | if result["operator_id"] != "ou_operator" { |
| 170 | t.Errorf("operator_id = %v", result["operator_id"]) |
| 171 | } |
| 172 | if result["external"] != false { |
| 173 | t.Errorf("external = %v", result["external"]) |
| 174 | } |
| 175 | } |
| 176 | |
| 177 | func TestImChatBotDeletedProcessor_Compact(t *testing.T) { |
| 178 | p := NewImChatBotDeletedProcessor() |
nothing calls this directly
no test coverage detected