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

Function TestActorDisplayName

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

Source from the content-addressed store, hash-verified

813}
814
815func 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
840func TestRepoExists(t *testing.T) {
841 tests := []struct {

Callers

nothing calls this directly

Calls 3

actorDisplayNameFunction · 0.85
EqualMethod · 0.80
RunMethod · 0.65

Tested by

no test coverage detected