| ... | @@ -155,6 +155,46 @@ describe("vcsActionState", () => { | ... | @@ -155,6 +155,46 @@ describe("vcsActionState", () => { |
| 155 | }); | 155 | }); |
| 156 | }); | 156 | }); |
| 157 | | 157 | |
| | 158 | it("clears running presentation state once the action finishes", () => { |
| | 159 | const initial = beginVcsActionState({ |
| | 160 | operation: "run_change_request", |
| | 161 | label: "Running source control action", |
| | 162 | actionId, |
| | 163 | }); |
| | 164 | const pushing = applyVcsActionProgressEvent( |
| | 165 | initial, |
| | 166 | progress({ |
| | 167 | actionId, |
| | 168 | action, |
| | 169 | cwd, |
| | 170 | kind: "phase_started", |
| | 171 | phase: "push", |
| | 172 | label: "Pushing...", |
| | 173 | }), |
| | 174 | ); |
| | 175 | const finished = applyVcsActionProgressEvent( |
| | 176 | pushing, |
| | 177 | progress({ |
| | 178 | actionId, |
| | 179 | action, |
| | 180 | cwd, |
| | 181 | kind: "action_finished", |
| | 182 | result, |
| | 183 | }), |
| | 184 | ); |
| | 185 | |
| | 186 | expect(finished).toMatchObject({ |
| | 187 | isRunning: false, |
| | 188 | operation: "run_change_request", |
| | 189 | actionId, |
| | 190 | action, |
| | 191 | currentLabel: null, |
| | 192 | currentPhaseLabel: null, |
| | 193 | lastOutputLine: null, |
| | 194 | error: null, |
| | 195 | }); |
| | 196 | }); |
| | 197 | |
| 158 | it("retains a terminal action error for presentation", () => { | 198 | it("retains a terminal action error for presentation", () => { |
| 159 | const initial = beginVcsActionState({ | 199 | const initial = beginVcsActionState({ |
| 160 | operation: "run_change_request", | 200 | operation: "run_change_request", |