(t *testing.T)
| 8 | ) |
| 9 | |
| 10 | func Test_codespace_displayName(t *testing.T) { |
| 11 | type fields struct { |
| 12 | Codespace *api.Codespace |
| 13 | } |
| 14 | type args struct { |
| 15 | includeOwner bool |
| 16 | } |
| 17 | tests := []struct { |
| 18 | name string |
| 19 | args args |
| 20 | fields fields |
| 21 | want string |
| 22 | }{ |
| 23 | { |
| 24 | name: "No included name or gitstatus", |
| 25 | args: args{}, |
| 26 | fields: fields{ |
| 27 | Codespace: &api.Codespace{ |
| 28 | GitStatus: api.CodespaceGitStatus{ |
| 29 | Ref: "trunk", |
| 30 | }, |
| 31 | Repository: api.Repository{ |
| 32 | FullName: "cli/cli", |
| 33 | }, |
| 34 | DisplayName: "scuba steve", |
| 35 | }, |
| 36 | }, |
| 37 | want: "cli/cli [trunk]: scuba steve", |
| 38 | }, |
| 39 | { |
| 40 | name: "No included name - included gitstatus - no unsaved changes", |
| 41 | args: args{}, |
| 42 | fields: fields{ |
| 43 | Codespace: &api.Codespace{ |
| 44 | GitStatus: api.CodespaceGitStatus{ |
| 45 | Ref: "trunk", |
| 46 | }, |
| 47 | Repository: api.Repository{ |
| 48 | FullName: "cli/cli", |
| 49 | }, |
| 50 | DisplayName: "scuba steve", |
| 51 | }, |
| 52 | }, |
| 53 | want: "cli/cli [trunk]: scuba steve", |
| 54 | }, |
| 55 | { |
| 56 | name: "No included name - included gitstatus - unsaved changes", |
| 57 | args: args{}, |
| 58 | fields: fields{ |
| 59 | Codespace: &api.Codespace{ |
| 60 | GitStatus: api.CodespaceGitStatus{ |
| 61 | Ref: "trunk", |
| 62 | HasUncommittedChanges: true, |
| 63 | }, |
| 64 | Repository: api.Repository{ |
| 65 | FullName: "cli/cli", |
| 66 | }, |
| 67 | DisplayName: "scuba steve", |
nothing calls this directly
no test coverage detected