1 | import parse from './index.js'
|
2 |
|
3 | test('#parse', () => {
|
4 | VIEWS.forEach(view => expect(parse(view)).toMatchSnapshot())
|
5 |
|
6 | expect(parse(WARNING)).toMatchSnapshot()
|
7 | })
|
8 |
|
9 | const VIEWS = [
|
10 | `Main Vertical`,
|
11 |
|
12 | `Main Vertical
|
13 | Text`,
|
14 |
|
15 | `BlueButton Vertical
|
16 | Before Text
|
17 | Nested Vertical
|
18 | ImageInside Image
|
19 | source https://image.com/file.jpg
|
20 | VerticalInside Vertical
|
21 |
|
22 |
|
23 | After Text
|
24 | text after
|
25 | color purple
|
26 | when hover
|
27 | color red
|
28 | Last Vertical
|
29 | backgroundColor blue`,
|
30 |
|
31 |
|
32 |
|
33 | `A Vertical
|
34 | A1 Text
|
35 | color red
|
36 | A2 Text
|
37 | color white`,
|
38 |
|
39 | `Vertical
|
40 | backgroundColor props.backgroundColor
|
41 | onClick event => props.onClick(props.name, event)
|
42 | Title Text
|
43 | color props.some.thing || 'red'
|
44 | marginLeft props.marginLeft
|
45 | text props.some.prop
|
46 | CaptureText
|
47 | onFocus props.onFocus
|
48 | List
|
49 | from props.stuff
|
50 | when props.stuff.length > 0
|
51 | Stuff`,
|
52 | ]
|
53 |
|
54 | const WARNING = `Warning Vertical
|
55 | EmptyWhen Vertical
|
56 | color blue
|
57 | when
|
58 | color red
|
59 | when props. stuff
|
60 | backgroundColor purple
|
61 | color green`
|