parent
175a7bb067
commit
f2aa5a2d30
@ -0,0 +1,32 @@
|
||||
package mgo
|
||||
|
||||
import (
|
||||
"testing"
|
||||
"time"
|
||||
|
||||
"github.com/openimsdk/open-im-server/v3/pkg/common/storage/model"
|
||||
"github.com/openimsdk/protocol/constant"
|
||||
)
|
||||
|
||||
func TestGroupRequestHandlerUpdate(t *testing.T) {
|
||||
handledTime := time.Date(2026, time.September, 17, 12, 0, 0, 0, time.UTC)
|
||||
update := groupRequestHandlerUpdate(&model.GroupRequest{
|
||||
HandleResult: constant.GroupResponseAgree,
|
||||
HandledMsg: "approved",
|
||||
HandleUserID: "admin",
|
||||
HandledTime: handledTime,
|
||||
})
|
||||
|
||||
if _, ok := update["handle_msg"]; ok {
|
||||
t.Fatal("handler update contains obsolete handle_msg field")
|
||||
}
|
||||
want := map[string]any{
|
||||
"handled_msg": "approved", "handle_result": constant.GroupResponseAgree,
|
||||
"handle_user_id": "admin", "handled_time": handledTime,
|
||||
}
|
||||
for key, expected := range want {
|
||||
if got := update[key]; got != expected {
|
||||
t.Fatalf("handler update %s = %v, want %v", key, got, expected)
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Reference in new issue