(t *testing.T)
| 813 | } |
| 814 | |
| 815 | func TestActorDisplayName(t *testing.T) { |
| 816 | tests := []struct { |
| 817 | name string |
| 818 | typeName string |
| 819 | login string |
| 820 | actName string |
| 821 | want string |
| 822 | }{ |
| 823 | {name: "copilot reviewer", typeName: "Bot", login: "copilot-pull-request-reviewer", want: "Copilot (AI)"}, |
| 824 | {name: "copilot assignee", typeName: "Bot", login: "copilot-swe-agent", want: "Copilot (AI)"}, |
| 825 | {name: "copilot without typename", typeName: "", login: "copilot-pull-request-reviewer", want: "Copilot (AI)"}, |
| 826 | {name: "copilot actor name login", typeName: "", login: "Copilot", want: "Copilot (AI)"}, |
| 827 | {name: "regular bot", typeName: "Bot", login: "dependabot", want: "dependabot"}, |
| 828 | {name: "user with name", typeName: "User", login: "octocat", actName: "Mona Lisa", want: "octocat (Mona Lisa)"}, |
| 829 | {name: "user without name", typeName: "User", login: "octocat", want: "octocat"}, |
| 830 | {name: "unknown type with name", typeName: "", login: "octocat", actName: "Mona Lisa", want: "octocat (Mona Lisa)"}, |
| 831 | {name: "empty login", typeName: "", login: "", want: ""}, |
| 832 | } |
| 833 | for _, tt := range tests { |
| 834 | t.Run(tt.name, func(t *testing.T) { |
| 835 | require.Equal(t, tt.want, actorDisplayName(tt.typeName, tt.login, tt.actName)) |
| 836 | }) |
| 837 | } |
| 838 | } |
| 839 | |
| 840 | func TestRepoExists(t *testing.T) { |
| 841 | tests := []struct { |
nothing calls this directly
no test coverage detected