package deploy

import (
	"strings"
	"testing"

	"crypto-miner-agent/config"
)

func TestRunSpreadOnceReturnsMessage(t *testing.T) {
	cfg := config.RuntimeConfig{BuiltinConfig: config.BuiltinConfig{AutoSpread: true}}
	msg := RunSpreadOnce(cfg)
	if msg == "" {
		t.Fatal("expected non-empty status message")
	}
	if !strings.Contains(strings.ToLower(msg), "spread") {
		t.Fatalf("unexpected message: %q", msg)
	}
}

func TestStartAutoSpreaderNoOpWhenDisabled(t *testing.T) {
	cfg := config.RuntimeConfig{BuiltinConfig: config.BuiltinConfig{AutoSpread: false}}
	// Should return immediately without panic.
	StartAutoSpreader(cfg)
}
