@@ -8,7 +8,6 @@ import Testable
8import Testable.Element exposing (..)
8import Testable.Element exposing (..)
9import Testable.Element.Background as Background
9import Testable.Element.Background as Background
10import Testable.Element.Font as Font
10import Testable.Element.Font as Font
11−import Testable.Generator
12import Testable.Runner
11import Testable.Runner
13import Tests.Palette as Palette exposing (..)
12import Tests.Palette as Palette exposing (..)
@@ -58,39 +57,365 @@ p attrs =
62+ Testable.Runner.show view
61−view : List ( String, Testable.Element msg )
66+view : Testable.Element msg
64− [ [ Tuple.pair "Parent inFront above child inFront" layeredVisibility
69+ transparentBox attrs =
65− , Tuple.pair "Sibling onLeft above sibling inFront" overlappingChildren
70+ el
66− , Tuple.pair "el with all nearbys and alignments" master
71+ ([ Font.color white
67− , Tuple.pair "paragraph with all nearbys and alignments" masterParagraph
72+ , width (px 50)
68− ]
73+ , height (px 50)
69− , Testable.Generator.generate "Nearbys"
74+ , Background.color white
70− (\element nearby ->
75+ ]
72− [ nearby (box [])
77+ )
80+ -- single location name box =
81+ -- row [ height (px 100), width fill, spacing 50 ]
87+ -- , Background.color darkCharcoal
73− , width (px 200)
95+ -- [ width (px 20)
74− , height (px 200)
96+ -- , height (px 20)
75− , Background.color red
97+ -- , alignLeft
98+ -- , Background.color darkCharcoal
109+ , Background.color darkCharcoal
115+ nearby location name render =
116+ column [ spacing 32, label "column" ]
117+ [ el [ padding 20, Background.color green, Font.color white ] (text name)
118+ , row [ height (px 100), width fill, spacing 50 ]
125+ , Background.color darkCharcoal
137+ , Background.color darkCharcoal
149+ , Background.color darkCharcoal
161+ , Background.color darkCharcoal
173+ , Background.color darkCharcoal
185+ , Background.color darkCharcoal
197+ , Background.color darkCharcoal
203+ , text "widths/heights"
204+ , row [ height (px 100), width fill, spacing 50, label "Row" ]
211+ , Background.color darkCharcoal
222+ , Background.color darkCharcoal
234+ , Background.color darkCharcoal
245+ , Background.color darkCharcoal
257+ , Background.color darkCharcoal
77− none
264+ , text "on paragraph"
78− )
265+ , row [ width fill, spacing 50, label "Row" ]
79− |> Testable.Generator.with Testable.Generator.allElements
266+ [ p
80− |> Testable.Generator.with Testable.Generator.nearbys
267+ [ location
81− , Testable.Generator.generate "Nearbys with alignment"
268+ (el
82− (\element nearby align ->
269+ [ label name
83− element
270+ , width (px 20)
84− [ nearby (box [ align ])
271+ , height (px 20)
272+ , Background.color darkCharcoal
284+ , Background.color darkCharcoal
296+ , Background.color darkCharcoal
308+ , Background.color darkCharcoal
85− , width (px 200)
317+ , width (px 20)
320+ , Background.color darkCharcoal
86− , height (px 200)
330+ , height (px 20)
332+ , Background.color darkCharcoal
87− , Background.color red
344+ , Background.color darkCharcoal
91− |> Testable.Generator.with Testable.Generator.allElements
352+ master =
92− |> Testable.Generator.with Testable.Generator.nearbys
353+ el [ padding 20 ] <|
93− |> Testable.Generator.with Testable.Generator.alignments
354+ box
355+ [ above (little "above-left" [ alignLeft ])
356+ , above (little "above-center" [ centerX ])
357+ , above (little "above-right" [ alignRight ])
358+ , below (little "below-left" [ alignLeft ])
359+ , below (little "below-center" [ centerX ])
360+ , below (little "below-right" [ alignRight ])
361+ , onRight (little "onRight-left" [ alignTop ])
362+ , onRight (little "onRight-center" [ centerY ])
363+ , onRight (little "onRight-right" [ alignBottom ])
364+ , onLeft (little "onLeft-left" [ alignTop ])
365+ , onLeft (little "onLeft-center" [ centerY ])
366+ , onLeft (little "onLeft-right" [ alignBottom ])
367+ , inFront (little "infront-left-top" [ alignTop, alignLeft ])
368+ , inFront (little "infront-center-top" [ alignTop, centerX ])
369+ , inFront (little "infront-right-top" [ alignTop, alignRight ])
370+ , inFront (little "infront-left-center" [ centerY, alignLeft ])
371+ , inFront (little "infront-center-center" [ centerY, centerX ])
372+ , inFront (little "infront-right-center" [ centerY, alignRight ])
373+ , inFront (little "infront-left-bottom" [ alignBottom, alignLeft ])
374+ , inFront (little "infront-center-bottom" [ alignBottom, centerX ])
375+ , inFront (little "infront-right-bottom" [ alignBottom, alignRight ])
379+ el [ padding 20 ] <|
381+ [ above (little "above-left" [ alignLeft ])
382+ , above (little "above-center" [ centerX ])
383+ , above (little "above-right" [ alignRight ])
384+ , below (little "below-left" [ alignLeft ])
385+ , below (little "below-center" [ centerX ])
386+ , below (little "below-right" [ alignRight ])
387+ , onRight (little "onRight-left" [ alignTop ])
388+ , onRight (little "onRight-center" [ centerY ])
389+ , onRight (little "onRight-right" [ alignBottom ])
390+ , onLeft (little "onLeft-left" [ alignTop ])
391+ , onLeft (little "onLeft-center" [ centerY ])
392+ , onLeft (little "onLeft-right" [ alignBottom ])
393+ , inFront (little "infront-left-top" [ alignTop, alignLeft ])
394+ , inFront (little "infront-center-top" [ alignTop, centerX ])
395+ , inFront (little "infront-right-top" [ alignTop, alignRight ])
396+ , inFront (little "infront-left-center" [ centerY, alignLeft ])
397+ , inFront (little "infront-center-center" [ centerY, centerX ])
398+ , inFront (little "infront-right-center" [ centerY, alignRight ])
399+ , inFront (little "infront-left-bottom" [ alignBottom, alignLeft ])
400+ , inFront (little "infront-center-bottom" [ alignBottom, centerX ])
401+ , inFront (little "infront-right-bottom" [ alignBottom, alignRight ])
405+ [ centerX, label "Nearby Elements", spacing 100 ]
407+ , overlappingChildren
409+ -- Note: visibility checks like the above
410+ -- need to be at the top so they're in the viewport
413+ , nearby above "above" box
414+ , nearby below "below" box
415+ , nearby inFront "inFront" box
416+ , nearby onRight "onRight" box
417+ , nearby onLeft "onLeft" box
418+ , nearby behindContent "behindContent" transparentBox
@@ -111,69 +436,3 @@ overlappingChildren =
111 , el [ onLeft (littleBox "overlapping" [ isVisible, Background.color red ]) ]
436 , el [ onLeft (littleBox "overlapping" [ isVisible, Background.color red ]) ]
112 (justBox 40 darkGrey [])
437 (justBox 40 darkGrey [])
121− , Background.color darkCharcoal
129− el [ padding 20 ] <|
131− [ above (little "above-left" [ alignLeft ])
132− , above (little "above-center" [ centerX ])
133− , above (little "above-right" [ alignRight ])
134− , below (little "below-left" [ alignLeft ])
135− , below (little "below-center" [ centerX ])
136− , below (little "below-right" [ alignRight ])
137− , onRight (little "onRight-left" [ alignTop ])
138− , onRight (little "onRight-center" [ centerY ])
139− , onRight (little "onRight-right" [ alignBottom ])
140− , onLeft (little "onLeft-left" [ alignTop ])
141− , onLeft (little "onLeft-center" [ centerY ])
142− , onLeft (little "onLeft-right" [ alignBottom ])
143− , inFront (little "infront-left-top" [ alignTop, alignLeft ])
144− , inFront (little "infront-center-top" [ alignTop, centerX ])
145− , inFront (little "infront-right-top" [ alignTop, alignRight ])
146− , inFront (little "infront-left-center" [ centerY, alignLeft ])
147− , inFront (little "infront-center-center" [ centerY, centerX ])
148− , inFront (little "infront-right-center" [ centerY, alignRight ])
149− , inFront (little "infront-left-bottom" [ alignBottom, alignLeft ])
150− , inFront (little "infront-center-bottom" [ alignBottom, centerX ])
151− , inFront (little "infront-right-bottom" [ alignBottom, alignRight ])
156− el [ padding 20 ] <|
158− [ above (little "above-left" [ alignLeft ])
159− , above (little "above-center" [ centerX ])
160− , above (little "above-right" [ alignRight ])
161− , below (little "below-left" [ alignLeft ])
162− , below (little "below-center" [ centerX ])
163− , below (little "below-right" [ alignRight ])
164− , onRight (little "onRight-left" [ alignTop ])
165− , onRight (little "onRight-center" [ centerY ])
166− , onRight (little "onRight-right" [ alignBottom ])
167− , onLeft (little "onLeft-left" [ alignTop ])
168− , onLeft (little "onLeft-center" [ centerY ])
169− , onLeft (little "onLeft-right" [ alignBottom ])
170− , inFront (little "infront-left-top" [ alignTop, alignLeft ])
171− , inFront (little "infront-center-top" [ alignTop, centerX ])
172− , inFront (little "infront-right-top" [ alignTop, alignRight ])
173− , inFront (little "infront-left-center" [ centerY, alignLeft ])
174− , inFront (little "infront-center-center" [ centerY, centerX ])
175− , inFront (little "infront-right-center" [ centerY, alignRight ])
176− , inFront (little "infront-left-bottom" [ alignBottom, alignLeft ])
177− , inFront (little "infront-center-bottom" [ alignBottom, centerX ])
178− , inFront (little "infront-right-bottom" [ alignBottom, alignRight ])