(t *testing.T)
| 730 | } |
| 731 | |
| 732 | func TestActorDisplayName(t *testing.T) { |
| 733 | tests := []struct { |
| 734 | name string |
| 735 | typeName string |
| 736 | login string |
| 737 | actName string |
| 738 | want string |
| 739 | }{ |
| 740 | {name: "copilot reviewer", typeName: "Bot", login: "copilot-pull-request-reviewer", want: "Copilot (AI)"}, |
| 741 | {name: "copilot assignee", typeName: "Bot", login: "copilot-swe-agent", want: "Copilot (AI)"}, |
| 742 | {name: "copilot without typename", typeName: "", login: "copilot-pull-request-reviewer", want: "Copilot (AI)"}, |
| 743 | {name: "copilot actor name login", typeName: "", login: "Copilot", want: "Copilot (AI)"}, |
| 744 | {name: "regular bot", typeName: "Bot", login: "dependabot", want: "dependabot"}, |
| 745 | {name: "user with name", typeName: "User", login: "octocat", actName: "Mona Lisa", want: "octocat (Mona Lisa)"}, |
| 746 | {name: "user without name", typeName: "User", login: "octocat", want: "octocat"}, |
| 747 | {name: "unknown type with name", typeName: "", login: "octocat", actName: "Mona Lisa", want: "octocat (Mona Lisa)"}, |
| 748 | {name: "empty login", typeName: "", login: "", want: ""}, |
| 749 | } |
| 750 | for _, tt := range tests { |
| 751 | t.Run(tt.name, func(t *testing.T) { |
| 752 | require.Equal(t, tt.want, actorDisplayName(tt.typeName, tt.login, tt.actName)) |
| 753 | }) |
| 754 | } |
| 755 | } |
| 756 | |
| 757 | func TestRepoExists(t *testing.T) { |
| 758 | tests := []struct { |
nothing calls this directly
no test coverage detected