(t *testing.T)
| 914 | } |
| 915 | |
| 916 | func TestPromptForConfigurationFrom_Basic(t *testing.T) { |
| 917 | // Simulate non-TTY input: trigger=1, engine=1, tools=1,2, safe-outputs="" (blank), |
| 918 | // network=1, intent="This is a test workflow description with at least 20 chars" |
| 919 | input := "1\n1\n1,2\n\n1\nThis is a test workflow description with at least 20 chars\n" |
| 920 | b := &InteractiveWorkflowBuilder{} |
| 921 | err := b.promptForConfigurationFrom(strings.NewReader(input)) |
| 922 | if err != nil { |
| 923 | t.Fatalf("unexpected error: %v", err) |
| 924 | } |
| 925 | if b.Trigger != "workflow_dispatch" { |
| 926 | t.Errorf("Trigger = %q, want workflow_dispatch", b.Trigger) |
| 927 | } |
| 928 | if b.Engine != "copilot" { |
| 929 | t.Errorf("Engine = %q, want copilot", b.Engine) |
| 930 | } |
| 931 | if len(b.Tools) != 2 || b.Tools[0] != "github" || b.Tools[1] != "edit" { |
| 932 | t.Errorf("Tools = %v, want [github edit]", b.Tools) |
| 933 | } |
| 934 | if len(b.SafeOutputs) != 0 { |
| 935 | t.Errorf("SafeOutputs = %v, want empty", b.SafeOutputs) |
| 936 | } |
| 937 | if b.Intent == "" { |
| 938 | t.Error("Intent should not be empty") |
| 939 | } |
| 940 | } |
| 941 | |
| 942 | func TestPromptForConfigurationFrom_ByValue(t *testing.T) { |
| 943 | // Use values instead of numbers for engine and tools |
nothing calls this directly
no test coverage detected