MCPcopy Create free account
hub / github.com/cli/cli / TestActorDisplayName

Function TestActorDisplayName

api/queries_repo_test.go:826–849  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

824}
825
826func 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
851func TestRepoExists(t *testing.T) {
852 tests := []struct {

Callers

nothing calls this directly

Calls 3

actorDisplayNameFunction · 0.85
EqualMethod · 0.80
RunMethod · 0.65

Tested by

no test coverage detected