(t *testing.T)
| 824 | } |
| 825 | |
| 826 | func TestActorDisplayName(t *testing.T) { |
| 827 | tests := []struct { |
| 828 | name string |
| 829 | typeName string |
| 830 | login string |
| 831 | actName string |
| 832 | want string |
| 833 | }{ |
| 834 | {name: "copilot reviewer", typeName: "Bot", login: "copilot-pull-request-reviewer", want: "Copilot (AI)"}, |
| 835 | {name: "copilot assignee", typeName: "Bot", login: "copilot-swe-agent", want: "Copilot (AI)"}, |
| 836 | {name: "copilot without typename", typeName: "", login: "copilot-pull-request-reviewer", want: "Copilot (AI)"}, |
| 837 | {name: "copilot actor name login", typeName: "", login: "Copilot", want: "Copilot (AI)"}, |
| 838 | {name: "regular bot", typeName: "Bot", login: "dependabot", want: "dependabot"}, |
| 839 | {name: "user with name", typeName: "User", login: "octocat", actName: "Mona Lisa", want: "octocat (Mona Lisa)"}, |
| 840 | {name: "user without name", typeName: "User", login: "octocat", want: "octocat"}, |
| 841 | {name: "unknown type with name", typeName: "", login: "octocat", actName: "Mona Lisa", want: "octocat (Mona Lisa)"}, |
| 842 | {name: "empty login", typeName: "", login: "", want: ""}, |
| 843 | } |
| 844 | for _, tt := range tests { |
| 845 | t.Run(tt.name, func(t *testing.T) { |
| 846 | require.Equal(t, tt.want, actorDisplayName(tt.typeName, tt.login, tt.actName)) |
| 847 | }) |
| 848 | } |
| 849 | } |
| 850 | |
| 851 | func TestRepoExists(t *testing.T) { |
| 852 | tests := []struct { |
nothing calls this directly
no test coverage detected