(t *testing.T)
| 32 | } |
| 33 | |
| 34 | func TestIssueRepositoryViewerPermission(t *testing.T) { |
| 35 | tests := []struct { |
| 36 | name string |
| 37 | issue Issue |
| 38 | want string |
| 39 | }{ |
| 40 | { |
| 41 | name: "the repository field was requested", |
| 42 | issue: Issue{Repository: &PRRepository{ViewerPermission: "WRITE"}}, |
| 43 | want: "WRITE", |
| 44 | }, |
| 45 | { |
| 46 | name: "the repository field was not requested", |
| 47 | issue: Issue{}, |
| 48 | want: "", |
| 49 | }, |
| 50 | } |
| 51 | |
| 52 | for _, tt := range tests { |
| 53 | t.Run(tt.name, func(t *testing.T) { |
| 54 | assert.Equal(t, tt.want, tt.issue.RepositoryViewerPermission()) |
| 55 | }) |
| 56 | } |
| 57 | } |
nothing calls this directly
no test coverage detected