Add youth mode restriction labels
This commit is contained in:
@@ -3186,6 +3186,14 @@ func TestServeIMYouthModeEnableDisable(t *testing.T) {
|
||||
if data["enabled"] != true || data["policy_version"].(float64) != 2 {
|
||||
t.Fatalf("unexpected youth enable payload: %#v", data)
|
||||
}
|
||||
items := data["restriction_items"].([]any)
|
||||
if len(items) != 3 {
|
||||
t.Fatalf("restriction_items: got %#v", items)
|
||||
}
|
||||
firstItem := items[0].(map[string]any)
|
||||
if firstItem["code"] != "night_quiet" || firstItem["title"] != "深夜免打扰" || firstItem["enforced"] != false {
|
||||
t.Fatalf("unexpected restriction item: %#v", firstItem)
|
||||
}
|
||||
|
||||
security.actionToken = &types.ActionToken{Action: "close_youth_mode", Target: "youth_mode"}
|
||||
expectIMBearer(t, ctrl, "token-disable", 7, 42)
|
||||
|
||||
Reference in New Issue
Block a user