@@ -119,9 +119,9 @@ func TestAdminWorkspaces_List(t *testing.T) {
119
119
assert .Equal (t , wl .Items [0 ].CurrentRun .ID , run .ID )
120
120
})
121
121
122
- t .Run ("when sorting on known workspace name " , func (t * testing.T ) {
122
+ t .Run ("when sorting by workspace names " , func (t * testing.T ) {
123
123
wl , err := client .Admin .Workspaces .List (ctx , & AdminWorkspaceListOptions {
124
- Sort : wTest1 . Name ,
124
+ Sort : "name" ,
125
125
})
126
126
require .NoError (t , err )
127
127
require .NotEmpty (t , wl .Items )
@@ -130,13 +130,21 @@ func TestAdminWorkspaces_List(t *testing.T) {
130
130
131
131
t .Run ("when sorting workspaces on current-run.created-at" , func (t * testing.T ) {
132
132
wl , err := client .Admin .Workspaces .List (ctx , & AdminWorkspaceListOptions {
133
- Sort : wTest1 . CurrentRun . CreatedAt . String () ,
133
+ Sort : "current-run.created-at" ,
134
134
})
135
135
require .NoError (t , err )
136
136
require .NotEmpty (t , wl .Items )
137
+ assert .NotEmpty (t , wl .Items [0 ].CurrentRun .CreatedAt )
137
138
})
138
139
139
- t .Run ("when filtering workspaces on a current run status" , func (t * testing.T ) {})
140
+ t .Run ("when filtering workspaces on a current run status" , func (t * testing.T ) {
141
+ wl , err := client .Admin .Workspaces .List (ctx , & AdminWorkspaceListOptions {
142
+ Filter : "planning" ,
143
+ })
144
+ require .NoError (t , err )
145
+ require .NotEmpty (t , wl .Items )
146
+ assert .Equal (t , wl .Items [0 ].CurrentRun , RunPlanning )
147
+ })
140
148
}
141
149
142
150
func TestAdminWorkspaces_Read (t * testing.T ) {
0 commit comments