@@ -3,16 +3,9 @@ import { withKnobs } from '@storybook/addon-knobs'
33import { storiesOf } from '@storybook/react'
44import React from 'react'
55import * as T from '../../typings'
6- import * as TT from '../../typings/tutorial'
76import Tutorial from '../src/containers/Tutorial'
87import SideBarDecorator from './utils/SideBarDecorator'
98
10- type ModifiedLevel = TT . Level & {
11- status : T . ProgressStatus
12- index : number
13- steps : Array < TT . Step & { status : T . ProgressStatus } >
14- }
15-
169const context : Partial < T . MachineContext > = {
1710 env : { machineId : '' , sessionId : '' , token : '' } ,
1811 error : null ,
@@ -58,26 +51,6 @@ const context: Partial<T.MachineContext> = {
5851 } ,
5952 hints : [ 'First Hint' , 'Second Hint' ] ,
6053 } ,
61- {
62- id : '1.2' ,
63- content : 'Should support markdown test\n ```js\nvar a = 1\n```\nwhew it works!' ,
64- setup : {
65- commits : [ 'abcdefg' ] ,
66- } ,
67- solution : {
68- commits : [ 'hijklmn' ] ,
69- } ,
70- } ,
71- {
72- id : '1.3' ,
73- content : 'Should support markdown test\n ```js\nvar a = 1\n```\nwhew it works!' ,
74- setup : {
75- commits : [ 'abcdefg' ] ,
76- } ,
77- solution : {
78- commits : [ 'hijklmn' ] ,
79- } ,
80- } ,
8154 ] ,
8255 } ,
8356 {
@@ -168,4 +141,12 @@ const context: Partial<T.MachineContext> = {
168141storiesOf ( 'Tutorial' , module )
169142 . addDecorator ( SideBarDecorator )
170143 . addDecorator ( withKnobs )
171- . add ( 'Example' , ( ) => < Tutorial context = { context } send = { action ( 'send' ) } /> )
144+ . add ( '1 step' , ( ) => {
145+ const firstLevel = {
146+ ...context ,
147+ position : { levelId : '1' , stepId : '1.2' } ,
148+ progress : { levels : { } , steps : { } , complete : false } ,
149+ }
150+ return < Tutorial context = { firstLevel } send = { action ( 'send' ) } />
151+ } )
152+ . add ( '3 step' , ( ) => < Tutorial context = { context } send = { action ( 'send' ) } /> )
0 commit comments