@@ -1040,6 +1040,10 @@ onLeft element =
1044+ vs (round x) (round y) || vs (floor x) (floor y)
1044inFront : Testable.Element msg -> Testable.Attr msg
1048inFront : Testable.Element msg -> Testable.Attr msg
1045inFront element =
1049inFront element =
@@ -1048,39 +1052,42 @@ inFront element =
1048 , element = element
1052 , element = element
1049 , label = "inFront"
1053 , label = "inFront"
1050 , test =
1054 , test =
1051− \found _ ->
1055+ withinHelper
1054− if found.self.bbox.width > found.parent.bbox.width then
1055− [ (found.self.bbox.right <= found.parent.bbox.right)
1056− || (found.self.bbox.left >= found.parent.bbox.left)
1060− [ found.self.bbox.right <= found.parent.bbox.right
1061− , found.self.bbox.left >= found.parent.bbox.left
1064− verticalCheck =
1059+withinHelper found _ =
1065− if found.self.bbox.width > found.parent.bbox.width then
1062+ if found.self.bbox.width > found.parent.bbox.width then
1066− [ (found.self.bbox.top >= found.parent.bbox.top)
1063+ [ compare found.self.bbox.right (<=) found.parent.bbox.right
1067− || (found.self.bbox.bottom <= found.parent.bbox.bottom)
1064+ || compare found.self.bbox.left (>=) found.parent.bbox.left
1068+ [ compare found.self.bbox.right (<=) found.parent.bbox.right
1069+ , compare found.self.bbox.left (>=) found.parent.bbox.left
1073+ if found.self.bbox.width > found.parent.bbox.width then
1074+ [ compare found.self.bbox.top (>=) found.parent.bbox.top
1075+ || compare found.self.bbox.bottom (<=) found.parent.bbox.bottom
1071− [ found.self.bbox.top >= found.parent.bbox.top
1079+ [ compare found.self.bbox.top (>=) found.parent.bbox.top
1072− , found.self.bbox.bottom <= found.parent.bbox.bottom
1080+ , compare found.self.bbox.bottom (<=) found.parent.bbox.bottom
1075− Expect.true "within the confines of the parent"
1083+ Expect.true "within the confines of the parent"
1076− (List.all ((==) True)
1084+ (List.all ((==) True)
1077− (List.concat
1085+ (List.concat
1078− [ horizontalCheck
1086+ [ horizontalCheck
1079− , verticalCheck
1087+ , verticalCheck
@@ -1089,38 +1096,7 @@ behindContent element =
1089 Testable.Nearby
1096 Testable.Nearby
1090 { location = Testable.Behind
1097 { location = Testable.Behind
1091 , element = element
1098 , element = element
1092− , label = "behind"
1099+ , label = "behindContent"
1093 , test =
1100 , test =
1094− \found _ ->
1101+ withinHelper
1097− if found.self.bbox.width > found.parent.bbox.width then
1098− [ (found.self.bbox.right <= found.parent.bbox.right)
1099− || (found.self.bbox.left >= found.parent.bbox.left)
1103− [ found.self.bbox.right <= found.parent.bbox.right
1104− , found.self.bbox.left >= found.parent.bbox.left
1108− if found.self.bbox.width > found.parent.bbox.width then
1109− [ (found.self.bbox.top >= found.parent.bbox.top)
1110− || (found.self.bbox.bottom <= found.parent.bbox.bottom)
1114− [ found.self.bbox.top >= found.parent.bbox.top
1115− , found.self.bbox.bottom <= found.parent.bbox.bottom
1118− Expect.true "within the confines of the parent"
1119− (List.all ((==) True)