git.iko.soy/typeable/elm-ui
on master help sign in
adjust tests to be mor sensitive to text wrapping
d5c8a94Elm UI Automation
tests-rendering/src/Testable.elm+6−3
@@ -162,6 +162,9 @@ type LayoutContext
162 | InRow
162 | InRow
163 | InEl
163 | InEl
164 | InColumn
164 | InColumn
165+ | InParagraph
166+ | InTextCol
167+ | AtRoot
165
168
166
169
167type alias Surroundings msg =
170type alias Surroundings msg =
@@ -491,7 +494,7 @@ runTests harvested el =
491 , parentSpacing = 0
494 , parentSpacing = 0
492 , level = [ 0, 0 ]
495 , level = [ 0, 0 ]
493 , element = el
496 , element = el
494− , location = InEl
497+ , location = AtRoot
495 }
498 }
496
499
497
500
@@ -590,10 +593,10 @@ createTest { siblings, parent, cache, level, element, location, parentSpacing }
590 InColumn
593 InColumn
591
594
592 TextColumn _ _ ->
595 TextColumn _ _ ->
593− InColumn
596+ InTextCol
594
597
595 Paragraph _ _ ->
598 Paragraph _ _ ->
596− InRow
599+ InParagraph
597
600
598 Text _ ->
601 Text _ ->
599 InEl
602 InEl
tests-rendering/src/Testable/Element.elm+114−83
@@ -307,6 +307,11 @@ paddingXY x y =
307 }
307 }
308
308
309
309
310+listIf ls =
311+ List.filter Tuple.first ls
312+ |> List.map Tuple.second
313+
314+
310widthHelper maybeMin maybeMax len =
315widthHelper maybeMin maybeMax len =
311 let
316 let
312 addMin l =
317 addMin l =
@@ -465,12 +470,31 @@ widthHelper maybeMin maybeMax len =
465 totalChildren + horizontalPadding
470 totalChildren + horizontalPadding
466
471
467 expectedLines =
472 expectedLines =
473+ if boxChildrenHeight > 20 then
474+ ceiling (boxChildrenHeight / 20)
475+
476+ else
468− ceiling (totalCalculatedWidth / context.self.bbox.width)
477+ ceiling (totalCalculatedWidth / context.self.bbox.width)
478+
479+ boxChildrenHeight =
480+ context.children
481+ |> List.map
482+ (\c ->
483+ c.bbox.height
484+ )
485+ |> List.sum
469 in
486 in
470− [ Testable.rounded "text wrapping, checking height"
487+ [ Testable.true "text wrapping, checking height"
488+ -- all we're doing here is testing if wrapping is occurring
489+ -- not the exact height, which is a little tricky to calculate perfectly without more information.
471− { expected = toFloat (expectedLines * 22)
490+ (if expectedLines > 1 then
491+ context.self.bbox.height >= (20 * 2)
492+
493+ else
494+ -- then it's less than 2 ~ line heights
495+ -- there's some weird variance here which makes it hard to be exact.
472− , found = context.self.bbox.height
496+ context.self.bbox.height < (20 * 2)
473− }
497+ )
474 ]
498 ]
475
499
476 _ ->
500 _ ->
@@ -504,23 +528,21 @@ widthHelper maybeMin maybeMax len =
504
528
505 horizontalPadding =
529 horizontalPadding =
506 context.self.bbox.padding.left + context.self.bbox.padding.right
530 context.self.bbox.padding.left + context.self.bbox.padding.right
507−
508− _ =
509− Debug.log "widths"
510− { children =
511− context.children
512− |> List.map childWidth
513− , text = List.map .width context.self.textMetrics
514− }
515 in
531 in
532+ listIf
533+ [ ( (context.parentLayout /= Testable.InParagraph)
534+ && (context.parentLayout /= Testable.InTextCol)
516− [ Testable.rounded "equals children"
535+ , Testable.rounded "equals children"
517− { expected = totalChildren + horizontalPadding
536+ { expected = totalChildren + horizontalPadding
518− , found = context.self.bbox.width
537+ , found = context.self.bbox.width
519− }
538+ }
539+ )
540+ , ( context.parentLayout /= Testable.AtRoot
520− , Testable.lessThanOrEqual "not larger than parent"
541+ , Testable.lessThanOrEqual "not larger than parent"
521− context.self.bbox.width
542+ context.self.bbox.width
522− context.parent.bbox.width
543+ context.parent.bbox.width
544+ )
523− ]
545+ ]
524
546
525 Testable.Row rowAttrs _ ->
547 Testable.Row rowAttrs _ ->
526 -- width of row is the sum of all children widths
548 -- width of row is the sum of all children widths
@@ -544,14 +566,19 @@ widthHelper maybeMin maybeMax len =
544 totalSpacing =
566 totalSpacing =
545 toFloat spacingAmount * (toFloat (List.length context.children) - 1)
567 toFloat spacingAmount * (toFloat (List.length context.children) - 1)
546 in
568 in
569+ listIf
570+ [ ( True
547− [ expectRoundedEquality
571+ , expectRoundedEquality
548− { expected = totalChildren + horizontalPadding + totalSpacing
572+ { expected = totalChildren + horizontalPadding + totalSpacing
549− , found = context.self.bbox.width
573+ , found = context.self.bbox.width
550− }
574+ }
575+ )
576+ , ( context.parentLayout /= Testable.AtRoot
551− , Testable.lessThanOrEqual "not larger than parent"
577+ , Testable.lessThanOrEqual "not larger than parent"
552− context.self.bbox.width
578+ context.self.bbox.width
553− context.parent.bbox.width
579+ context.parent.bbox.width
580+ )
554− ]
581+ ]
555
582
556 Testable.Column _ _ ->
583 Testable.Column _ _ ->
557 -- The width of the column is the width of the widest child.
584 -- The width of the column is the width of the widest child.
@@ -575,14 +602,19 @@ widthHelper maybeMin maybeMax len =
575 |> List.map childWidth
602 |> List.map childWidth
576 |> List.append textChildren
603 |> List.append textChildren
577 in
604 in
605+ listIf
606+ [ ( True
578− [ expectRoundedEquality
607+ , expectRoundedEquality
579− { expected = Maybe.withDefault 0 (List.maximum allChildren)
608+ { expected = Maybe.withDefault 0 (List.maximum allChildren)
580− , found = context.self.bbox.width
609+ , found = context.self.bbox.width
581− }
610+ }
611+ )
612+ , ( context.parentLayout /= Testable.AtRoot
582− , Testable.lessThanOrEqual "not larger than parent"
613+ , Testable.lessThanOrEqual "not larger than parent"
583− context.self.bbox.width
614+ context.self.bbox.width
584− context.parent.bbox.width
615+ context.parent.bbox.width
616+ )
585− ]
617+ ]
586
618
587 Testable.TextColumn _ _ ->
619 Testable.TextColumn _ _ ->
588 -- The width of the column is the width of the widest child.
620 -- The width of the column is the width of the widest child.
@@ -606,14 +638,19 @@ widthHelper maybeMin maybeMax len =
606 |> List.map childWidth
638 |> List.map childWidth
607 |> List.append textChildren
639 |> List.append textChildren
608 in
640 in
641+ listIf
642+ [ ( True
609− [ expectRoundedEquality
643+ , expectRoundedEquality
610− { expected = Maybe.withDefault 0 (List.maximum allChildren)
644+ { expected = Maybe.withDefault 0 (List.maximum allChildren)
611− , found = context.self.bbox.width
645+ , found = context.self.bbox.width
612− }
646+ }
647+ )
648+ , ( context.parentLayout /= Testable.AtRoot
613− , Testable.lessThanOrEqual "not larger than parent"
649+ , Testable.lessThanOrEqual "not larger than parent"
614− context.self.bbox.width
650+ context.self.bbox.width
615− context.parent.bbox.width
651+ context.parent.bbox.width
652+ )
616− ]
653+ ]
617
654
618 Testable.Paragraph _ _ ->
655 Testable.Paragraph _ _ ->
619 -- This should be the size it's text,
656 -- This should be the size it's text,
@@ -631,14 +668,19 @@ widthHelper maybeMin maybeMax len =
631 horizontalPadding =
668 horizontalPadding =
632 context.self.bbox.padding.left + context.self.bbox.padding.right
669 context.self.bbox.padding.left + context.self.bbox.padding.right
633 in
670 in
671+ listIf
672+ [ ( True
634− [ expectRoundedEquality
673+ , expectRoundedEquality
635− { expected = totalChildren + horizontalPadding
674+ { expected = totalChildren + horizontalPadding
636− , found = context.self.bbox.width
675+ , found = context.self.bbox.width
637− }
676+ }
677+ )
678+ , ( context.parentLayout /= Testable.AtRoot
638− , Testable.lessThanOrEqual "not larger than parent"
679+ , Testable.lessThanOrEqual "not larger than parent"
639− context.self.bbox.width
680+ context.self.bbox.width
640− context.parent.bbox.width
681+ context.parent.bbox.width
682+ )
641− ]
683+ ]
642
684
643 Testable.Text _ ->
685 Testable.Text _ ->
644 []
686 []
@@ -792,20 +834,17 @@ heightHelper maybeMin maybeMax len =
792 childHeight child =
834 childHeight child =
793 child.bbox.height
835 child.bbox.height
794 in
836 in
795− [ if List.isEmpty context.children then
837+ if List.isEmpty context.children then
796 -- context.self.textMetrics
838 -- context.self.textMetrics
797 -- |> List.map Testable.textHeight
839 -- |> List.map Testable.textHeight
798 -- |> List.sum
840 -- |> List.sum
799 -- TODO: apparently the font metrics we have are for the literal characters rendered
841 -- TODO: apparently the font metrics we have are for the literal characters rendered
800 -- not for the font itself.
842 -- not for the font itself.
801− -- so for now, we are stubbing this in as 20, which is the default font size + line height.
843+ [ Testable.todo "calculate height from actual text metrics"
802− Testable.rounded "expected multiple of 20"
844+ ]
803− { expected = context.self.bbox.height
804− , found = toFloat (List.length context.self.textMetrics * 20)
805− }
806
845
807− else
846+ else
808− expectRoundedEquality
847+ [ expectRoundedEquality
809 { expected =
848 { expected =
810 context.children
849 context.children
811 |> List.map childHeight
850 |> List.map childHeight
@@ -813,28 +852,26 @@ heightHelper maybeMin maybeMax len =
813 |> (\h -> h + context.self.bbox.padding.top + context.self.bbox.padding.bottom)
852 |> (\h -> h + context.self.bbox.padding.top + context.self.bbox.padding.bottom)
814 , found = context.self.bbox.height
853 , found = context.self.bbox.height
815 }
854 }
816− , Testable.lessThanOrEqual "not larger than parent"
855+ , Testable.lessThanOrEqual "not larger than parent"
817− context.self.bbox.height
856+ context.self.bbox.height
818− context.parent.bbox.height
857+ context.parent.bbox.height
819− ]
858+ ]
820
859
821 Testable.Row _ _ ->
860 Testable.Row _ _ ->
822 let
861 let
823 childHeight child =
862 childHeight child =
824 child.bbox.height
863 child.bbox.height
825 in
864 in
826− [ if List.isEmpty context.children then
865+ if List.isEmpty context.children then
827 -- context.self.textMetrics
866 -- context.self.textMetrics
828 -- |> List.map Testable.textHeight
867 -- |> List.map Testable.textHeight
829 -- |> List.sum
868 -- |> List.sum
830 -- TODO: apparently the font metrics we have are for the literal characters rendered
869 -- TODO: apparently the font metrics we have are for the literal characters rendered
831 -- not for the font itself.
870 -- not for the font itself.
832− -- so for now, we are stubbing this in as 20, which is the default font size.
871+ [ Testable.todo "calculate height from actual text metrics" ]
833− Testable.true "expected multiple of 20"
834− ((round context.self.bbox.height |> modBy 20) == 0)
835
872
836− else
873+ else
837− expectRoundedEquality
874+ [ expectRoundedEquality
838 { expected =
875 { expected =
839 context.children
876 context.children
840 |> List.map childHeight
877 |> List.map childHeight
@@ -843,10 +880,10 @@ heightHelper maybeMin maybeMax len =
843 |> (\h -> h + context.self.bbox.padding.top + context.self.bbox.padding.bottom)
880 |> (\h -> h + context.self.bbox.padding.top + context.self.bbox.padding.bottom)
844 , found = context.self.bbox.height
881 , found = context.self.bbox.height
845 }
882 }
846− , Testable.lessThanOrEqual "not larger than parent"
883+ , Testable.lessThanOrEqual "not larger than parent"
847− context.self.bbox.height
884+ context.self.bbox.height
848− context.parent.bbox.height
885+ context.parent.bbox.height
849− ]
886+ ]
850
887
851 Testable.Column colAttrs _ ->
888 Testable.Column colAttrs _ ->
852 let
889 let
@@ -878,16 +915,10 @@ heightHelper maybeMin maybeMax len =
878 ]
915 ]
879
916
880 Testable.TextColumn _ _ ->
917 Testable.TextColumn _ _ ->
881− [ Testable.lessThanOrEqual "not larger than parent"
882− context.self.bbox.height
883− context.parent.bbox.height
884− ]
918+ []
885
919
886 Testable.Paragraph _ _ ->
920 Testable.Paragraph _ _ ->
887− [ Testable.lessThanOrEqual "not larger than parent"
888− context.self.bbox.height
889− context.parent.bbox.height
890− ]
921+ []
891
922
892 Testable.Text _ ->
923 Testable.Text _ ->
893 []
924 []
tests-rendering/src/Testable/Generator.elm+109−30
@@ -20,37 +20,38 @@ element : String -> List (Testable.Attr msg) -> List ( String, Testable.Element
20element label attrs =
20element label attrs =
21 -- [ ( label, paragraph attrs [ short ] )
21 -- [ ( label, paragraph attrs [ short ] )
22 -- ]
22 -- ]
23− mapEveryCombo
23+ mapEveryCombo3
24− (\makeLayout child ->
24+ (\( layoutLabel, makeLayout ) ( selfLabel, makeSelf ) ( childLabel, child ) ->
25+ ( label ++ " - " ++ layoutLabel ++ " > " ++ selfLabel ++ " > " ++ childLabel
25− ( label, makeLayout attrs child )
26+ , makeLayout [] (makeSelf attrs child)
27+ )
26 )
28 )
27 layouts
29 layouts
30+ layouts
28 contents
31 contents
29
32
30
33
31−mapEveryCombo fn listOne listTwo =
32− List.concatMap
33− (\one ->
34− List.map
35− (\two ->
36− fn one two
37− )
38− listTwo
39− )
40− listOne
41−
42−
43layouts =
34layouts =
35+ [ ( "el"
44− [ \attrs child ->
36+ , \attrs child ->
45− el attrs child
37+ el attrs child
38+ )
39+ , ( "row"
46− , \attrs child ->
40+ , \attrs child ->
47− row attrs [ child ]
41+ row attrs [ child ]
42+ )
43+ , ( "col"
48− , \attrs child ->
44+ , \attrs child ->
49− column attrs [ child ]
45+ column attrs [ child ]
46+ )
47+ , ( "para"
50− , \attrs child ->
48+ , \attrs child ->
51− paragraph attrs [ child ]
49+ paragraph attrs [ child ]
50+ )
51+ , ( "txtCol"
52− , \attrs child ->
52+ , \attrs child ->
53− textColumn attrs [ child ]
53+ textColumn attrs [ child ]
54+ )
54 ]
55 ]
55
56
56
57
@@ -65,17 +66,23 @@ nearbys =
65
66
66
67
67contents =
68contents =
68− [ none
69+ [ ( "none", none )
69− , text short
70+ , ( "short text", text short )
70− , text lorem
71+ , ( "long text", text lorem )
72+ , ( "box"
73+ , box
74+ )
75+ ]
76+
77+
78+box =
71− , el
79+ el
72 [ width (px 50)
80 [ width (px 50)
73 , height (px 50)
81 , height (px 50)
74 , Background.color (rgb (240 / 255) 0 (245 / 255))
82 , Background.color (rgb (240 / 255) 0 (245 / 255))
75 , Font.color (rgb 1 1 1)
83 , Font.color (rgb 1 1 1)
76 ]
84 ]
77 none
85 none
78− ]
79
86
80
87
81short =
88short =
@@ -84,3 +91,75 @@ short =
84
91
85lorem =
92lorem =
86 "There are many variations of passages of Lorem Ipsum available, but the majority have suffered alteration in some form, by injected humour, or randomised words which don't look even slightly believable. If you are going to use a passage of Lorem Ipsum, you need to be sure there isn't anything embarrassing hidden in the middle of text. All the Lorem Ipsum generators on the Internet tend to repeat predefined chunks as necessary, making this the first true generator on the Internet. It uses a dictionary of over 200 Latin words, combined with a handful of model sentence structures, to generate Lorem Ipsum which looks reasonable. The generated Lorem Ipsum is therefore always free from repetition, injected humour, or non-characteristic words etc."
93 "There are many variations of passages of Lorem Ipsum available, but the majority have suffered alteration in some form, by injected humour, or randomised words which don't look even slightly believable. If you are going to use a passage of Lorem Ipsum, you need to be sure there isn't anything embarrassing hidden in the middle of text. All the Lorem Ipsum generators on the Internet tend to repeat predefined chunks as necessary, making this the first true generator on the Internet. It uses a dictionary of over 200 Latin words, combined with a handful of model sentence structures, to generate Lorem Ipsum which looks reasonable. The generated Lorem Ipsum is therefore always free from repetition, injected humour, or non-characteristic words etc."
94+
95+
96+mapEveryCombo fn listOne listTwo =
97+ List.concatMap
98+ (\one ->
99+ List.map
100+ (\two ->
101+ fn one two
102+ )
103+ listTwo
104+ )
105+ listOne
106+
107+
108+mapEveryCombo3 fn listOne listTwo listThree =
109+ List.concatMap
110+ (\one ->
111+ List.concatMap
112+ (\two ->
113+ List.map
114+ (\three ->
115+ fn one two three
116+ )
117+ listThree
118+ )
119+ listTwo
120+ )
121+ listOne
122+
123+
124+sizes render =
125+ List.concatMap
126+ (\( widthLen, heightLen ) ->
127+ [ text (Debug.toString ( widthLen, heightLen ))
128+ , render
129+ (\attrs children ->
130+ el
131+ (width widthLen
132+ :: height heightLen
133+ :: attrs
134+ )
135+ children
136+ )
137+ ]
138+ )
139+ allLengthPairs
140+
141+
142+allLengthPairs : List ( Length, Length )
143+allLengthPairs =
144+ let
145+ crossProduct len =
146+ List.map (Tuple.pair len) lengths
147+ in
148+ List.concatMap crossProduct lengths
149+
150+
151+lengths =
152+ [ px 50
153+ , fill
154+ , shrink
155+ , fill
156+ |> maximum 100
157+ , fill
158+ |> maximum 100
159+ |> minimum 50
160+ , shrink
161+ |> maximum 100
162+ , shrink
163+ |> maximum 100
164+ |> minimum 50
165+ ]
tests-rendering/src/Testable/Runner.elm+43−25
@@ -3,9 +3,9 @@ port module Testable.Runner exposing
3 , Testable
3 , Testable
4 , TestableProgram
4 , TestableProgram
5 , program
5 , program
6+ , rename
6 , show
7 , show
7 , testable
8 , testable
8− , rename
9 )
9 )
10
10
11{-| -}
11{-| -}
@@ -108,7 +108,8 @@ type alias Model msg =
108
108
109
109
110type alias WithResults thing =
110type alias WithResults thing =
111+ { index : Int
111− { element : thing
112+ , element : thing
112 , label : String
113 , label : String
113 , results :
114 , results :
114 List Testable.LayoutTest
115 List Testable.LayoutTest
@@ -170,13 +171,14 @@ type Msg
170 )
171 )
171
172
172
173
173−runTest : Dict String Testable.Found -> String -> Testable.Element msg -> WithResults (Testable.Element msg)
174+runTest : Int -> Dict String Testable.Found -> String -> Testable.Element msg -> WithResults (Testable.Element msg)
174−runTest boxes label element =
175+runTest index boxes label element =
175 let
176 let
176 results =
177 results =
177 Testable.runTests boxes element
178 Testable.runTests boxes element
178 in
179 in
180+ { index = index
179− { element = element
181+ , element = element
180 , label = label
182 , label = label
181 , results = results
183 , results = results
182 }
184 }
@@ -222,7 +224,7 @@ update msg model =
222 |> Dict.fromList
224 |> Dict.fromList
223
225
224 currentResults =
226 currentResults =
225− runTest foundData label current
227+ runTest (List.length model.finished) foundData label current
226 in
228 in
227 case model.upcoming of
229 case model.upcoming of
228 [] ->
230 [] ->
@@ -267,8 +269,6 @@ view model =
267 let
269 let
268 selected =
270 selected =
269 getByIndex model.selected model.finished
271 getByIndex model.selected model.finished
270−
271− -- |> Debug.log "selected"
272 in
272 in
273 Element.layout
273 Element.layout
274 [ Font.size 16
274 [ Font.size 16
@@ -316,7 +316,10 @@ view model =
316 , Element.height Element.fill
316 , Element.height Element.fill
317 , Element.scrollbarY
317 , Element.scrollbarY
318 ]
318 ]
319+ (model.finished
320+ |> List.sortBy hasFailure
319− (List.indexedMap (viewResult model.selected) model.finished)
321+ |> List.map (viewResult model.selected)
322+ )
320 ]
323 ]
321
324
322 else
325 else
@@ -370,9 +373,35 @@ viewElementHighlight model =
370 ]
373 ]
371
374
372
375
376+hasFailure : WithResults (Testable.Element Msg) -> Int
377+hasFailure myTest =
378+ if
379+ List.any
380+ (not << isPassing)
381+ myTest.results
382+ then
383+ 0
384+
385+ else
386+ 1
387+
388+
389+isExpectationPassing result =
390+ case result of
391+ Testable.Todo label ->
392+ True
393+
394+ Testable.Expect details ->
395+ details.result
396+
397+
398+isPassing layoutTest =
399+ List.all isExpectationPassing layoutTest.expectations
400+
401+
373−viewResult : Int -> Int -> WithResults (Testable.Element Msg) -> Element.Element Msg
402+viewResult : Int -> WithResults (Testable.Element Msg) -> Element.Element Msg
374−viewResult selectedIndex index myTest =
403+viewResult selectedIndex myTest =
375− if index == selectedIndex then
404+ if myTest.index == selectedIndex then
376 Element.column
405 Element.column
377 [ Element.alignLeft
406 [ Element.alignLeft
378 , Element.spacing 16
407 , Element.spacing 16
@@ -388,17 +417,6 @@ viewResult selectedIndex index myTest =
388
417
389 else
418 else
390 let
419 let
391− isExpectationPassing result =
392− case result of
393− Testable.Todo label ->
394− True
395−
396− Testable.Expect details ->
397− details.result
398−
399− isPassing layoutTest =
400− List.all isExpectationPassing layoutTest.expectations
401−
402 ( passing, failing ) =
420 ( passing, failing ) =
403 List.partition isPassing myTest.results
421 List.partition isPassing myTest.results
404 in
422 in
@@ -406,10 +424,10 @@ viewResult selectedIndex index myTest =
406 [ Element.alignLeft
424 [ Element.alignLeft
407 , Element.spacing 16
425 , Element.spacing 16
408 , Element.pointer
426 , Element.pointer
409− , Events.onClick (Select index)
427+ , Events.onClick (Select myTest.index)
410 ]
428 ]
411 [ Element.row [ Element.spacing 16 ]
429 [ Element.row [ Element.spacing 16 ]
412− [ Element.el [ Font.size 24 ] (Element.text myTest.label)
430+ [ Element.el [ Font.size 16 ] (Element.text myTest.label)
413 , Element.text (String.fromInt (List.length passing) ++ " passing")
431 , Element.text (String.fromInt (List.length passing) ++ " passing")
414 , let
432 , let
415 failingCount =
433 failingCount =
tests-rendering/src/Tests/All.elm+3−1
@@ -18,7 +18,9 @@ import Tests.Transparency
18main : Testable.Runner.TestableProgram
18main : Testable.Runner.TestableProgram
19main =
19main =
20 (Testable.Runner.program << List.concat)
20 (Testable.Runner.program << List.concat)
21− [ -- Testable.Generator.element "Basics" []
21+ [ --Testable.Generator.element "Basics"
22+ --[]
23+ -- , Testable.Generator.element "Align " []
22 -- Tuple.pair "Basic Element" Tests.Basic.view
24 -- Tuple.pair "Basic Element" Tests.Basic.view
23 -- , Tuple.pair "Nearby" Tests.Nearby.view
25 -- , Tuple.pair "Nearby" Tests.Nearby.view
24 -- , Tuple.pair "Element Alignment" Tests.ElementAlignment.view
26 -- , Tuple.pair "Element Alignment" Tests.ElementAlignment.view
tests-rendering/src/Tests/Run.elm+5−23
@@ -1,32 +1,14 @@
1module Tests.Run exposing (main)
1module Tests.Run exposing (main)
2
2
3+{-| _NOTE_ this is auto-generated! Notouchy!
3−{-| -}
4+-}
4
5
5−import Testable.Generator
6+import ElInFixedHeightColumn
6import Testable.Runner
7import Testable.Runner
7−import Tests.Basic
8−import Tests.ColumnAlignment
9−import Tests.ColumnSpacing
10−import Tests.ElementAlignment
11−import Tests.Nearby
12−import Tests.RowAlignment
13−import Tests.RowSpacing
14−import Tests.TextWrapping
15−import Tests.Transparency
16
8
17
9
18main : Testable.Runner.TestableProgram
10main : Testable.Runner.TestableProgram
19main =
11main =
20− (Testable.Runner.program << List.concat)
12+ Testable.Runner.program
21− [ -- Testable.Generator.element "Basics" []
13+ [ Testable.Runner.rename " El In Fixed Height Column" ElInFixedHeightColumn.view
22− -- Tuple.pair "Basic Element" Tests.Basic.view
23− -- , Tuple.pair "Nearby" Tests.Nearby.view
24− -- , Tuple.pair "Element Alignment" Tests.ElementAlignment.view
25− -- , Tuple.pair "Transparency" Tests.Transparency.view
26− -- , Tuple.pair "Column Alignment" Tests.ColumnAlignment.view
27− -- -- This has 12k cases, so it runs slow and sometimes crashes IE
28− -- , Tuple.pair "Row Alignment" Tests.RowAlignment.view
29− -- , Tuple.pair "Column Spacing" Tests.ColumnSpacing.view
30− -- , Tuple.pair "Row Spacing" Tests.RowSpacing.view
31− [ Tuple.pair "Paragraph wrapping" Tests.TextWrapping.view ]
32 ]
14 ]
tests-rendering/src/Tests/TextWrapping.elm+20−13
@@ -28,17 +28,24 @@ main =
28
28
29
29
30view =
30view =
31− column [ paddingXY 0 100, spacing 16 ]
31+ el [] <|
32− [ paragraph []
32+ paragraph []
33− [ text Testable.Generator.lorem
33+ [ Testable.Generator.box
34 ]
34 ]
35+
36+
37+
38+-- column [ spacing 16 ]
39+-- [ paragraph []
40+-- [ el [] (text Testable.Generator.short)
41+-- ]
35− , paragraph []
42+-- -- , paragraph []
36− [ text Testable.Generator.lorem
43+-- -- [ text Testable.Generator.lorem
37− , text Testable.Generator.lorem
44+-- -- , text Testable.Generator.lorem
38− ]
45+-- -- ]
39− , paragraph []
46+-- -- , paragraph []
40− [ text Testable.Generator.lorem
47+-- -- [ text Testable.Generator.lorem
41− , paragraph []
48+-- -- , paragraph []
42− [ text Testable.Generator.lorem ]
49+-- -- [ text Testable.Generator.lorem ]
43− ]
50+-- -- ]
44− ]
51+-- ]