28 lines
724 B
Go
28 lines
724 B
Go
package service
|
|
|
|
import (
|
|
"testing"
|
|
|
|
roomeventsv1 "hyapp.local/api/proto/events/room/v1"
|
|
)
|
|
|
|
func TestRoomMicChangedIMAttributesKeepStateZeroValues(t *testing.T) {
|
|
attributes := roomMicChangedIMAttributes(&roomeventsv1.RoomMicChanged{
|
|
ActorUserId: 1001,
|
|
TargetUserId: 1001,
|
|
ToSeat: 2,
|
|
Action: "mic_unmute",
|
|
MicSessionId: "mic-session-1",
|
|
PublishState: "publishing",
|
|
MicMuted: false,
|
|
TargetGiftValue: 0,
|
|
})
|
|
|
|
if attributes["mic_muted"] != "false" {
|
|
t.Fatalf("mic_muted=false must stay in direct IM attributes: %+v", attributes)
|
|
}
|
|
if attributes["target_gift_value"] != "0" {
|
|
t.Fatalf("target_gift_value=0 must stay in direct IM attributes: %+v", attributes)
|
|
}
|
|
}
|