MCPcopy Index your code
hub / github.com/cli/cli / TestActorDisplayName

Function TestActorDisplayName

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

Source from the content-addressed store, hash-verified

730}
731
732func 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
757func TestRepoExists(t *testing.T) {
758 tests := []struct {

Callers

nothing calls this directly

Calls 3

actorDisplayNameFunction · 0.85
EqualMethod · 0.80
RunMethod · 0.65

Tested by

no test coverage detected