(t *testing.T)
| 871 | } |
| 872 | |
| 873 | func TestBuildLabeledDisableCondition(t *testing.T) { |
| 874 | condition := buildLabeledDisableCondition() |
| 875 | rendered := RenderCondition(condition) |
| 876 | |
| 877 | // Should only include issues event (not pull_request — issues-only by design) |
| 878 | if !strings.Contains(rendered, "github.event_name == 'issues'") { |
| 879 | t.Errorf("Condition should include issues event, got: %s", rendered) |
| 880 | } |
| 881 | if strings.Contains(rendered, "github.event_name == 'pull_request'") { |
| 882 | t.Errorf("Condition must not include pull_request event (issues-only), got: %s", rendered) |
| 883 | } |
| 884 | |
| 885 | // Should check the label name |
| 886 | if !strings.Contains(rendered, "github.event.label.name == 'agentic-workflows:disable'") { |
| 887 | t.Errorf("Condition should check for agentic-workflows:disable label, got: %s", rendered) |
| 888 | } |
| 889 | |
| 890 | // Should exclude forks |
| 891 | if !strings.Contains(rendered, "github.event.repository.fork") { |
| 892 | t.Errorf("Condition should exclude forks, got: %s", rendered) |
| 893 | } |
| 894 | |
| 895 | // Should not include workflow_dispatch or schedule-related conditions |
| 896 | if strings.Contains(rendered, "workflow_dispatch") || strings.Contains(rendered, "workflow_call") { |
| 897 | t.Errorf("Condition should not reference workflow_dispatch or workflow_call, got: %s", rendered) |
| 898 | } |
| 899 | } |
| 900 | |
| 901 | func TestBuildLabeledApplySafeOutputsCondition(t *testing.T) { |
| 902 | condition := buildLabeledApplySafeOutputsCondition() |
nothing calls this directly
no test coverage detected