|
1 | 1 | import React from 'react' |
| 2 | +import * as G from '../../typings/graphql' |
2 | 3 |
|
3 | | -import { object, withKnobs } from '@storybook/addon-knobs' |
4 | 4 | import { action } from '@storybook/addon-actions' |
5 | | -import { linkTo } from '@storybook/addon-links' |
| 5 | +import { object, withKnobs } from '@storybook/addon-knobs' |
6 | 6 | import { storiesOf } from '@storybook/react' |
7 | 7 | import SideBarDecorator from './utils/SideBarDecorator' |
8 | 8 |
|
9 | | -import apolloProvider from './utils/ApolloDecorator' |
10 | | -import Level from '../src/containers/Tutorial/LevelPage/Level' |
11 | | -import LevelSummaryPageContainer, { LevelSummaryPage } from '../src/containers/Tutorial/LevelPage' |
| 9 | +import Level from '../src/containers/Tutorial/LevelPage/Level/index' |
12 | 10 |
|
13 | 11 | storiesOf('Tutorial SideBar', module) |
14 | 12 | .addDecorator(SideBarDecorator) |
15 | 13 | .addDecorator(withKnobs) |
16 | | - .add('Level', () => ( |
17 | | - <Level |
18 | | - level={object('level', { |
19 | | - id: '1', |
20 | | - title: 'Sum Level', |
21 | | - text: 'A description of this stage', |
22 | | - stages: [ |
23 | | - { |
24 | | - id: '1', |
25 | | - title: 'First', |
26 | | - text: 'some description', |
27 | | - status: 'COMPLETED', |
| 14 | + .add('Level', () => { |
| 15 | + const level: G.Level = { |
| 16 | + id: 'L1', |
| 17 | + title: 'A Title', |
| 18 | + description: 'Some description', |
| 19 | + setup: null, |
| 20 | + status: 'ACTIVE', |
| 21 | + steps: [ |
| 22 | + { |
| 23 | + id: 'L1:S1', |
| 24 | + title: 'First Step', |
| 25 | + description: 'First step description', |
| 26 | + setup: { |
| 27 | + id: 'L1:S1:SETUP', |
| 28 | + commits: ['abcdefg'], |
28 | 29 | }, |
29 | | - { |
30 | | - id: '2', |
31 | | - title: 'Second', |
32 | | - text: 'The second one', |
33 | | - status: 'ACTIVE', |
| 30 | + solution: { |
| 31 | + id: 'L1:S1:SOLUTION', |
| 32 | + commits: ['hijklmn'], |
34 | 33 | }, |
35 | | - { |
36 | | - id: '3', |
37 | | - title: 'Third', |
38 | | - text: 'The third one', |
39 | | - status: 'INCOMPLETE', |
| 34 | + status: 'COMPLETE', |
| 35 | + }, |
| 36 | + { |
| 37 | + id: 'L1:S2', |
| 38 | + title: 'Second Step', |
| 39 | + description: 'Second step description', |
| 40 | + setup: { |
| 41 | + id: 'L1:S2:SETUP', |
| 42 | + commits: ['abcdefg'], |
40 | 43 | }, |
41 | | - ], |
42 | | - })} |
43 | | - onNext={linkTo('Tutorial SideBar', 'Stage')} |
44 | | - onBack={linkTo('TUtorial SideBar', 'Summary')} |
45 | | - /> |
46 | | - )) |
47 | | - .add('Level Summary', () => { |
48 | | - return ( |
49 | | - <LevelSummaryPage |
50 | | - send={action('send')} |
51 | | - level={{ |
52 | | - id: '1', |
53 | | - title: 'Sum Level', |
54 | | - text: 'A description of this stage', |
55 | | - stages: [ |
56 | | - { |
57 | | - id: '1', |
58 | | - title: 'First', |
59 | | - text: 'some description', |
60 | | - status: 'COMPLETE', |
61 | | - }, |
62 | | - { |
63 | | - id: '2', |
64 | | - title: 'Second', |
65 | | - text: 'The second one', |
66 | | - status: 'ACTIVE', |
67 | | - }, |
68 | | - { |
69 | | - id: '3', |
70 | | - title: 'Third', |
71 | | - text: 'The third one', |
72 | | - status: 'INCOMPLETE', |
73 | | - }, |
74 | | - ], |
75 | | - }} |
76 | | - /> |
77 | | - ) |
78 | | - }) |
79 | | - .addDecorator(apolloProvider) |
80 | | - .add('Level Summary Container', () => { |
81 | | - return <LevelSummaryPageContainer send={action('send')} /> |
| 44 | + solution: { |
| 45 | + id: 'L1:S2:SOLUTION', |
| 46 | + commits: ['hijklmn'], |
| 47 | + }, |
| 48 | + status: 'ACTIVE', |
| 49 | + }, |
| 50 | + { |
| 51 | + id: 'L1:S3', |
| 52 | + title: 'Third Step', |
| 53 | + description: 'Third step description', |
| 54 | + setup: { |
| 55 | + id: 'L1:S3:SETUP', |
| 56 | + commits: ['abcdefg'], |
| 57 | + }, |
| 58 | + solution: { |
| 59 | + id: 'L1:S3:SOLUTION', |
| 60 | + commits: ['hijklmn'], |
| 61 | + }, |
| 62 | + status: 'INCOMPLETE', |
| 63 | + }, |
| 64 | + ], |
| 65 | + } |
| 66 | + return <Level level={level} onContinue={action('onContinue')} onLoadSolution={action('onLoadSolution')} /> |
82 | 67 | }) |
0 commit comments