@@ -9,8 +9,6 @@ import SideBarDecorator from './utils/SideBarDecorator'
9
9
const context : Partial < T . MachineContext > = {
10
10
env : { machineId : '' , sessionId : '' , token : '' } ,
11
11
error : null ,
12
- position : { levelId : '2' , stepId : '2.2' } ,
13
- progress : { levels : { '1' : true } , steps : { '1.1' : true , '1.2' : true , '1.3' : true , '2.1' : true } , complete : false } ,
14
12
processes : [ ] ,
15
13
testStatus : null ,
16
14
tutorial : {
@@ -142,12 +140,35 @@ const context: Partial<T.MachineContext> = {
142
140
storiesOf ( 'Tutorial' , module )
143
141
. addDecorator ( SideBarDecorator )
144
142
. addDecorator ( withKnobs )
145
- . add ( '1 step ' , ( ) => {
143
+ . add ( '1.1 Start ' , ( ) => {
146
144
const firstLevel = {
147
145
...context ,
148
146
position : { levelId : '1' , stepId : '1.2' } ,
149
147
progress : { levels : { } , steps : { } , complete : false } ,
150
148
}
151
149
return < Tutorial state = "Normal" context = { firstLevel } send = { action ( 'send' ) } />
152
150
} )
153
- . add ( '3 step' , ( ) => < Tutorial state = "Normal" context = { context } send = { action ( 'send' ) } /> )
151
+ . add ( '1.3 Level Complete' , ( ) => {
152
+ const levelComplete = {
153
+ ...context ,
154
+ position : { levelId : '1' , stepId : '1.2' } ,
155
+ progress : { levels : { } , steps : { '1.1' : true } , complete : false } ,
156
+ }
157
+ return < Tutorial state = "LevelComplete" context = { levelComplete } send = { action ( 'send' ) } />
158
+ } )
159
+ . add ( '3.1 Level Start' , ( ) => {
160
+ const newLevel = {
161
+ ...context ,
162
+ position : { levelId : '1' , stepId : '1.2' } ,
163
+ progress : { levels : { '1' : true , '2' : true } , steps : { } , complete : false } ,
164
+ }
165
+ return < Tutorial state = "Normal" context = { newLevel } send = { action ( 'send' ) } />
166
+ } )
167
+ . add ( '3.3 Final' , ( ) => {
168
+ const lastLevel = {
169
+ ...context ,
170
+ position : { levelId : '3' , stepId : '3.3' } ,
171
+ progress : { levels : { '3' : true } , steps : { '3.3' : true } , complete : true } ,
172
+ }
173
+ return < Tutorial state = "LevelComplete" context = { lastLevel } send = { action ( 'send' ) } />
174
+ } )
0 commit comments