MCPcopy
hub / github.com/cli/cli / TestNewCmdView

Function TestNewCmdView

pkg/cmd/workflow/view/view_test.go:21–163  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

19)
20
21func TestNewCmdView(t *testing.T) {
22 tests := []struct {
23 name string
24 cli string
25 tty bool
26 wants ViewOptions
27 wantsErr bool
28 }{
29 {
30 name: "blank tty",
31 tty: true,
32 wants: ViewOptions{
33 Prompt: true,
34 },
35 },
36 {
37 name: "blank nontty",
38 wantsErr: true,
39 },
40 {
41 name: "arg tty",
42 cli: "123",
43 tty: true,
44 wants: ViewOptions{
45 Selector: "123",
46 },
47 },
48 {
49 name: "arg nontty",
50 cli: "123",
51 wants: ViewOptions{
52 Selector: "123",
53 Raw: true,
54 },
55 },
56 {
57 name: "web tty",
58 cli: "--web",
59 tty: true,
60 wants: ViewOptions{
61 Prompt: true,
62 Web: true,
63 },
64 },
65 {
66 name: "web nontty",
67 cli: "-w 123",
68 wants: ViewOptions{
69 Raw: true,
70 Web: true,
71 Selector: "123",
72 },
73 },
74 {
75 name: "yaml tty",
76 cli: "--yaml",
77 tty: true,
78 wants: ViewOptions{

Callers

nothing calls this directly

Calls 7

TestFunction · 0.92
SetStdinTTYMethod · 0.80
SetStdoutTTYMethod · 0.80
EqualMethod · 0.80
NewCmdViewFunction · 0.70
RunMethod · 0.65
ErrorMethod · 0.45

Tested by

no test coverage detected