package app import "testing" func TestPublishPlatformRequiresCover(t *testing.T) { t.Parallel() for _, platformID := range []string{"weixin_gzh", "baijiahao", "dongchedi", "smzdm"} { if !publishPlatformRequiresCover(platformID) { t.Fatalf("publishPlatformRequiresCover(%q) = false, want true", platformID) } } if publishPlatformRequiresCover("zhihu") { t.Fatal("publishPlatformRequiresCover(\"zhihu\") = true, want false") } } func TestPublishCoverRequirementCallersIncludeWeixinGzh(t *testing.T) { t.Parallel() accounts := []platformAccountSeed{{PlatformID: "weixin_gzh"}, {PlatformID: "smzdm"}} if !publishBatchRequiresCover(accounts) { t.Fatal("publishBatchRequiresCover() = false for cover-required platforms, want true") } if !schedulePublishPlatformsRequireCover([]string{"weixin_gzh", "smzdm"}) { t.Fatal("schedulePublishPlatformsRequireCover() = false for cover-required platforms, want true") } }