(t *testing.T)
| 3 | import "testing" |
| 4 | |
| 5 | func TestWorkspaceDisplayStatus(t *testing.T) { |
| 6 | t.Parallel() |
| 7 | tests := []struct { |
| 8 | name string |
| 9 | jobStatus ProvisionerJobStatus |
| 10 | transition WorkspaceTransition |
| 11 | want string |
| 12 | }{ |
| 13 | { |
| 14 | name: "SucceededStatusWithStartTransition", |
| 15 | jobStatus: ProvisionerJobSucceeded, |
| 16 | transition: WorkspaceTransitionStart, |
| 17 | want: "Started", |
| 18 | }, |
| 19 | { |
| 20 | name: "SucceededStatusWithStopTransition", |
| 21 | jobStatus: ProvisionerJobSucceeded, |
| 22 | transition: WorkspaceTransitionStop, |
| 23 | want: "Stopped", |
| 24 | }, |
| 25 | { |
| 26 | name: "SucceededStatusWithDeleteTransition", |
| 27 | jobStatus: ProvisionerJobSucceeded, |
| 28 | transition: WorkspaceTransitionDelete, |
| 29 | want: "Deleted", |
| 30 | }, |
| 31 | { |
| 32 | name: "RunningStatusWithStartTransition", |
| 33 | jobStatus: ProvisionerJobRunning, |
| 34 | transition: WorkspaceTransitionStart, |
| 35 | want: "Starting", |
| 36 | }, |
| 37 | { |
| 38 | name: "RunningStatusWithStopTransition", |
| 39 | jobStatus: ProvisionerJobRunning, |
| 40 | transition: WorkspaceTransitionStop, |
| 41 | want: "Stopping", |
| 42 | }, |
| 43 | { |
| 44 | name: "RunningStatusWithDeleteTransition", |
| 45 | jobStatus: ProvisionerJobRunning, |
| 46 | transition: WorkspaceTransitionDelete, |
| 47 | want: "Deleting", |
| 48 | }, |
| 49 | { |
| 50 | name: "PendingStatusWithStartTransition", |
| 51 | jobStatus: ProvisionerJobPending, |
| 52 | transition: WorkspaceTransitionStart, |
| 53 | want: "Queued", |
| 54 | }, |
| 55 | { |
| 56 | name: "CancelingStatusWithStartTransition", |
| 57 | jobStatus: ProvisionerJobCanceling, |
| 58 | transition: WorkspaceTransitionStart, |
| 59 | want: "Canceling", |
| 60 | }, |
| 61 | { |
| 62 | name: "CanceledStatusWithStartTransition", |
nothing calls this directly
no test coverage detected