(t *testing.T)
| 20 | ) |
| 21 | |
| 22 | func Test_NewCmdView(t *testing.T) { |
| 23 | tests := []struct { |
| 24 | name string |
| 25 | args string |
| 26 | isTTY bool |
| 27 | want ViewOptions |
| 28 | wantErr string |
| 29 | }{ |
| 30 | { |
| 31 | name: "no arguments", |
| 32 | args: "", |
| 33 | isTTY: true, |
| 34 | want: ViewOptions{ |
| 35 | ID: "", |
| 36 | WebMode: false, |
| 37 | IncludeParents: true, |
| 38 | InteractiveMode: true, |
| 39 | Organization: "", |
| 40 | }, |
| 41 | }, |
| 42 | { |
| 43 | name: "only ID", |
| 44 | args: "3", |
| 45 | isTTY: true, |
| 46 | want: ViewOptions{ |
| 47 | ID: "3", |
| 48 | WebMode: false, |
| 49 | IncludeParents: true, |
| 50 | InteractiveMode: false, |
| 51 | Organization: "", |
| 52 | }, |
| 53 | }, |
| 54 | { |
| 55 | name: "org", |
| 56 | args: "--org \"my-org\"", |
| 57 | isTTY: true, |
| 58 | want: ViewOptions{ |
| 59 | ID: "", |
| 60 | WebMode: false, |
| 61 | IncludeParents: true, |
| 62 | InteractiveMode: true, |
| 63 | Organization: "my-org", |
| 64 | }, |
| 65 | }, |
| 66 | { |
| 67 | name: "web mode", |
| 68 | args: "--web", |
| 69 | isTTY: true, |
| 70 | want: ViewOptions{ |
| 71 | ID: "", |
| 72 | WebMode: true, |
| 73 | IncludeParents: true, |
| 74 | InteractiveMode: true, |
| 75 | Organization: "", |
| 76 | }, |
| 77 | }, |
| 78 | { |
| 79 | name: "parents", |
nothing calls this directly
no test coverage detected