MCPcopy Create free account
hub / github.com/github/gh-aw / TestDeleteSchemaFileCodemod_NoChanges

Function TestDeleteSchemaFileCodemod_NoChanges

pkg/cli/codemod_schema_file_test.go:23–48  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

21}
22
23func TestDeleteSchemaFileCodemod_NoChanges(t *testing.T) {
24 codemod := getDeleteSchemaFileCodemod()
25
26 content := `---
27on: workflow_dispatch
28permissions:
29 contents: read
30---
31
32# Test Workflow
33
34This 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
50func TestDeleteSchemaFileCodemod_AlwaysReturnsUnchanged(t *testing.T) {
51 // This codemod doesn't modify workflow files - the fix command handles the file deletion

Callers

nothing calls this directly

Calls 1

Tested by

no test coverage detected