Skip to content

Commit 269dda0

Browse files
committed
chore: update one story
1 parent 82e3d71 commit 269dda0

File tree

1 file changed

+9
-14
lines changed

1 file changed

+9
-14
lines changed

site/src/pages/WorkspacesPage/BatchUpdateModalForm.stories.tsx

Lines changed: 9 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -152,22 +152,17 @@ export const TransitioningWorkspaces: Story = {
152152
args: { isProcessing: true },
153153
beforeEach: (ctx) => {
154154
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,
156158
);
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-
});
169159

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 };
171166
ctx.parameters.queries = queries;
172167
},
173168
};

0 commit comments

Comments
 (0)