(t *testing.T)
| 69 | } |
| 70 | |
| 71 | func TestGetSecretApp(t *testing.T) { |
| 72 | tests := []struct { |
| 73 | name string |
| 74 | app string |
| 75 | entity SecretEntity |
| 76 | want App |
| 77 | wantErr bool |
| 78 | }{ |
| 79 | { |
| 80 | name: "Actions", |
| 81 | app: "actions", |
| 82 | want: Actions, |
| 83 | }, |
| 84 | { |
| 85 | name: "Agents", |
| 86 | app: "agents", |
| 87 | want: Agents, |
| 88 | }, |
| 89 | { |
| 90 | name: "Codespaces", |
| 91 | app: "codespaces", |
| 92 | want: Codespaces, |
| 93 | }, |
| 94 | { |
| 95 | name: "Dependabot", |
| 96 | app: "dependabot", |
| 97 | want: Dependabot, |
| 98 | }, |
| 99 | { |
| 100 | name: "Defaults to Actions for repository", |
| 101 | app: "", |
| 102 | entity: Repository, |
| 103 | want: Actions, |
| 104 | }, |
| 105 | { |
| 106 | name: "Defaults to Actions for organization", |
| 107 | app: "", |
| 108 | entity: Organization, |
| 109 | want: Actions, |
| 110 | }, |
| 111 | { |
| 112 | name: "Defaults to Actions for environment", |
| 113 | app: "", |
| 114 | entity: Environment, |
| 115 | want: Actions, |
| 116 | }, |
| 117 | { |
| 118 | name: "Defaults to Codespaces for user", |
| 119 | app: "", |
| 120 | entity: User, |
| 121 | want: Codespaces, |
| 122 | }, |
| 123 | { |
| 124 | name: "Unknown for invalid apps", |
| 125 | app: "invalid", |
| 126 | want: Unknown, |
| 127 | wantErr: true, |
| 128 | }, |
nothing calls this directly
no test coverage detected