From b566ba0cd231e707f59bf55a2826f0dec6d7fafe Mon Sep 17 00:00:00 2001 From: Micah Hahn Date: Fri, 28 Apr 2023 11:02:00 -0500 Subject: [PATCH] Add regression test for this specific case --- tests/Spec/Nri/Ui/Block.elm | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/tests/Spec/Nri/Ui/Block.elm b/tests/Spec/Nri/Ui/Block.elm index 35424a08..c965859a 100644 --- a/tests/Spec/Nri/Ui/Block.elm +++ b/tests/Spec/Nri/Ui/Block.elm @@ -616,6 +616,28 @@ getLabelPositionsSpec = ] |> Dict.fromList ) + , test "regression test - apparently impossible label top should not prevent identifying lables as being on same line" <| + \() -> + Block.getLabelPositions + (Dict.fromList + [ ( "173-display-element-labeled-2-5" + , { label = dummyElement { x = 350.984375, y = 212.5, width = 150, height = 53 } + , labelContent = dummyElement { x = 350.984375, y = 261.5, width = 150, height = 45 } + } + ) + , ( "173-display-element-labeled-6-12" + , { label = dummyElement { x = 477.2421875, y = 212.5, width = 150, height = 102 } + , labelContent = dummyElement { x = 477.2421875, y = 212.5, width = 150, height = 45 } + } + ) + ] + ) + |> Expect.equal + ([ ( "173-display-element-labeled-2-5", { arrowHeight = 8, totalHeight = 53, xOffset = 0, zIndex = 1 } ) + , ( "173-display-element-labeled-6-12", { arrowHeight = 57, totalHeight = 102, xOffset = 0, zIndex = 0 } ) + ] + |> Dict.fromList + ) ]