(t *testing.T)
| 122 | } |
| 123 | |
| 124 | func TestLabelRelease(t *testing.T) { |
| 125 | t.Parallel() |
| 126 | |
| 127 | t.Run("public repo with no draft is trusted and public", func(t *testing.T) { |
| 128 | t.Parallel() |
| 129 | label := LabelRelease(false, false) |
| 130 | assert.Equal(t, IntegrityTrusted, label.Integrity) |
| 131 | assert.Equal(t, ConfidentialityPublic, label.Confidentiality) |
| 132 | }) |
| 133 | |
| 134 | t.Run("public repo with a draft release is private", func(t *testing.T) { |
| 135 | t.Parallel() |
| 136 | // Draft releases are visible only to push-access users, so a draft on |
| 137 | // a public repo must not be labeled public. |
| 138 | label := LabelRelease(false, true) |
| 139 | assert.Equal(t, IntegrityTrusted, label.Integrity) |
| 140 | assert.Equal(t, ConfidentialityPrivate, label.Confidentiality) |
| 141 | }) |
| 142 | |
| 143 | t.Run("private repo is private regardless of draft", func(t *testing.T) { |
| 144 | t.Parallel() |
| 145 | for _, hasDraft := range []bool{false, true} { |
| 146 | label := LabelRelease(true, hasDraft) |
| 147 | assert.Equal(t, IntegrityTrusted, label.Integrity) |
| 148 | assert.Equal(t, ConfidentialityPrivate, label.Confidentiality) |
| 149 | } |
| 150 | }) |
| 151 | } |
| 152 | |
| 153 | func TestLabelCollaboratorRoster(t *testing.T) { |
| 154 | t.Parallel() |
nothing calls this directly
no test coverage detected