@@ -85,33 +85,6 @@ describe("WorkspacesPage", () => {
85
85
expect ( deleteWorkspace ) . toHaveBeenCalledWith ( workspaces [ 1 ] . id ) ;
86
86
} ) ;
87
87
88
- it ( "stops only the running and selected workspaces" , async ( ) => {
89
- const workspaces = [
90
- { ...MockWorkspace , id : "1" } ,
91
- { ...MockWorkspace , id : "2" } ,
92
- { ...MockWorkspace , id : "3" } ,
93
- ] ;
94
- jest
95
- . spyOn ( API , "getWorkspaces" )
96
- . mockResolvedValue ( { workspaces, count : workspaces . length } ) ;
97
- const stopWorkspace = jest . spyOn ( API , "stopWorkspace" ) ;
98
- const user = userEvent . setup ( ) ;
99
- renderWithAuth ( < WorkspacesPage /> ) ;
100
- await waitForLoaderToBeRemoved ( ) ;
101
-
102
- await user . click ( getWorkspaceCheckbox ( workspaces [ 0 ] ) ) ;
103
- await user . click ( getWorkspaceCheckbox ( workspaces [ 1 ] ) ) ;
104
- await user . click ( screen . getByRole ( "button" , { name : / b u l k a c t i o n s / i } ) ) ;
105
- const stopButton = await screen . findByRole ( "menuitem" , { name : / s t o p / i } ) ;
106
- await user . click ( stopButton ) ;
107
-
108
- await waitFor ( ( ) => {
109
- expect ( stopWorkspace ) . toHaveBeenCalledTimes ( 2 ) ;
110
- } ) ;
111
- expect ( stopWorkspace ) . toHaveBeenCalledWith ( workspaces [ 0 ] . id ) ;
112
- expect ( stopWorkspace ) . toHaveBeenCalledWith ( workspaces [ 1 ] . id ) ;
113
- } ) ;
114
-
115
88
describe ( "batch updates" , ( ) => {
116
89
it ( "skips up-to-date workspaces after confirming update" , async ( ) => {
117
90
const workspaces : readonly Workspace [ ] = [
@@ -251,6 +224,33 @@ describe("WorkspacesPage", () => {
251
224
} ) ;
252
225
} ) ;
253
226
227
+ it ( "stops only the running and selected workspaces" , async ( ) => {
228
+ const workspaces = [
229
+ { ...MockWorkspace , id : "1" } ,
230
+ { ...MockWorkspace , id : "2" } ,
231
+ { ...MockWorkspace , id : "3" } ,
232
+ ] ;
233
+ jest
234
+ . spyOn ( API , "getWorkspaces" )
235
+ . mockResolvedValue ( { workspaces, count : workspaces . length } ) ;
236
+ const stopWorkspace = jest . spyOn ( API , "stopWorkspace" ) ;
237
+ const user = userEvent . setup ( ) ;
238
+ renderWithAuth ( < WorkspacesPage /> ) ;
239
+ await waitForLoaderToBeRemoved ( ) ;
240
+
241
+ await user . click ( getWorkspaceCheckbox ( workspaces [ 0 ] ) ) ;
242
+ await user . click ( getWorkspaceCheckbox ( workspaces [ 1 ] ) ) ;
243
+ await user . click ( screen . getByRole ( "button" , { name : / b u l k a c t i o n s / i } ) ) ;
244
+ const stopButton = await screen . findByRole ( "menuitem" , { name : / s t o p / i } ) ;
245
+ await user . click ( stopButton ) ;
246
+
247
+ await waitFor ( ( ) => {
248
+ expect ( stopWorkspace ) . toHaveBeenCalledTimes ( 2 ) ;
249
+ } ) ;
250
+ expect ( stopWorkspace ) . toHaveBeenCalledWith ( workspaces [ 0 ] . id ) ;
251
+ expect ( stopWorkspace ) . toHaveBeenCalledWith ( workspaces [ 1 ] . id ) ;
252
+ } ) ;
253
+
254
254
it ( "starts only the stopped and selected workspaces" , async ( ) => {
255
255
const workspaces = [
256
256
{ ...MockStoppedWorkspace , id : "1" } ,
0 commit comments