(t *testing.T)
| 21 | } |
| 22 | |
| 23 | func TestDeleteSchemaFileCodemod_NoChanges(t *testing.T) { |
| 24 | codemod := getDeleteSchemaFileCodemod() |
| 25 | |
| 26 | content := `--- |
| 27 | on: workflow_dispatch |
| 28 | permissions: |
| 29 | contents: read |
| 30 | --- |
| 31 | |
| 32 | # Test Workflow |
| 33 | |
| 34 | This workflow doesn't need any changes.` |
| 35 | |
| 36 | frontmatter := map[string]any{ |
| 37 | "on": "workflow_dispatch", |
| 38 | "permissions": map[string]any{ |
| 39 | "contents": "read", |
| 40 | }, |
| 41 | } |
| 42 | |
| 43 | result, applied, err := codemod.Apply(content, frontmatter) |
| 44 | |
| 45 | require.NoError(t, err, "Apply should not return an error") |
| 46 | assert.False(t, applied, "Codemod should not report changes (handled by fix command)") |
| 47 | assert.Equal(t, content, result, "Content should remain unchanged") |
| 48 | } |
| 49 | |
| 50 | func TestDeleteSchemaFileCodemod_AlwaysReturnsUnchanged(t *testing.T) { |
| 51 | // This codemod doesn't modify workflow files - the fix command handles the file deletion |
nothing calls this directly
no test coverage detected