droboticflow/internal/domain/capture_mode_test.go
2026-09-08 18:29:26 +08:00

20 lines
799 B
Go

package domain
import "testing"
func TestInitialCaptureAutomationIsPausedAndUnbound(t *testing.T) {
c := InitialCaptureAutomation(WorkflowTypeStreaming, nil)
if c == nil || c.Enabled || c.Prefix != "" || c.ConnectionID != "" || c.Bucket != "" {
t.Fatalf("a template instance must not inherit or start a listener: %#v", c)
}
if c.ManifestName != "source-manifest.json" || c.CompletionMode != "required_files" || c.StabilityWindowSeconds != 30 || c.PollIntervalSeconds != 30 {
t.Fatalf("unexpected admission defaults: %#v", c)
}
if InitialCaptureAutomation(WorkflowTypeBatch, nil) != nil {
t.Fatal("batch workflows must stay manual")
}
if InitialCaptureAutomation(WorkflowTypeStreaming, &WorkflowSchedule{Interval: 30}) != nil {
t.Fatal("preserve existing scheduled workflows")
}
}