@@ -19,6 +19,7 @@ module Testable exposing
1919 , formatColorWithAlpha
2020 , getIds
2121 , getSpacing
22+ , getSpacingFromAttributes
2223 , runTests
2324 , textHeight
2425 , toElement
@@ -481,6 +482,10 @@ createTest { siblings, parent, cache, level, element, location, parentSpacing }
481482
482483 id =
483484 levelToString level
485+ |> Debug.log "id"
486+
487+ _ =
488+ Debug.log "element" element
484489
485490 testChildren : Found -> List (Element msg) -> List LayoutTest
486491 testChildren found children =
@@ -620,6 +625,7 @@ createTest { siblings, parent, cache, level, element, location, parentSpacing }
620625
621626 attributeTests =
622627 attributes
628+ |> Debug.log "attributes"
623629 |> List.indexedMap
624630 -- Found -> Dict String Found -> List Int -> Int -> Surroundings -> Attr msg -> List Test
625631 (\i attr ->
@@ -698,8 +704,13 @@ createAttributeTest :
698704 -> List LayoutTest
699705createAttributeTest parent cache level attrIndex surroundings attr =
700706 let
707+ _ =
708+ Debug.log "attribute test" attr
709+
701710 domId =
702− "#" ++ levelToString level
711+ "#"
712+ ++ levelToString level
713+ |> Debug.log "domid"
703714 in
704715 case attr of
705716 Attr _ ->
@@ -739,7 +750,7 @@ createAttributeTest parent cache level attrIndex surroundings attr =
739750
740751 Batch batch ->
741752 batch
742− |> List.indexedMap (\i attribute -> createAttributeTest parent cache (attrIndex :: level) i surroundings attribute)
753+ |> List.indexedMap (\i attribute -> createAttributeTest parent cache level i surroundings attribute)
743754 |> List.concat
744755
745756 LabeledTest { label, test } ->
@@ -812,6 +823,21 @@ formatColor (Internal.Rgba red green blue alpha) =
812823 ++ ")"
813824
814825
826+getSpacingFromAttributes attrs =
827+ case attrs of
828+ [] ->
829+ 0
830+
831+ (Spacing i) :: remain ->
832+ i
833+
834+ (Batch batched) :: remain ->
835+ getSpacingFromAttributes (batched ++ remain)
836+
837+ _ :: remain ->
838+ getSpacingFromAttributes remain
839+
840+
815841getSpacing : Element msg -> Maybe Int
816842getSpacing el =
817843 let