package jobs

import (
	"testing"

	"qycw/go-server/internal/bootstrap"
)

func TestMaintenanceWorkerOnlySchedulesAdditionalTasks(t *testing.T) {
	worker := NewMaintenanceWorker(&bootstrap.App{}, nil, nil)
	for _, duplicate := range []string{"provision", "settlement", "upstream_actions", "instance_lifecycle"} {
		if _, exists := worker.schedule[duplicate]; exists {
			t.Fatalf("maintenance worker duplicates dedicated worker %q", duplicate)
		}
	}
	for _, expected := range []string{"agent_lifecycle_evaluate", "zjmf_stock_sync", "promotion_coupon_refund_expired", "promotion_coupon_notify_expiring", "verification_material_cleanup", "instance_real_data_collect", "recharge_maintenance", "cloud_node_health"} {
		if interval := worker.schedule[expected]; interval <= 0 {
			t.Fatalf("missing schedule for %q", expected)
		}
	}
}
