File tree Expand file tree Collapse file tree 1 file changed +9
-14
lines changed
site/src/pages/WorkspacesPage Expand file tree Collapse file tree 1 file changed +9
-14
lines changed Original file line number Diff line number Diff line change @@ -152,22 +152,17 @@ export const TransitioningWorkspaces: Story = {
152
152
args : { isProcessing : true } ,
153
153
beforeEach : ( ctx ) => {
154
154
const { workspaces, queries } = createPatchedDependencies (
155
- 2 * ACTIVE_BUILD_STATUSES . length ,
155
+ // Adding one extra so that we still have a stopped workspace at the
156
+ // end of the list
157
+ 1 + ACTIVE_BUILD_STATUSES . length ,
156
158
) ;
157
- const withUpdatedStatuses = workspaces . map < Workspace > ( ( ws , i ) => {
158
- if ( i % 2 === 0 ) {
159
- return ws ;
160
- }
161
- return {
162
- ...ws ,
163
- latest_build : {
164
- ...ws . latest_build ,
165
- status : ACTIVE_BUILD_STATUSES [ i % ACTIVE_BUILD_STATUSES . length ] ,
166
- } ,
167
- } ;
168
- } ) ;
169
159
170
- ctx . args = { ...ctx . args , workspacesToUpdate : withUpdatedStatuses } ;
160
+ for ( const [ i , status ] of ACTIVE_BUILD_STATUSES . entries ( ) ) {
161
+ const mutable = workspaces [ i ] as MutableWorkspace ;
162
+ mutable . latest_build . status = status ;
163
+ }
164
+
165
+ ctx . args = { ...ctx . args , workspacesToUpdate : workspaces } ;
171
166
ctx . parameters . queries = queries ;
172
167
} ,
173
168
} ;
You can’t perform that action at this time.
0 commit comments