MCPcopy
hub / github.com/cli/cli / Test_listHeader

Function Test_listHeader

pkg/cmd/pr/shared/display_test.go:11–98  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

9)
10
11func Test_listHeader(t *testing.T) {
12 type args struct {
13 repoName string
14 itemName string
15 matchCount int
16 totalMatchCount int
17 hasFilters bool
18 }
19 tests := []struct {
20 name string
21 args args
22 want string
23 }{
24 {
25 name: "one result",
26 args: args{
27 repoName: "REPO",
28 itemName: "genie",
29 matchCount: 1,
30 totalMatchCount: 23,
31 hasFilters: false,
32 },
33 want: "Showing 1 of 23 open genies in REPO",
34 },
35 {
36 name: "one result after filters",
37 args: args{
38 repoName: "REPO",
39 itemName: "tiny cup",
40 matchCount: 1,
41 totalMatchCount: 23,
42 hasFilters: true,
43 },
44 want: "Showing 1 of 23 tiny cups in REPO that match your search",
45 },
46 {
47 name: "one result in total",
48 args: args{
49 repoName: "REPO",
50 itemName: "chip",
51 matchCount: 1,
52 totalMatchCount: 1,
53 hasFilters: false,
54 },
55 want: "Showing 1 of 1 open chip in REPO",
56 },
57 {
58 name: "one result in total after filters",
59 args: args{
60 repoName: "REPO",
61 itemName: "spicy noodle",
62 matchCount: 1,
63 totalMatchCount: 1,
64 hasFilters: true,
65 },
66 want: "Showing 1 of 1 spicy noodle in REPO that matches your search",
67 },
68 {

Callers

nothing calls this directly

Calls 3

ListHeaderFunction · 0.85
RunMethod · 0.65
ErrorfMethod · 0.65

Tested by

no test coverage detected