@@ -3,16 +3,9 @@ import { withKnobs } from '@storybook/addon-knobs'
3
3
import { storiesOf } from '@storybook/react'
4
4
import React from 'react'
5
5
import * as T from '../../typings'
6
- import * as TT from '../../typings/tutorial'
7
6
import Tutorial from '../src/containers/Tutorial'
8
7
import SideBarDecorator from './utils/SideBarDecorator'
9
8
10
- type ModifiedLevel = TT . Level & {
11
- status :T . ProgressStatus
12
- index :number
13
- steps :Array < TT . Step & { status :T . ProgressStatus } >
14
- }
15
-
16
9
const context :Partial < T . MachineContext > = {
17
10
env :{ machineId :'' , sessionId :'' , token :'' } ,
18
11
error :null ,
@@ -58,26 +51,6 @@ const context: Partial<T.MachineContext> = {
58
51
} ,
59
52
hints :[ 'First Hint' , 'Second Hint' ] ,
60
53
} ,
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
- } ,
81
54
] ,
82
55
} ,
83
56
{
@@ -168,4 +141,12 @@ const context: Partial<T.MachineContext> = {
168
141
storiesOf ( 'Tutorial' , module )
169
142
. addDecorator ( SideBarDecorator )
170
143
. 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' ) } /> )