File tree Expand file tree Collapse file tree 3 files changed +11
-9
lines changed
web-app/src/services/state/actions Expand file tree Collapse file tree 3 files changed +11
-9
lines changed Original file line number Diff line number Diff line change @@ -22,7 +22,8 @@ class Channel implements Channel {
2222 console . log ( 'RECEIVED:' , actionType )
2323 switch ( actionType ) {
2424 case 'TEST_RUN' :
25- vscode . commands . executeCommand ( 'coderoad.run_test' )
25+
26+ vscode . commands . executeCommand ( 'coderoad.run_test' , action . payload )
2627 return
2728 case 'TUTORIAL_CONFIG' :
2829 tutorialConfig ( action . payload )
Original file line number Diff line number Diff line change @@ -52,22 +52,26 @@ export const createCommands = ({vscodeExt}: CreateCommandProps) => {
5252
5353 webview . createOrShow ( column )
5454 } ,
55- [ COMMANDS . RUN_TEST ] : ( ) => {
55+ [ COMMANDS . RUN_TEST ] : ( { stepId } : { stepId : string } ) => {
5656 console . log ( 'run test webview' , Object . keys ( webview ) )
5757 runTest ( {
5858 onSuccess : ( ) => {
5959 console . log ( 'COMMAND TEST_PASS' )
60- webview . send ( { type : 'TEST_PASS' } )
60+ webview . send ( { type : 'TEST_PASS' , payload : { stepId } } )
6161 vscode . window . showInformationMessage ( 'PASS' )
6262 } ,
6363 onFail : ( ) => {
6464 console . log ( 'COMMAND TEST_FAIL' )
65- webview . send ( { type : 'TEST_FAIL' } )
65+ webview . send ( { type : 'TEST_FAIL' , payload : { stepId } } )
6666 vscode . window . showWarningMessage ( 'FAIL' )
6767 } ,
68+ onError : ( ) => {
69+ console . log ( 'COMMAND TEST_ERROR' )
70+ webview . send ( { type : 'TEST_ERROR' , payload : [ stepId ] } )
71+ } ,
6872 onRun : ( ) => {
6973 console . log ( 'COMMAND TEST_RUN' )
70- webview . send ( { type : 'TEST_RUN' } )
74+ webview . send ( { type : 'TEST_RUN' , payload : { stepId } } )
7175 }
7276 } )
7377 } ,
Original file line number Diff line number Diff line change @@ -104,13 +104,10 @@ export default {
104104 // @ts -ignore
105105 updateStepProgress : assign ( {
106106 progress : ( context : CR . MachineContext , event : CR . MachineEvent ) : CR . Progress => {
107-
108107 // update progress by tracking completed
109108 const currentProgress : CR . Progress = context . progress
110109
111- // TODO: should use event id, to verify not multiple successes jumping one
112- // const stepId = event.payload.stepId
113- const { stepId} = context . position
110+ const { stepId} = event . payload
114111
115112 currentProgress . steps [ stepId ] = true
116113
You can’t perform that action at this time.
0 commit comments