From 3e64ffc09cd50cd597f51745872fe67f0ff61343 Mon Sep 17 00:00:00 2001 From: Alex Korban Date: Thu, 28 May 2020 13:01:29 +1200 Subject: [PATCH] Add test for issue 223 --- .../open/NearbyElementBordersOverlap.elm | 46 +++++++++++++++++++ 1 file changed, 46 insertions(+) create mode 100644 tests-rendering/cases/open/NearbyElementBordersOverlap.elm diff --git a/tests-rendering/cases/open/NearbyElementBordersOverlap.elm b/tests-rendering/cases/open/NearbyElementBordersOverlap.elm new file mode 100644 index 0000000..9ec744c --- /dev/null +++ b/tests-rendering/cases/open/NearbyElementBordersOverlap.elm @@ -0,0 +1,46 @@ +module NearbyElementBordersOverlap exposing (view) + +{-| Elements placed with onLeft, onRight, above & below overlap main element's border + + +# inFront elements with width fill are contained within the parent's border + + + +In addition to the overlap, it affects layout in unexpected ways: eg if the elements +are the same height, onLeft and onRight elements will be vertically offset +from the main element. + +-} + +import Testable.Element exposing (..) +import Testable.Element.Border as Border + + +blue = + rgb 0 0 1 + + +green = + rgb 0 1 0 + + +grey = + rgb 0.5 0.5 0.5 + + +view = + layout [ width fill, height fill ] <| + el + [ centerX + , centerY + , Border.width 10 + , Border.color green + , padding 50 + , above <| el [ Border.color grey, Border.width 10 ] <| text "above" + , below <| el [ Border.color grey, Border.width 10 ] <| text "below" + , onRight <| el [ Border.color blue, Border.width 10 ] <| text "onRight" + , onLeft <| el [ Border.color blue, Border.width 10 ] <| text "onLeft" + ] + <| + text "Centre"