From 909f3d62839ad60a43016dd566f617067261275b Mon Sep 17 00:00:00 2001 From: Michael Freno Date: Mon, 22 Sep 2025 08:23:18 -0400 Subject: [PATCH] prop alignment --- FlexLove.lua | 82 +- .../01_absolute_positioning_basic_tests.lua | 292 +++---- ...bsolute_positioning_child_layout_tests.lua | 379 +++++---- .../03_flex_direction_horizontal_tests.lua | 484 +++++------ .../04_flex_direction_vertical_tests.lua | 610 ++++++------- .../__tests__/05_justify_content_tests.lua | 532 ++++++------ testing/__tests__/06_align_items_tests.lua | 801 +++++++++--------- testing/__tests__/07_flex_wrap_tests.lua | 469 +++++----- .../__tests__/08_comprehensive_flex_tests.lua | 526 ++++++------ .../__tests__/09_layout_validation_tests.lua | 196 ++--- testing/__tests__/10_performance_tests.lua | 224 ++--- .../11_auxiliary_functions_tests.lua | 166 ++-- testing/__tests__/12_units_system_tests.lua | 210 ++--- .../13_relative_positioning_tests.lua | 84 +- .../__tests__/14_text_scaling_basic_tests.lua | 493 +++++++++-- testing/__tests__/outline_example.lua | 22 - testing/runAll.lua | 3 + 17 files changed, 2925 insertions(+), 2648 deletions(-) delete mode 100644 testing/__tests__/outline_example.lua diff --git a/FlexLove.lua b/FlexLove.lua index 7bc11a5..a33eda6 100644 --- a/FlexLove.lua +++ b/FlexLove.lua @@ -83,17 +83,6 @@ local enums = { FlexWrap = { NOWRAP = "nowrap", WRAP = "wrap", WRAP_REVERSE = "wrap-reverse" }, } -local Positioning, FlexDirection, JustifyContent, AlignContent, AlignItems, TextAlign, AlignSelf, JustifySelf, FlexWrap = - enums.Positioning, - enums.FlexDirection, - enums.JustifyContent, - enums.AlignContent, - enums.AlignItems, - enums.TextAlign, - enums.AlignSelf, - enums.JustifySelf, - enums.FlexWrap - local Positioning, FlexDirection, JustifyContent, AlignContent, AlignItems, TextAlign, AlignSelf, JustifySelf, FlexWrap = enums.Positioning, enums.FlexDirection, @@ -143,10 +132,8 @@ function Units.parse(value) unit = "px" end - -- Validate unit type (removed vmin/vmax as requested) local validUnits = { px = true, ["%"] = true, vw = true, vh = true } if not validUnits[unit] then - -- Fallback to pixels for unsupported units, keeping the numeric value return num, "px" end @@ -177,14 +164,14 @@ function Units.resolve(value, unit, viewportWidth, viewportHeight, parentSize) end end ---- Get current viewport dimensions ---@return number, number -- width, height function Units.getViewport() -- Try both functions to be compatible with different love versions and test environments if love.graphics and love.graphics.getDimensions then return love.graphics.getDimensions() else - return love.window.getMode() + local w, h = love.window.getMode() + return w, h end end @@ -488,8 +475,8 @@ Element.__index = Element ---@field x number|string? -- X coordinate of the element (default: 0) ---@field y number|string? -- Y coordinate of the element (default: 0) ---@field z number? -- Z-index for layering (default: 0) ----@field w number|string? -- Width of the element (default: calculated automatically) ----@field h number|string? -- Height of the element (default: calculated automatically) +---@field width number|string? -- Width of the element (default: calculated automatically) +---@field height number|string? -- Height of the element (default: calculated automatically) ---@field top number|string? -- Offset from top edge (CSS-style positioning) ---@field right number|string? -- Offset from right edge (CSS-style positioning) ---@field bottom number|string? -- Offset from bottom edge (CSS-style positioning) @@ -550,7 +537,6 @@ function Element.new(props) self.opacity = props.opacity or 1 self.text = props.text - self.textSize = props.textSize or 12 self.textAlign = props.textAlign or TextAlign.START --- self positioning --- @@ -584,7 +570,7 @@ function Element.new(props) } -- Handle width (both w and width properties, prefer w if both exist) - local widthProp = props.w or props.width + local widthProp = props.width if widthProp then if type(widthProp) == "string" then local value, unit = Units.parse(widthProp) @@ -602,7 +588,7 @@ function Element.new(props) end -- Handle height (both h and height properties, prefer h if both exist) - local heightProp = props.h or props.height + local heightProp = props.height if heightProp then if type(heightProp) == "string" then local value, unit = Units.parse(heightProp) @@ -652,8 +638,7 @@ function Element.new(props) self.units.textSize = { value = props.textSize, unit = "px" } end else - -- Initialize with default/nil value - self.units.textSize = { value = nil, unit = "px" } + self.units.textSize = { value = 12, unit = "px" } end -- Store original spacing values for proper resize handling @@ -731,7 +716,7 @@ function Element.new(props) self._originalPositioning = props.positioning self._explicitlyAbsolute = (props.positioning == Positioning.ABSOLUTE) else - self.positioning = Positioning.RELATIVE + self.positioning = Positioning.ABSOLUTE self._originalPositioning = nil -- No explicit positioning self._explicitlyAbsolute = false end @@ -746,13 +731,13 @@ function Element.new(props) self._explicitlyAbsolute = false else -- Default: children in flex containers participate in flex layout - -- children in other containers default to relative + -- children in absolute containers default to absolute if self.parent.positioning == Positioning.FLEX then self.positioning = Positioning.ABSOLUTE -- They are positioned BY flex, not AS flex self._explicitlyAbsolute = false -- Participate in parent's flex layout else - self.positioning = Positioning.RELATIVE - self._explicitlyAbsolute = false -- Default for other containers + self.positioning = Positioning.ABSOLUTE + self._explicitlyAbsolute = false -- Default for absolute containers end end @@ -791,44 +776,6 @@ function Element.new(props) end self.z = props.z or 0 - elseif self.positioning == Positioning.RELATIVE then - -- Relative positioning: position relative to parent's position - local baseX = self.parent.x - local baseY = self.parent.y - - if props.x then - if type(props.x) == "string" then - local value, unit = Units.parse(props.x) - self.units.x = { value = value, unit = unit } - local parentWidth = self.parent.width - local offsetX = Units.resolve(value, unit, viewportWidth, viewportHeight, parentWidth) - self.x = baseX + offsetX - else - self.x = baseX + props.x - self.units.x = { value = props.x, unit = "px" } - end - else - self.x = baseX - self.units.x = { value = 0, unit = "px" } - end - - if props.y then - if type(props.y) == "string" then - local value, unit = Units.parse(props.y) - self.units.y = { value = value, unit = unit } - local parentHeight = self.parent.height - local offsetY = Units.resolve(value, unit, viewportWidth, viewportHeight, parentHeight) - self.y = baseY + offsetY - else - self.y = baseY + props.y - self.units.y = { value = props.y, unit = "px" } - end - else - self.y = baseY - self.units.y = { value = 0, unit = "px" } - end - - self.z = props.z or self.parent.z or 0 else -- Children in flex containers start at parent position but will be repositioned by layoutChildren local baseX = self.parent.x @@ -972,8 +919,8 @@ function Element:addChild(child) child.positioning = Positioning.ABSOLUTE -- They are positioned BY flex, not AS flex child._explicitlyAbsolute = false -- Participate in parent's flex layout else - child.positioning = Positioning.RELATIVE - child._explicitlyAbsolute = false -- Default for other containers + child.positioning = Positioning.ABSOLUTE + child._explicitlyAbsolute = false -- Default for absolute containers end end -- If child._originalPositioning is set, it means explicit positioning was provided @@ -1046,10 +993,7 @@ function Element:layoutChildren() -- Get flex children (children that participate in flex layout) local flexChildren = {} for _, child in ipairs(self.children) do - -- Only flex positioned children or non-explicitly absolute children participate in flex layout - -- Relative positioned children maintain their own positioning local isFlexChild = not (child.positioning == Positioning.ABSOLUTE and child._explicitlyAbsolute) - and child.positioning ~= Positioning.RELATIVE if isFlexChild then table.insert(flexChildren, child) end diff --git a/testing/__tests__/01_absolute_positioning_basic_tests.lua b/testing/__tests__/01_absolute_positioning_basic_tests.lua index b49bbc6..63a2146 100644 --- a/testing/__tests__/01_absolute_positioning_basic_tests.lua +++ b/testing/__tests__/01_absolute_positioning_basic_tests.lua @@ -1,4 +1,4 @@ -package.path = package.path .. ";?.lua" +package.patheight = package.path .. ";?.lua" local luaunit = require("testing/luaunit") require("testing/loveStub") -- Required to mock LOVE functions @@ -25,8 +25,8 @@ function TestAbsolutePositioningBasic:testCreateElementWithAbsolutePositioning() local elem = Gui.new({ x = 100, y = 200, - w = 300, - h = 150, + width = 300, + height = 150, positioning = Positioning.ABSOLUTE, }) @@ -47,8 +47,8 @@ function TestAbsolutePositioningBasic:testDefaultAbsolutePositioning() local elem = Gui.new({ x = 50, y = 75, - w = 200, - h = 100, + width = 200, + height = 100, }) -- Default should be relative positioning @@ -62,8 +62,8 @@ function TestAbsolutePositioningBasic:testZIndexHandling() local elem1 = Gui.new({ x = 0, y = 0, - w = 100, - h = 100, + width = 100, + height = 100, z = 1, positioning = Positioning.ABSOLUTE, }) @@ -71,8 +71,8 @@ function TestAbsolutePositioningBasic:testZIndexHandling() local elem2 = Gui.new({ x = 50, y = 50, - w = 100, - h = 100, + width = 100, + height = 100, z = 5, positioning = Positioning.ABSOLUTE, }) @@ -80,8 +80,8 @@ function TestAbsolutePositioningBasic:testZIndexHandling() local elem3 = Gui.new({ x = 25, y = 25, - w = 100, - h = 100, + width = 100, + height = 100, z = 3, positioning = Positioning.ABSOLUTE, }) @@ -99,8 +99,8 @@ function TestAbsolutePositioningBasic:testDefaultZIndex() local elem = Gui.new({ x = 10, y = 20, - w = 50, - h = 50, + width = 50, + height = 50, positioning = Positioning.ABSOLUTE, }) @@ -112,16 +112,16 @@ function TestAbsolutePositioningBasic:testCoordinateIndependence() local elem1 = Gui.new({ x = 100, y = 100, - w = 50, - h = 50, + width = 50, + height = 50, positioning = Positioning.ABSOLUTE, }) local elem2 = Gui.new({ x = 200, y = 200, - w = 50, - h = 50, + width = 50, + height = 50, positioning = Positioning.ABSOLUTE, }) @@ -142,8 +142,8 @@ function TestAbsolutePositioningBasic:testAbsoluteWithParentIndependentCoordinat local parent = Gui.new({ x = 50, y = 50, - w = 200, - h = 200, + width = 200, + height = 200, positioning = Positioning.ABSOLUTE, }) @@ -151,8 +151,8 @@ function TestAbsolutePositioningBasic:testAbsoluteWithParentIndependentCoordinat parent = parent, x = 25, y = 25, - w = 50, - h = 50, + width = 50, + height = 50, positioning = Positioning.ABSOLUTE, }) @@ -174,8 +174,8 @@ function TestAbsolutePositioningBasic:testMultipleAbsoluteElementsNonInterferenc elements[i] = Gui.new({ x = i * 10, y = i * 20, - w = 30, - h = 40, + width = 30, + height = 40, z = i, positioning = Positioning.ABSOLUTE, }) @@ -198,8 +198,8 @@ function TestAbsolutePositioningBasic:testNegativeCoordinates() local elem = Gui.new({ x = -50, y = -100, - w = 200, - h = 150, + width = 200, + height = 150, positioning = Positioning.ABSOLUTE, }) @@ -212,8 +212,8 @@ function TestAbsolutePositioningBasic:testZeroCoordinates() local elem = Gui.new({ x = 0, y = 0, - w = 100, - h = 100, + width = 100, + height = 100, positioning = Positioning.ABSOLUTE, }) @@ -224,8 +224,8 @@ end -- Test 10: Default coordinates when not specified function TestAbsolutePositioningBasic:testDefaultCoordinates() local elem = Gui.new({ - w = 100, - h = 100, + width = 100, + height = 100, positioning = Positioning.ABSOLUTE, }) @@ -239,8 +239,8 @@ function TestAbsolutePositioningBasic:testElementBounds() local elem = Gui.new({ x = 100, y = 200, - w = 300, - h = 400, + width = 300, + height = 400, positioning = Positioning.ABSOLUTE, }) @@ -256,8 +256,8 @@ function TestAbsolutePositioningBasic:testParentChildRelationshipAbsolute() local parent = Gui.new({ x = 100, y = 100, - w = 300, - h = 300, + width = 300, + height = 300, positioning = Positioning.ABSOLUTE, }) @@ -265,8 +265,8 @@ function TestAbsolutePositioningBasic:testParentChildRelationshipAbsolute() parent = parent, x = 50, y = 75, - w = 100, - h = 150, + width = 100, + height = 150, positioning = Positioning.ABSOLUTE, }) @@ -288,15 +288,15 @@ function TestAbsolutePositioningBasic:testAbsoluteChildNoParentAutoSizeAffect() positioning = Positioning.ABSOLUTE, }) - local originalParentWidth = parent.width + local originalParentWidtheight = parent.width local originalParentHeight = parent.height local child = Gui.new({ parent = parent, x = 1000, -- Far outside parent y = 1000, - w = 500, - h = 500, + width = 500, + height = 500, positioning = Positioning.ABSOLUTE, }) @@ -311,16 +311,16 @@ function TestAbsolutePositioningBasic:testAbsoluteNoFlexParticipation() local flexParent = Gui.new({ x = 0, y = 0, - w = 400, - h = 200, + width = 400, + height = 200, positioning = Positioning.FLEX, flexDirection = enums.FlexDirection.HORIZONTAL, }) local flexChild = Gui.new({ parent = flexParent, - w = 100, - h = 50, + width = 100, + height = 50, positioning = Positioning.FLEX, }) @@ -328,8 +328,8 @@ function TestAbsolutePositioningBasic:testAbsoluteNoFlexParticipation() parent = flexParent, x = 300, y = 150, - w = 80, - h = 40, + width = 80, + height = 40, positioning = Positioning.ABSOLUTE, }) @@ -347,8 +347,8 @@ function TestAbsolutePositioningBasic:testLargeCoordinateValues() local elem = Gui.new({ x = 9999, y = 8888, - w = 100, - h = 100, + width = 100, + height = 100, z = 1000, positioning = Positioning.ABSOLUTE, }) @@ -372,8 +372,8 @@ function TestAbsolutePositioningBasic:testComplexNestedAbsoluteTree() id = "root", x = 100, y = 100, - w = 800, - h = 600, + width = 800, + height = 600, positioning = Positioning.ABSOLUTE, z = 1, }) @@ -384,8 +384,8 @@ function TestAbsolutePositioningBasic:testComplexNestedAbsoluteTree() id = "child1", x = 50, y = 50, - w = 300, - h = 400, + width = 300, + height = 400, positioning = Positioning.ABSOLUTE, z = 2, }) @@ -395,8 +395,8 @@ function TestAbsolutePositioningBasic:testComplexNestedAbsoluteTree() id = "grandchild1", x = 25, y = 25, - w = 150, - h = 200, + width = 150, + height = 200, positioning = Positioning.ABSOLUTE, z = 3, }) @@ -406,8 +406,8 @@ function TestAbsolutePositioningBasic:testComplexNestedAbsoluteTree() id = "greatGrandchild1", x = 10, y = 10, - w = 50, - h = 75, + width = 50, + height = 75, positioning = Positioning.ABSOLUTE, z = 4, }) @@ -418,8 +418,8 @@ function TestAbsolutePositioningBasic:testComplexNestedAbsoluteTree() id = "child2", x = 450, y = 50, - w = 300, - h = 400, + width = 300, + height = 400, positioning = Positioning.ABSOLUTE, z = 2, }) @@ -429,8 +429,8 @@ function TestAbsolutePositioningBasic:testComplexNestedAbsoluteTree() id = "grandchild2", x = 125, y = 175, - w = 150, - h = 200, + width = 150, + height = 200, positioning = Positioning.ABSOLUTE, z = 3, }) @@ -440,8 +440,8 @@ function TestAbsolutePositioningBasic:testComplexNestedAbsoluteTree() id = "greatGrandchild2", x = 90, y = 160, - w = 50, - h = 75, + width = 50, + height = 75, positioning = Positioning.ABSOLUTE, z = 4, }) @@ -487,8 +487,8 @@ function TestAbsolutePositioningBasic:testBinaryTreeAbsoluteStructure() id = "root", x = 400, y = 100, - w = 100, - h = 50, + width = 100, + height = 50, positioning = Positioning.ABSOLUTE, z = 1, }) @@ -499,8 +499,8 @@ function TestAbsolutePositioningBasic:testBinaryTreeAbsoluteStructure() id = "left", x = 200, y = 200, - w = 80, - h = 40, + width = 80, + height = 40, positioning = Positioning.ABSOLUTE, z = 2, }) @@ -510,8 +510,8 @@ function TestAbsolutePositioningBasic:testBinaryTreeAbsoluteStructure() id = "right", x = 600, y = 200, - w = 80, - h = 40, + width = 80, + height = 40, positioning = Positioning.ABSOLUTE, z = 2, }) @@ -522,8 +522,8 @@ function TestAbsolutePositioningBasic:testBinaryTreeAbsoluteStructure() id = "leftLeft", x = 100, y = 300, - w = 60, - h = 30, + width = 60, + height = 30, positioning = Positioning.ABSOLUTE, z = 3, }) @@ -533,8 +533,8 @@ function TestAbsolutePositioningBasic:testBinaryTreeAbsoluteStructure() id = "leftRight", x = 300, y = 300, - w = 60, - h = 30, + width = 60, + height = 30, positioning = Positioning.ABSOLUTE, z = 3, }) @@ -545,8 +545,8 @@ function TestAbsolutePositioningBasic:testBinaryTreeAbsoluteStructure() id = "rightLeft", x = 500, y = 300, - w = 60, - h = 30, + width = 60, + height = 30, positioning = Positioning.ABSOLUTE, z = 3, }) @@ -556,8 +556,8 @@ function TestAbsolutePositioningBasic:testBinaryTreeAbsoluteStructure() id = "rightRight", x = 700, y = 300, - w = 60, - h = 30, + width = 60, + height = 30, positioning = Positioning.ABSOLUTE, z = 3, }) @@ -588,8 +588,8 @@ function TestAbsolutePositioningBasic:testMultiBranchZIndexStacking() id = "container", x = 0, y = 0, - w = 1000, - h = 1000, + width = 1000, + height = 1000, positioning = Positioning.ABSOLUTE, z = 0, }) @@ -600,8 +600,8 @@ function TestAbsolutePositioningBasic:testMultiBranchZIndexStacking() id = "background", x = 100, y = 100, - w = 800, - h = 800, + width = 800, + height = 800, positioning = Positioning.ABSOLUTE, z = 1, }) @@ -612,8 +612,8 @@ function TestAbsolutePositioningBasic:testMultiBranchZIndexStacking() id = "middleParent", x = 200, y = 200, - w = 600, - h = 600, + width = 600, + height = 600, positioning = Positioning.ABSOLUTE, z = 5, }) @@ -623,8 +623,8 @@ function TestAbsolutePositioningBasic:testMultiBranchZIndexStacking() id = "middleChild1", x = 50, y = 50, - w = 200, - h = 200, + width = 200, + height = 200, positioning = Positioning.ABSOLUTE, z = 1, -- relative to middleParent }) @@ -634,8 +634,8 @@ function TestAbsolutePositioningBasic:testMultiBranchZIndexStacking() id = "middleChild2", x = 350, y = 350, - w = 200, - h = 200, + width = 200, + height = 200, positioning = Positioning.ABSOLUTE, z = 2, -- relative to middleParent, above middleChild1 }) @@ -646,8 +646,8 @@ function TestAbsolutePositioningBasic:testMultiBranchZIndexStacking() id = "foreground", x = 300, y = 300, - w = 400, - h = 400, + width = 400, + height = 400, positioning = Positioning.ABSOLUTE, z = 10, }) @@ -657,8 +657,8 @@ function TestAbsolutePositioningBasic:testMultiBranchZIndexStacking() id = "foregroundChild", x = 150, y = 150, - w = 100, - h = 100, + width = 100, + height = 100, positioning = Positioning.ABSOLUTE, z = 1, }) @@ -688,8 +688,8 @@ function TestAbsolutePositioningBasic:testWideShallowAbsoluteTree() id = "container", x = 0, y = 0, - w = 2000, - h = 500, + width = 2000, + height = 500, positioning = Positioning.ABSOLUTE, z = 0, }) @@ -702,8 +702,8 @@ function TestAbsolutePositioningBasic:testWideShallowAbsoluteTree() id = "sibling" .. i, x = i * 180, y = 100, - w = 150, - h = 300, + width = 150, + height = 300, positioning = Positioning.ABSOLUTE, z = i, -- Each has different z-index }) @@ -715,8 +715,8 @@ function TestAbsolutePositioningBasic:testWideShallowAbsoluteTree() id = "child" .. i .. "_" .. j, x = 25, y = j * 80, - w = 100, - h = 60, + width = 100, + height = 60, positioning = Positioning.ABSOLUTE, z = j, }) @@ -740,20 +740,20 @@ function TestAbsolutePositioningBasic:testAsymmetricAbsoluteTree() id = "root", x = 500, y = 100, - w = 200, - h = 100, + width = 200, + height = 100, positioning = Positioning.ABSOLUTE, z = 1, }) -- Left branch: deep nesting - local leftBranch = Gui.new({ + local leftBrancheight = Gui.new({ parent = root, id = "leftBranch", x = 100, y = 250, - w = 150, - h = 400, + width = 150, + height = 400, positioning = Positioning.ABSOLUTE, z = 2, }) @@ -763,8 +763,8 @@ function TestAbsolutePositioningBasic:testAsymmetricAbsoluteTree() id = "leftDeep1", x = 25, y = 50, - w = 100, - h = 80, + width = 100, + height = 80, positioning = Positioning.ABSOLUTE, z = 3, }) @@ -774,8 +774,8 @@ function TestAbsolutePositioningBasic:testAsymmetricAbsoluteTree() id = "leftDeep2", x = 10, y = 10, - w = 80, - h = 60, + width = 80, + height = 60, positioning = Positioning.ABSOLUTE, z = 4, }) @@ -785,20 +785,20 @@ function TestAbsolutePositioningBasic:testAsymmetricAbsoluteTree() id = "leftDeep3", x = 5, y = 5, - w = 70, - h = 50, + width = 70, + height = 50, positioning = Positioning.ABSOLUTE, z = 5, }) -- Right branch: wide shallow - local rightBranch = Gui.new({ + local rightBrancheight = Gui.new({ parent = root, id = "rightBranch", x = 800, y = 250, - w = 400, - h = 200, + width = 400, + height = 200, positioning = Positioning.ABSOLUTE, z = 2, }) @@ -810,8 +810,8 @@ function TestAbsolutePositioningBasic:testAsymmetricAbsoluteTree() id = "rightChild" .. i, x = i * 70, y = 50, - w = 60, - h = 100, + width = 60, + height = 100, positioning = Positioning.ABSOLUTE, z = i, }) @@ -839,8 +839,8 @@ function TestAbsolutePositioningBasic:testOverlappingNegativeCoordinates() id = "viewport", x = 500, y = 500, - w = 400, - h = 400, + width = 400, + height = 400, positioning = Positioning.ABSOLUTE, z = 0, }) @@ -851,8 +851,8 @@ function TestAbsolutePositioningBasic:testOverlappingNegativeCoordinates() id = "topLeft", x = -100, y = -100, - w = 200, - h = 200, + width = 200, + height = 200, positioning = Positioning.ABSOLUTE, z = 1, }) @@ -862,8 +862,8 @@ function TestAbsolutePositioningBasic:testOverlappingNegativeCoordinates() id = "topRight", x = 300, y = -50, - w = 200, - h = 150, + width = 200, + height = 150, positioning = Positioning.ABSOLUTE, z = 2, }) @@ -873,8 +873,8 @@ function TestAbsolutePositioningBasic:testOverlappingNegativeCoordinates() id = "bottomLeft", x = -50, y = 350, - w = 150, - h = 200, + width = 150, + height = 200, positioning = Positioning.ABSOLUTE, z = 3, }) @@ -884,8 +884,8 @@ function TestAbsolutePositioningBasic:testOverlappingNegativeCoordinates() id = "center", x = 150, y = 150, - w = 100, - h = 100, + width = 100, + height = 100, positioning = Positioning.ABSOLUTE, z = 10, -- Highest z-index }) @@ -912,8 +912,8 @@ function TestAbsolutePositioningBasic:testCircularPositioningPattern() id = "center", x = 400, y = 400, - w = 100, - h = 100, + width = 100, + height = 100, positioning = Positioning.ABSOLUTE, z = 1, }) @@ -932,8 +932,8 @@ function TestAbsolutePositioningBasic:testCircularPositioningPattern() id = "orbiter" .. i, x = math.floor(x), y = math.floor(y), - w = 50, - h = 50, + width = 50, + height = 50, positioning = Positioning.ABSOLUTE, z = i, }) @@ -944,8 +944,8 @@ function TestAbsolutePositioningBasic:testCircularPositioningPattern() id = "orbiterChild" .. i, x = 10, y = 10, - w = 30, - h = 30, + width = 30, + height = 30, positioning = Positioning.ABSOLUTE, z = 1, }) @@ -966,8 +966,8 @@ function TestAbsolutePositioningBasic:testDeepSingleBranchChain() id = "root", x = 100, y = 100, - w = 500, - h = 500, + width = 500, + height = 500, positioning = Positioning.ABSOLUTE, z = 1, }) @@ -979,8 +979,8 @@ function TestAbsolutePositioningBasic:testDeepSingleBranchChain() id = "depth" .. i, x = 10, y = 10, - w = math.max(50, 500 - (i * 25)), -- Decreasing width - h = math.max(50, 500 - (i * 25)), -- Decreasing height + width = math.max(50, 500 - (i * 25)), -- Decreasing width + height = math.max(50, 500 - (i * 25)), -- Decreasing height positioning = Positioning.ABSOLUTE, z = i, }) @@ -1011,8 +1011,8 @@ function TestAbsolutePositioningBasic:testComplexBranchingWithOverlaps() id = "desktop", x = 0, y = 0, - w = 1920, - h = 1080, + width = 1920, + height = 1080, positioning = Positioning.ABSOLUTE, z = 0, }) @@ -1023,8 +1023,8 @@ function TestAbsolutePositioningBasic:testComplexBranchingWithOverlaps() id = "taskbar", x = 0, y = 1040, - w = 1920, - h = 40, + width = 1920, + height = 40, positioning = Positioning.ABSOLUTE, z = 100, -- Always on top }) @@ -1035,8 +1035,8 @@ function TestAbsolutePositioningBasic:testComplexBranchingWithOverlaps() id = "window1", x = 100, y = 100, - w = 600, - h = 400, + width = 600, + height = 400, positioning = Positioning.ABSOLUTE, z = 10, }) @@ -1046,8 +1046,8 @@ function TestAbsolutePositioningBasic:testComplexBranchingWithOverlaps() id = "window2", x = 300, y = 200, - w = 500, - h = 350, + width = 500, + height = 350, positioning = Positioning.ABSOLUTE, z = 15, -- Above window1 }) @@ -1057,8 +1057,8 @@ function TestAbsolutePositioningBasic:testComplexBranchingWithOverlaps() id = "window3", x = 200, y = 150, - w = 400, - h = 300, + width = 400, + height = 300, positioning = Positioning.ABSOLUTE, z = 5, -- Behind window1 and window2 }) @@ -1070,8 +1070,8 @@ function TestAbsolutePositioningBasic:testComplexBranchingWithOverlaps() id = window.id .. "_titlebar", x = 0, y = 0, - w = window.width, - h = 30, + width = window.width, + height = 30, positioning = Positioning.ABSOLUTE, z = 1, }) @@ -1081,8 +1081,8 @@ function TestAbsolutePositioningBasic:testComplexBranchingWithOverlaps() id = window.id .. "_content", x = 0, y = 30, - w = window.width, - h = window.height - 30, + width = window.width, + height = window.height - 30, positioning = Positioning.ABSOLUTE, z = 1, }) @@ -1094,8 +1094,8 @@ function TestAbsolutePositioningBasic:testComplexBranchingWithOverlaps() id = window.id .. "_item" .. j, x = j * 50, y = j * 40, - w = 80, - h = 30, + width = 80, + height = 30, positioning = Positioning.ABSOLUTE, z = j, }) diff --git a/testing/__tests__/02_absolute_positioning_child_layout_tests.lua b/testing/__tests__/02_absolute_positioning_child_layout_tests.lua index b8306cc..15eb2f3 100644 --- a/testing/__tests__/02_absolute_positioning_child_layout_tests.lua +++ b/testing/__tests__/02_absolute_positioning_child_layout_tests.lua @@ -34,16 +34,16 @@ function TestAbsolutePositioningChildLayout:testAddChildToAbsoluteParent() positioning = Positioning.ABSOLUTE, x = 100, y = 50, - w = 200, - h = 150, + width = 200, + height = 150, }) local child = Gui.new({ id = "child", x = 10, y = 20, - w = 50, - h = 30, + width = 50, + height = 30, }) parent:addChild(child) @@ -61,24 +61,24 @@ function TestAbsolutePositioningChildLayout:testChildrenMaintainCoordinates() positioning = Positioning.ABSOLUTE, x = 100, y = 50, - w = 200, - h = 150, + width = 200, + height = 150, }) local child1 = Gui.new({ id = "child1", x = 10, y = 20, - w = 50, - h = 30, + width = 50, + height = 30, }) local child2 = Gui.new({ id = "child2", x = 75, y = 85, - w = 40, - h = 25, + width = 40, + height = 25, }) parent:addChild(child1) @@ -98,8 +98,8 @@ function TestAbsolutePositioningChildLayout:testAbsoluteParentSkipsLayoutChildre positioning = Positioning.ABSOLUTE, x = 100, y = 50, - w = 200, - h = 150, + width = 200, + height = 150, flexDirection = FlexDirection.HORIZONTAL, }) @@ -107,16 +107,16 @@ function TestAbsolutePositioningChildLayout:testAbsoluteParentSkipsLayoutChildre id = "child1", x = 10, y = 20, - w = 50, - h = 30, + width = 50, + height = 30, }) local child2 = Gui.new({ id = "child2", x = 200, -- Way beyond parent w - this would be repositioned in flex layout y = 300, - w = 40, - h = 25, + width = 40, + height = 25, }) parent:addChild(child1) @@ -137,8 +137,8 @@ function TestAbsolutePositioningChildLayout:testAbsoluteParentFlexPropertiesUnch positioning = Positioning.ABSOLUTE, x = 100, y = 50, - w = 200, - h = 150, + width = 200, + height = 150, flexDirection = FlexDirection.VERTICAL, justifyContent = JustifyContent.CENTER, alignItems = AlignItems.FLEX_END, @@ -148,8 +148,8 @@ function TestAbsolutePositioningChildLayout:testAbsoluteParentFlexPropertiesUnch id = "child", x = 10, y = 20, - w = 50, - h = 30, + width = 50, + height = 30, }) -- Store original values @@ -176,8 +176,8 @@ function TestAbsolutePositioningChildLayout:testMultipleChildrenIndependentPosit positioning = Positioning.ABSOLUTE, x = 0, y = 0, - w = 300, - h = 300, + width = 300, + height = 300, }) local children = {} @@ -186,8 +186,8 @@ function TestAbsolutePositioningChildLayout:testMultipleChildrenIndependentPosit id = "child" .. i, x = i * 25, y = i * 30, - w = 20, - h = 15, + width = 20, + height = 15, }) parent:addChild(children[i]) end @@ -209,16 +209,16 @@ function TestAbsolutePositioningChildLayout:testAbsoluteChildrenIgnoreFlexLayout positioning = Positioning.FLEX, x = 0, y = 0, - w = 300, - h = 100, + width = 300, + height = 100, flexDirection = FlexDirection.HORIZONTAL, justifyContent = JustifyContent.SPACE_BETWEEN, }) local flexChild = Gui.new({ id = "flex_child", - w = 50, - h = 30, + width = 50, + height = 30, }) local absoluteChild = Gui.new({ @@ -226,8 +226,8 @@ function TestAbsolutePositioningChildLayout:testAbsoluteChildrenIgnoreFlexLayout positioning = Positioning.ABSOLUTE, x = 200, y = 40, - w = 50, - h = 30, + width = 50, + height = 30, }) parent:addChild(flexChild) @@ -249,16 +249,16 @@ function TestAbsolutePositioningChildLayout:testChildCoordinatesIndependentOfPar positioning = Positioning.ABSOLUTE, x = 100, y = 50, - w = 200, - h = 150, + width = 200, + height = 150, }) local child = Gui.new({ id = "child", x = 25, y = 30, - w = 50, - h = 40, + width = 50, + height = 40, }) parent:addChild(child) @@ -279,8 +279,8 @@ function TestAbsolutePositioningChildLayout:testNestedAbsolutePositioning() positioning = Positioning.ABSOLUTE, x = 50, y = 25, - w = 400, - h = 300, + width = 400, + height = 300, }) local parent = Gui.new({ @@ -288,16 +288,16 @@ function TestAbsolutePositioningChildLayout:testNestedAbsolutePositioning() positioning = Positioning.ABSOLUTE, x = 75, y = 50, - w = 200, - h = 150, + width = 200, + height = 150, }) local child = Gui.new({ id = "child", x = 10, y = 20, - w = 50, - h = 30, + width = 50, + height = 30, }) grandparent:addChild(parent) @@ -320,15 +320,15 @@ function TestAbsolutePositioningChildLayout:testAbsoluteParentWithFlexChildren() positioning = Positioning.ABSOLUTE, x = 100, y = 50, - w = 200, - h = 150, + width = 200, + height = 150, }) local flexChild = Gui.new({ id = "flex_child", positioning = Positioning.FLEX, - w = 50, - h = 30, + width = 50, + height = 30, }) parent:addChild(flexChild) @@ -352,8 +352,8 @@ function TestAbsolutePositioningChildLayout:testAutoSizingWithAbsoluteParentAndC id = "child", x = 10, y = 20, - w = 50, - h = 30, + width = 50, + height = 30, }) parent:addChild(child) @@ -371,8 +371,8 @@ function TestAbsolutePositioningChildLayout:testChildrenPreservePositioningType( positioning = Positioning.ABSOLUTE, x = 100, y = 50, - w = 200, - h = 150, + width = 200, + height = 150, }) local absoluteChild = Gui.new({ @@ -380,15 +380,15 @@ function TestAbsolutePositioningChildLayout:testChildrenPreservePositioningType( positioning = Positioning.ABSOLUTE, x = 25, y = 30, - w = 50, - h = 40, + width = 50, + height = 40, }) local flexChild = Gui.new({ id = "flex_child", positioning = Positioning.FLEX, - w = 60, - h = 35, + width = 60, + height = 35, }) parent:addChild(absoluteChild) @@ -406,16 +406,16 @@ function TestAbsolutePositioningChildLayout:testParentChildCoordinateRelationshi positioning = Positioning.ABSOLUTE, x = 100, y = 50, - w = 200, - h = 150, + width = 200, + height = 150, }) local child = Gui.new({ id = "child", x = 25, y = 30, - w = 50, - h = 40, + width = 50, + height = 40, }) parent:addChild(child) @@ -434,8 +434,8 @@ function TestAbsolutePositioningChildLayout:testAddChildNoParentRepositioning() positioning = Positioning.ABSOLUTE, x = 150, y = 75, - w = 200, - h = 150, + width = 200, + height = 150, }) local originalX = parent.x @@ -445,8 +445,8 @@ function TestAbsolutePositioningChildLayout:testAddChildNoParentRepositioning() id = "child", x = 25, y = 30, - w = 50, - h = 40, + width = 50, + height = 40, }) parent:addChild(child) @@ -463,13 +463,13 @@ function TestAbsolutePositioningChildLayout:testChildrenTableMaintained() positioning = Positioning.ABSOLUTE, x = 100, y = 50, - w = 200, - h = 150, + width = 200, + height = 150, }) - local child1 = Gui.new({ id = "child1", x = 10, y = 20, w = 50, h = 30 }) - local child2 = Gui.new({ id = "child2", x = 70, y = 80, w = 40, h = 25 }) - local child3 = Gui.new({ id = "child3", x = 120, y = 90, w = 30, h = 35 }) + local child1 = Gui.new({ id = "child1", x = 10, y = 20, width = 50, height = 30 }) + local child2 = Gui.new({ id = "child2", x = 70, y = 80, width = 40, height = 25 }) + local child3 = Gui.new({ id = "child3", x = 120, y = 90, width = 30, height = 35 }) parent:addChild(child1) luaunit.assertEquals(#parent.children, 1) @@ -496,8 +496,8 @@ function TestAbsolutePositioningChildLayout:testAbsoluteParentMixedChildTypes() positioning = Positioning.ABSOLUTE, x = 100, y = 50, - w = 300, - h = 200, + width = 300, + height = 200, }) local absoluteChild = Gui.new({ @@ -505,15 +505,15 @@ function TestAbsolutePositioningChildLayout:testAbsoluteParentMixedChildTypes() positioning = Positioning.ABSOLUTE, x = 25, y = 30, - w = 50, - h = 40, + width = 50, + height = 40, }) local flexChild = Gui.new({ id = "flex_child", positioning = Positioning.FLEX, - w = 60, - h = 35, + width = 60, + height = 35, }) parent:addChild(absoluteChild) @@ -548,8 +548,8 @@ function TestAbsolutePositioningChildLayout:testDeepHierarchyMixedPositioning() positioning = Positioning.ABSOLUTE, x = 100, y = 100, - w = 800, - h = 600, + width = 800, + height = 600, }) local flexLevel1 = Gui.new({ @@ -559,8 +559,8 @@ function TestAbsolutePositioningChildLayout:testDeepHierarchyMixedPositioning() flexDirection = FlexDirection.HORIZONTAL, x = 50, -- Should be ignored due to flex positioning y = 50, - w = 700, - h = 500, + width = 700, + height = 500, gap = 20, }) @@ -571,24 +571,24 @@ function TestAbsolutePositioningChildLayout:testDeepHierarchyMixedPositioning() positioning = Positioning.ABSOLUTE, x = 600, -- Absolute position within flex parent y = 400, - w = 150, - h = 100, + width = 150, + height = 100, }) local flexChild1 = Gui.new({ parent = flexLevel1, id = "flexChild1", positioning = Positioning.FLEX, - w = 200, - h = 150, + width = 200, + height = 150, }) local flexChild2 = Gui.new({ parent = flexLevel1, id = "flexChild2", positioning = Positioning.FLEX, - w = 200, - h = 150, + width = 200, + height = 150, }) -- Add grandchildren to flex children @@ -598,16 +598,16 @@ function TestAbsolutePositioningChildLayout:testDeepHierarchyMixedPositioning() positioning = Positioning.ABSOLUTE, x = 75, y = 75, - w = 50, - h = 50, + width = 50, + height = 50, }) local flexGrandchild = Gui.new({ parent = flexChild2, id = "flexGrandchild", positioning = Positioning.FLEX, - w = 100, - h = 75, + width = 100, + height = 75, }) -- Verify hierarchy structure @@ -641,8 +641,8 @@ function TestAbsolutePositioningChildLayout:testMultiBranchAbsoluteWithMixedChil positioning = Positioning.ABSOLUTE, x = 0, y = 0, - w = 1200, - h = 800, + width = 1200, + height = 800, }) -- Left branch: Absolute parent with flex children @@ -652,8 +652,8 @@ function TestAbsolutePositioningChildLayout:testMultiBranchAbsoluteWithMixedChil positioning = Positioning.ABSOLUTE, x = 50, y = 50, - w = 500, - h = 700, + width = 500, + height = 700, }) -- Flex container within absolute parent @@ -662,8 +662,8 @@ function TestAbsolutePositioningChildLayout:testMultiBranchAbsoluteWithMixedChil id = "leftFlexContainer", positioning = Positioning.FLEX, flexDirection = FlexDirection.VERTICAL, - w = 400, - h = 600, + width = 400, + height = 600, gap = 15, }) @@ -673,8 +673,8 @@ function TestAbsolutePositioningChildLayout:testMultiBranchAbsoluteWithMixedChil parent = leftFlexContainer, id = "leftFlexChild" .. i, positioning = Positioning.FLEX, - w = 350, - h = 120, + width = 350, + height = 120, }) -- Each flex child has absolute grandchildren @@ -685,8 +685,8 @@ function TestAbsolutePositioningChildLayout:testMultiBranchAbsoluteWithMixedChil positioning = Positioning.ABSOLUTE, x = j * 100, y = 20, - w = 80, - h = 80, + width = 80, + height = 80, }) end end @@ -699,8 +699,8 @@ function TestAbsolutePositioningChildLayout:testMultiBranchAbsoluteWithMixedChil positioning = Positioning.ABSOLUTE, x = 450, y = i * 200, - w = 40, - h = 150, + width = 40, + height = 150, }) end @@ -711,8 +711,8 @@ function TestAbsolutePositioningChildLayout:testMultiBranchAbsoluteWithMixedChil positioning = Positioning.ABSOLUTE, x = 650, y = 50, - w = 500, - h = 700, + width = 500, + height = 700, }) local rightFlexContainer = Gui.new({ @@ -720,8 +720,8 @@ function TestAbsolutePositioningChildLayout:testMultiBranchAbsoluteWithMixedChil id = "rightFlexContainer", positioning = Positioning.FLEX, flexDirection = FlexDirection.HORIZONTAL, - w = 450, - h = 200, + width = 450, + height = 200, gap = 10, }) @@ -731,8 +731,8 @@ function TestAbsolutePositioningChildLayout:testMultiBranchAbsoluteWithMixedChil parent = rightFlexContainer, id = "rightFlexChild" .. i, positioning = Positioning.FLEX, - w = 130, - h = 180, + width = 130, + height = 180, }) -- Nested flex container @@ -741,8 +741,8 @@ function TestAbsolutePositioningChildLayout:testMultiBranchAbsoluteWithMixedChil id = "rightNestedFlex" .. i, positioning = Positioning.FLEX, flexDirection = FlexDirection.VERTICAL, - w = 120, - h = 170, + width = 120, + height = 170, gap = 5, }) @@ -752,8 +752,8 @@ function TestAbsolutePositioningChildLayout:testMultiBranchAbsoluteWithMixedChil parent = nestedFlex, id = "rightNestedChild" .. i .. "_" .. j, positioning = Positioning.FLEX, - w = 110, - h = 50, + width = 110, + height = 50, }) end end @@ -781,8 +781,8 @@ function TestAbsolutePositioningChildLayout:testCascadeAbsoluteWithZIndexConflic positioning = Positioning.ABSOLUTE, x = 0, y = 0, - w = 1000, - h = 1000, + width = 1000, + height = 1000, z = 0, }) @@ -795,8 +795,8 @@ function TestAbsolutePositioningChildLayout:testCascadeAbsoluteWithZIndexConflic positioning = Positioning.ABSOLUTE, x = i * 50, y = i * 50, - w = 600, - h = 600, + width = 600, + height = 600, z = 6 - i, -- Reverse z-index (layer1=5, layer2=4, etc.) }) @@ -808,8 +808,8 @@ function TestAbsolutePositioningChildLayout:testCascadeAbsoluteWithZIndexConflic positioning = Positioning.ABSOLUTE, x = j * 100, y = j * 100, - w = 200, - h = 200, + width = 200, + height = 200, z = j, -- Same z-index pattern across all layers }) @@ -821,8 +821,8 @@ function TestAbsolutePositioningChildLayout:testCascadeAbsoluteWithZIndexConflic positioning = Positioning.ABSOLUTE, x = k * 30, y = k * 30, - w = 50, - h = 50, + width = 50, + height = 50, z = k, }) end @@ -858,8 +858,8 @@ function TestAbsolutePositioningChildLayout:testGridStructureAbsolutePositioning positioning = Positioning.ABSOLUTE, x = 100, y = 100, - w = 800, - h = 600, + width = 800, + height = 600, }) local rows, cols = 4, 5 @@ -868,7 +868,7 @@ function TestAbsolutePositioningChildLayout:testGridStructureAbsolutePositioning -- Create grid cells local cells = {} - for row = 1, rows do + for rowidth = 1, rows do cells[row] = {} for col = 1, cols do local x = (col - 1) * (cellWidth + gap) @@ -880,8 +880,8 @@ function TestAbsolutePositioningChildLayout:testGridStructureAbsolutePositioning positioning = Positioning.ABSOLUTE, x = x, y = y, - w = cellWidth, - h = cellHeight, + width = cellWidth, + height = cellHeight, z = row * cols + col, -- Unique z-index for each cell }) @@ -892,8 +892,8 @@ function TestAbsolutePositioningChildLayout:testGridStructureAbsolutePositioning positioning = Positioning.ABSOLUTE, x = 0, y = 0, - w = cellWidth, - h = 30, + width = cellWidth, + height = 30, z = 1, }) @@ -903,8 +903,8 @@ function TestAbsolutePositioningChildLayout:testGridStructureAbsolutePositioning positioning = Positioning.ABSOLUTE, x = 5, y = 35, - w = cellWidth - 10, - h = cellHeight - 40, + width = cellWidth - 10, + height = cellHeight - 40, z = 1, }) @@ -916,8 +916,8 @@ function TestAbsolutePositioningChildLayout:testGridStructureAbsolutePositioning positioning = Positioning.ABSOLUTE, x = 10, y = i * 25, - w = cellWidth - 30, - h = 20, + width = cellWidth - 30, + height = 20, z = i, }) end @@ -927,7 +927,7 @@ function TestAbsolutePositioningChildLayout:testGridStructureAbsolutePositioning -- Verify grid structure luaunit.assertEquals(#grid.children, rows * cols) - for row = 1, rows do + for rowidth = 1, rows do for col = 1, cols do local cell = cells[row][col] local expectedX = (col - 1) * (cellWidth + gap) @@ -950,8 +950,8 @@ function TestAbsolutePositioningChildLayout:testComplexModalDialogSystem() positioning = Positioning.ABSOLUTE, x = 0, y = 0, - w = 1920, - h = 1080, + width = 1920, + height = 1080, z = 0, }) @@ -962,8 +962,8 @@ function TestAbsolutePositioningChildLayout:testComplexModalDialogSystem() positioning = Positioning.ABSOLUTE, x = 0, y = 0, - w = 1920, - h = 1080, + width = 1920, + height = 1080, z = 1, }) @@ -974,8 +974,8 @@ function TestAbsolutePositioningChildLayout:testComplexModalDialogSystem() positioning = Positioning.ABSOLUTE, x = 0, y = 0, - w = 1920, - h = 1080, + width = 1920, + height = 1080, z = 1000, -- High z-index for overlay }) @@ -986,8 +986,8 @@ function TestAbsolutePositioningChildLayout:testComplexModalDialogSystem() positioning = Positioning.ABSOLUTE, x = 460, -- Centered: (1920 - 1000) / 2 y = 290, -- Centered: (1080 - 500) / 2 - w = 1000, - h = 500, + width = 1000, + height = 500, z = 1001, }) @@ -998,8 +998,8 @@ function TestAbsolutePositioningChildLayout:testComplexModalDialogSystem() positioning = Positioning.ABSOLUTE, x = 0, y = 0, - w = 1000, - h = 50, + width = 1000, + height = 50, z = 1, }) @@ -1010,8 +1010,8 @@ function TestAbsolutePositioningChildLayout:testComplexModalDialogSystem() positioning = Positioning.ABSOLUTE, x = 0, y = 50, - w = 1000, - h = 400, + width = 1000, + height = 400, z = 1, }) @@ -1022,8 +1022,8 @@ function TestAbsolutePositioningChildLayout:testComplexModalDialogSystem() positioning = Positioning.ABSOLUTE, x = 0, y = 0, - w = 1000, - h = 40, + width = 1000, + height = 40, z = 2, }) @@ -1035,8 +1035,8 @@ function TestAbsolutePositioningChildLayout:testComplexModalDialogSystem() positioning = Positioning.ABSOLUTE, x = (i - 1) * 250, y = 0, - w = 250, - h = 40, + width = 250, + height = 40, z = i, }) end @@ -1048,8 +1048,8 @@ function TestAbsolutePositioningChildLayout:testComplexModalDialogSystem() positioning = Positioning.ABSOLUTE, x = 10, y = 50, - w = 980, - h = 340, + width = 980, + height = 340, z = 1, }) @@ -1060,8 +1060,8 @@ function TestAbsolutePositioningChildLayout:testComplexModalDialogSystem() positioning = Positioning.ABSOLUTE, x = 710, -- Offset from primary modal y = 340, - w = 500, - h = 400, + width = 500, + height = 400, z = 1002, -- Above primary modal }) @@ -1072,8 +1072,8 @@ function TestAbsolutePositioningChildLayout:testComplexModalDialogSystem() positioning = Positioning.ABSOLUTE, x = 0, y = 0, - w = 1920, - h = 1080, + width = 1920, + height = 1080, z = 2000, -- Highest z-index }) @@ -1083,8 +1083,8 @@ function TestAbsolutePositioningChildLayout:testComplexModalDialogSystem() positioning = Positioning.ABSOLUTE, x = 800, y = 600, - w = 200, - h = 50, + width = 200, + height = 50, z = 2001, }) @@ -1113,8 +1113,8 @@ function TestAbsolutePositioningChildLayout:testDynamicBranchingDOMStructure() positioning = Positioning.ABSOLUTE, x = 0, y = 0, - w = 1200, - h = 2000, + width = 1200, + height = 2000, z = 0, }) @@ -1125,8 +1125,8 @@ function TestAbsolutePositioningChildLayout:testDynamicBranchingDOMStructure() positioning = Positioning.ABSOLUTE, x = 0, y = 0, - w = 1200, - h = 100, + width = 1200, + height = 100, z = 10, }) @@ -1137,8 +1137,8 @@ function TestAbsolutePositioningChildLayout:testDynamicBranchingDOMStructure() positioning = Positioning.ABSOLUTE, x = 100, y = 20, - w = 1000, - h = 60, + width = 1000, + height = 60, z = 1, }) @@ -1150,8 +1150,8 @@ function TestAbsolutePositioningChildLayout:testDynamicBranchingDOMStructure() positioning = Positioning.ABSOLUTE, x = (i - 1) * 200, y = 0, - w = 180, - h = 60, + width = 180, + height = 60, z = i, }) @@ -1163,8 +1163,8 @@ function TestAbsolutePositioningChildLayout:testDynamicBranchingDOMStructure() positioning = Positioning.ABSOLUTE, x = 0, y = 60, - w = 180, - h = 200, + width = 180, + height = 200, z = 100, -- High z-index for dropdown }) @@ -1176,8 +1176,8 @@ function TestAbsolutePositioningChildLayout:testDynamicBranchingDOMStructure() positioning = Positioning.ABSOLUTE, x = 0, y = (j - 1) * 50, - w = 180, - h = 50, + width = 180, + height = 50, z = j, }) end @@ -1191,8 +1191,8 @@ function TestAbsolutePositioningChildLayout:testDynamicBranchingDOMStructure() positioning = Positioning.ABSOLUTE, x = 0, y = 100, - w = 1200, - h = 1700, + width = 1200, + height = 1700, z = 1, }) @@ -1203,8 +1203,8 @@ function TestAbsolutePositioningChildLayout:testDynamicBranchingDOMStructure() positioning = Positioning.ABSOLUTE, x = 0, y = 0, - w = 300, - h = 1700, + width = 300, + height = 1700, z = 2, }) @@ -1216,8 +1216,8 @@ function TestAbsolutePositioningChildLayout:testDynamicBranchingDOMStructure() positioning = Positioning.ABSOLUTE, x = 10, y = (i - 1) * 280 + 10, - w = 280, - h = 260, + width = 280, + height = 260, z = i, }) @@ -1228,8 +1228,8 @@ function TestAbsolutePositioningChildLayout:testDynamicBranchingDOMStructure() positioning = Positioning.ABSOLUTE, x = 0, y = 0, - w = 280, - h = 40, + width = 280, + height = 40, z = 1, }) @@ -1240,8 +1240,8 @@ function TestAbsolutePositioningChildLayout:testDynamicBranchingDOMStructure() positioning = Positioning.ABSOLUTE, x = 5, y = 45, - w = 270, - h = 210, + width = 270, + height = 210, z = 1, }) @@ -1253,8 +1253,8 @@ function TestAbsolutePositioningChildLayout:testDynamicBranchingDOMStructure() positioning = Positioning.ABSOLUTE, x = 5, y = (j - 1) * 50, - w = 260, - h = 45, + width = 260, + height = 45, z = j, }) end @@ -1267,8 +1267,8 @@ function TestAbsolutePositioningChildLayout:testDynamicBranchingDOMStructure() positioning = Positioning.ABSOLUTE, x = 320, y = 0, - w = 880, - h = 1700, + width = 880, + height = 1700, z = 1, }) @@ -1280,8 +1280,8 @@ function TestAbsolutePositioningChildLayout:testDynamicBranchingDOMStructure() positioning = Positioning.ABSOLUTE, x = 20, y = (i - 1) * 550 + 20, - w = 840, - h = 500, + width = 840, + height = 500, z = i, }) @@ -1292,8 +1292,8 @@ function TestAbsolutePositioningChildLayout:testDynamicBranchingDOMStructure() positioning = Positioning.ABSOLUTE, x = 0, y = 0, - w = 840, - h = 80, + width = 840, + height = 80, z = 1, }) @@ -1303,8 +1303,8 @@ function TestAbsolutePositioningChildLayout:testDynamicBranchingDOMStructure() positioning = Positioning.ABSOLUTE, x = 0, y = 80, - w = 840, - h = 350, + width = 840, + height = 350, z = 1, }) @@ -1314,8 +1314,8 @@ function TestAbsolutePositioningChildLayout:testDynamicBranchingDOMStructure() positioning = Positioning.ABSOLUTE, x = 0, y = 430, - w = 840, - h = 70, + width = 840, + height = 70, z = 1, }) @@ -1327,8 +1327,8 @@ function TestAbsolutePositioningChildLayout:testDynamicBranchingDOMStructure() positioning = Positioning.ABSOLUTE, x = 20, y = 50 + (j - 1) * 100, - w = 800, - h = 80, + width = 800, + height = 80, z = j, }) end @@ -1341,8 +1341,8 @@ function TestAbsolutePositioningChildLayout:testDynamicBranchingDOMStructure() positioning = Positioning.ABSOLUTE, x = 0, y = 1800, - w = 1200, - h = 200, + width = 1200, + height = 200, z = 10, }) @@ -1381,4 +1381,3 @@ end -- Run the tests luaunit.LuaUnit.run() - diff --git a/testing/__tests__/03_flex_direction_horizontal_tests.lua b/testing/__tests__/03_flex_direction_horizontal_tests.lua index 7d53b3e..ce337ab 100644 --- a/testing/__tests__/03_flex_direction_horizontal_tests.lua +++ b/testing/__tests__/03_flex_direction_horizontal_tests.lua @@ -34,8 +34,8 @@ function TestHorizontalFlexDirection:testCreateElementWithHorizontalFlexDirectio flexDirection = FlexDirection.HORIZONTAL, x = 0, y = 0, - w = 300, - h = 100, + width = 300, + height = 100, }) -- Verify element was created with correct properties @@ -52,8 +52,8 @@ function TestHorizontalFlexDirection:testDefaultFlexDirectionIsHorizontal() positioning = Positioning.FLEX, x = 0, y = 0, - w = 300, - h = 100, + width = 300, + height = 100, }) -- Default flex direction should be horizontal @@ -68,26 +68,26 @@ function TestHorizontalFlexDirection:testChildrenPositionedHorizontally() flexDirection = FlexDirection.HORIZONTAL, x = 0, y = 0, - w = 300, - h = 100, + width = 300, + height = 100, }) local child1 = Gui.new({ id = "child1", - w = 50, - h = 30, + width = 50, + height = 30, }) local child2 = Gui.new({ id = "child2", - w = 60, - h = 40, + width = 60, + height = 40, }) local child3 = Gui.new({ id = "child3", - w = 40, - h = 35, + width = 40, + height = 35, }) parent:addChild(child1) @@ -121,20 +121,20 @@ function TestHorizontalFlexDirection:testHorizontalLayoutWithGap() gap = 20, -- Custom gap x = 0, y = 0, - w = 300, - h = 100, + width = 300, + height = 100, }) local child1 = Gui.new({ id = "child1", - w = 50, - h = 30, + width = 50, + height = 30, }) local child2 = Gui.new({ id = "child2", - w = 60, - h = 40, + width = 60, + height = 40, }) parent:addChild(child1) @@ -155,20 +155,20 @@ function TestHorizontalFlexDirection:testHorizontalLayoutFlexStart() justifyContent = JustifyContent.FLEX_START, x = 0, y = 0, - w = 300, - h = 100, + width = 300, + height = 100, }) local child1 = Gui.new({ id = "child1", - w = 50, - h = 30, + width = 50, + height = 30, }) local child2 = Gui.new({ id = "child2", - w = 60, - h = 40, + width = 60, + height = 40, }) parent:addChild(child1) @@ -188,21 +188,21 @@ function TestHorizontalFlexDirection:testHorizontalLayoutCenter() justifyContent = JustifyContent.CENTER, x = 0, y = 0, - w = 300, - h = 100, + width = 300, + height = 100, gap = 10, }) local child1 = Gui.new({ id = "child1", - w = 50, - h = 30, + width = 50, + height = 30, }) local child2 = Gui.new({ id = "child2", - w = 60, - h = 40, + width = 60, + height = 40, }) parent:addChild(child1) @@ -226,21 +226,21 @@ function TestHorizontalFlexDirection:testHorizontalLayoutFlexEnd() justifyContent = JustifyContent.FLEX_END, x = 0, y = 0, - w = 300, - h = 100, + width = 300, + height = 100, gap = 10, }) local child1 = Gui.new({ id = "child1", - w = 50, - h = 30, + width = 50, + height = 30, }) local child2 = Gui.new({ id = "child2", - w = 60, - h = 40, + width = 60, + height = 40, }) parent:addChild(child1) @@ -263,27 +263,27 @@ function TestHorizontalFlexDirection:testHorizontalLayoutSpaceBetween() justifyContent = JustifyContent.SPACE_BETWEEN, x = 0, y = 0, - w = 300, - h = 100, + width = 300, + height = 100, gap = 0, -- Space-between doesn't use gap, it distributes available space }) local child1 = Gui.new({ id = "child1", - w = 50, - h = 30, + width = 50, + height = 30, }) local child2 = Gui.new({ id = "child2", - w = 60, - h = 40, + width = 60, + height = 40, }) local child3 = Gui.new({ id = "child3", - w = 40, - h = 35, + width = 40, + height = 35, }) parent:addChild(child1) @@ -309,14 +309,14 @@ function TestHorizontalFlexDirection:testSingleChildHorizontalLayout() justifyContent = JustifyContent.CENTER, x = 10, y = 20, - w = 300, - h = 100, + width = 300, + height = 100, }) local child = Gui.new({ id = "single_child", - w = 50, - h = 30, + width = 50, + height = 30, }) parent:addChild(child) @@ -335,8 +335,8 @@ function TestHorizontalFlexDirection:testEmptyParentHorizontalLayout() flexDirection = FlexDirection.HORIZONTAL, x = 0, y = 0, - w = 300, - h = 100, + width = 300, + height = 100, }) -- No children added @@ -354,20 +354,20 @@ function TestHorizontalFlexDirection:testHorizontalLayoutCoordinateSystem() flexDirection = FlexDirection.HORIZONTAL, x = 100, y = 50, - w = 300, - h = 100, + width = 300, + height = 100, }) local child1 = Gui.new({ id = "child1", - w = 50, - h = 30, + width = 50, + height = 30, }) local child2 = Gui.new({ id = "child2", - w = 60, - h = 40, + width = 60, + height = 40, }) parent:addChild(child1) @@ -390,20 +390,20 @@ function TestHorizontalFlexDirection:testHorizontalLayoutMaintainsChildHeights() alignItems = AlignItems.FLEX_START, -- Explicitly set to maintain child heights x = 0, y = 0, - w = 300, - h = 100, + width = 300, + height = 100, }) local child1 = Gui.new({ id = "child1", - w = 50, - h = 30, + width = 50, + height = 30, }) local child2 = Gui.new({ id = "child2", - w = 60, - h = 70, -- Different height + width = 60, + height = 70, -- Different height }) parent:addChild(child1) @@ -423,20 +423,20 @@ function TestHorizontalFlexDirection:testHorizontalLayoutAlignItemsStretch() alignItems = AlignItems.STRETCH, x = 0, y = 0, - w = 300, - h = 100, + width = 300, + height = 100, }) local child1 = Gui.new({ id = "child1", - w = 50, - h = 30, + width = 50, + height = 30, }) local child2 = Gui.new({ id = "child2", - w = 60, - h = 40, + width = 60, + height = 40, }) parent:addChild(child1) @@ -456,20 +456,20 @@ function TestHorizontalFlexDirection:testHorizontalLayoutAlignItemsCenter() alignItems = AlignItems.CENTER, x = 0, y = 0, - w = 300, - h = 100, + width = 300, + height = 100, }) local child1 = Gui.new({ id = "child1", - w = 50, - h = 30, + width = 50, + height = 30, }) local child2 = Gui.new({ id = "child2", - w = 60, - h = 40, + width = 60, + height = 40, }) parent:addChild(child1) @@ -492,20 +492,20 @@ function TestHorizontalFlexDirection:testHorizontalLayoutAlignItemsFlexEnd() alignItems = AlignItems.FLEX_END, x = 0, y = 0, - w = 300, - h = 100, + width = 300, + height = 100, }) local child1 = Gui.new({ id = "child1", - w = 50, - h = 30, + width = 50, + height = 30, }) local child2 = Gui.new({ id = "child2", - w = 60, - h = 40, + width = 60, + height = 40, }) parent:addChild(child1) @@ -537,8 +537,8 @@ function TestHorizontalFlexDirection:testNestedHorizontalFlexContainers() justifyContent = JustifyContent.SPACE_BETWEEN, x = 0, y = 0, - w = 1200, - h = 300, + width = 1200, + height = 300, gap = 20, }) @@ -550,8 +550,8 @@ function TestHorizontalFlexDirection:testNestedHorizontalFlexContainers() positioning = Positioning.FLEX, flexDirection = FlexDirection.HORIZONTAL, justifyContent = JustifyContent.CENTER, - w = 350, - h = 280, + width = 350, + height = 280, gap = 10, }) @@ -561,8 +561,8 @@ function TestHorizontalFlexDirection:testNestedHorizontalFlexContainers() parent = innerContainer, id = "item" .. i .. "_" .. j, positioning = Positioning.FLEX, - w = 70, - h = 120, + width = 70, + height = 120, }) end end @@ -594,8 +594,8 @@ function TestHorizontalFlexDirection:testComplexGridLayoutNestedHorizontalFlex() flexDirection = FlexDirection.VERTICAL, x = 0, y = 0, - w = 1000, - h = 800, + width = 1000, + height = 800, gap = 15, }) @@ -607,8 +607,8 @@ function TestHorizontalFlexDirection:testComplexGridLayoutNestedHorizontalFlex() positioning = Positioning.FLEX, flexDirection = FlexDirection.HORIZONTAL, justifyContent = JustifyContent.SPACE_EVENLY, - w = 980, - h = 180, + width = 980, + height = 180, gap = 12, }) @@ -622,8 +622,8 @@ function TestHorizontalFlexDirection:testComplexGridLayoutNestedHorizontalFlex() flexDirection = FlexDirection.HORIZONTAL, justifyContent = JustifyContent.CENTER, alignItems = AlignItems.CENTER, - w = (980 - (colCount - 1) * 12) / colCount, -- Dynamic width - h = 160, + width = (980 - (colCount - 1) * 12) / colCount, -- Dynamic width + height = 160, }) -- Each cell contains a nested horizontal layout with icons @@ -632,8 +632,8 @@ function TestHorizontalFlexDirection:testComplexGridLayoutNestedHorizontalFlex() parent = cell, id = "icon" .. row .. "_" .. col .. "_" .. icon, positioning = Positioning.FLEX, - w = 30, - h = 30, + width = 30, + height = 30, }) end end @@ -667,8 +667,8 @@ function TestHorizontalFlexDirection:testHorizontalFlexWithMixedPositioningChild justifyContent = JustifyContent.FLEX_START, x = 100, y = 100, - w = 800, - h = 200, + width = 800, + height = 200, gap = 20, }) @@ -677,24 +677,24 @@ function TestHorizontalFlexDirection:testHorizontalFlexWithMixedPositioningChild parent = flexContainer, id = "flexChild1", positioning = Positioning.FLEX, - w = 150, - h = 180, + width = 150, + height = 180, }) local flexChild2 = Gui.new({ parent = flexContainer, id = "flexChild2", positioning = Positioning.FLEX, - w = 150, - h = 180, + width = 150, + height = 180, }) local flexChild3 = Gui.new({ parent = flexContainer, id = "flexChild3", positioning = Positioning.FLEX, - w = 150, - h = 180, + width = 150, + height = 180, }) -- Add absolute positioned children (should not participate in flex layout) @@ -704,8 +704,8 @@ function TestHorizontalFlexDirection:testHorizontalFlexWithMixedPositioningChild positioning = Positioning.ABSOLUTE, x = 600, y = 50, - w = 100, - h = 100, + width = 100, + height = 100, }) local absoluteChild2 = Gui.new({ @@ -714,8 +714,8 @@ function TestHorizontalFlexDirection:testHorizontalFlexWithMixedPositioningChild positioning = Positioning.ABSOLUTE, x = 650, y = 75, - w = 80, - h = 80, + width = 80, + height = 80, }) -- Add nested flex containers within flex children @@ -726,8 +726,8 @@ function TestHorizontalFlexDirection:testHorizontalFlexWithMixedPositioningChild positioning = Positioning.FLEX, flexDirection = FlexDirection.HORIZONTAL, justifyContent = JustifyContent.CENTER, - w = 140, - h = 170, + width = 140, + height = 170, gap = 5, }) @@ -737,8 +737,8 @@ function TestHorizontalFlexDirection:testHorizontalFlexWithMixedPositioningChild parent = nestedFlex, id = "nestedItem" .. i .. "_" .. j, positioning = Positioning.FLEX, - w = 60, - h = 80, + width = 60, + height = 80, }) end @@ -749,8 +749,8 @@ function TestHorizontalFlexDirection:testHorizontalFlexWithMixedPositioningChild positioning = Positioning.ABSOLUTE, x = 120, y = 150, - w = 25, - h = 25, + width = 25, + height = 25, }) end @@ -787,8 +787,8 @@ function TestHorizontalFlexDirection:testMultiLevelHorizontalFlexNavigation() flexDirection = FlexDirection.VERTICAL, x = 0, y = 0, - w = 1200, - h = 400, + width = 1200, + height = 400, gap = 0, }) @@ -799,8 +799,8 @@ function TestHorizontalFlexDirection:testMultiLevelHorizontalFlexNavigation() positioning = Positioning.FLEX, flexDirection = FlexDirection.HORIZONTAL, justifyContent = JustifyContent.SPACE_BETWEEN, - w = 1200, - h = 60, + width = 1200, + height = 60, gap = 0, }) @@ -811,8 +811,8 @@ function TestHorizontalFlexDirection:testMultiLevelHorizontalFlexNavigation() parent = primaryNav, id = "primaryItem" .. i, positioning = Positioning.FLEX, - w = 240, - h = 60, + width = 240, + height = 60, }) -- Some primary items have secondary navigation @@ -823,8 +823,8 @@ function TestHorizontalFlexDirection:testMultiLevelHorizontalFlexNavigation() positioning = Positioning.FLEX, flexDirection = FlexDirection.HORIZONTAL, justifyContent = JustifyContent.CENTER, - w = 240, - h = 40, + width = 240, + height = 40, gap = 5, }) @@ -835,8 +835,8 @@ function TestHorizontalFlexDirection:testMultiLevelHorizontalFlexNavigation() parent = secondaryNav, id = "secondaryItem" .. i .. "_" .. j, positioning = Positioning.FLEX, - w = (240 - (secCount - 1) * 5) / secCount, - h = 35, + width = (240 - (secCount - 1) * 5) / secCount, + height = 35, }) -- Tertiary items for some secondary items @@ -847,8 +847,8 @@ function TestHorizontalFlexDirection:testMultiLevelHorizontalFlexNavigation() positioning = Positioning.FLEX, flexDirection = FlexDirection.HORIZONTAL, justifyContent = JustifyContent.SPACE_EVENLY, - w = (240 - (secCount - 1) * 5) / secCount, - h = 25, + width = (240 - (secCount - 1) * 5) / secCount, + height = 25, gap = 2, }) @@ -858,8 +858,8 @@ function TestHorizontalFlexDirection:testMultiLevelHorizontalFlexNavigation() parent = tertiaryNav, id = "tertiaryItem" .. i .. "_" .. j .. "_" .. k, positioning = Positioning.FLEX, - w = ((240 - (secCount - 1) * 5) / secCount - 2) / 2, - h = 20, + width = ((240 - (secCount - 1) * 5) / secCount - 2) / 2, + height = 20, }) end end @@ -874,8 +874,8 @@ function TestHorizontalFlexDirection:testMultiLevelHorizontalFlexNavigation() positioning = Positioning.FLEX, flexDirection = FlexDirection.HORIZONTAL, justifyContent = JustifyContent.CENTER, - w = 1200, - h = 50, + width = 1200, + height = 50, gap = 30, }) @@ -885,8 +885,8 @@ function TestHorizontalFlexDirection:testMultiLevelHorizontalFlexNavigation() parent = secondaryNavBar, id = "breadcrumb" .. i, positioning = Positioning.FLEX, - w = 120, - h = 40, + width = 120, + height = 40, }) end @@ -919,8 +919,8 @@ function TestHorizontalFlexDirection:testHorizontalFlexCardLayoutDynamicSizing() justifyContent = JustifyContent.SPACE_AROUND, x = 50, y = 50, - w = 1400, - h = 600, + width = 1400, + height = 600, gap = 25, }) @@ -939,8 +939,8 @@ function TestHorizontalFlexDirection:testHorizontalFlexCardLayoutDynamicSizing() id = "card" .. i, positioning = Positioning.FLEX, flexDirection = FlexDirection.VERTICAL, - w = config.width, - h = 550, + width = config.width, + height = 550, gap = 10, }) @@ -951,8 +951,8 @@ function TestHorizontalFlexDirection:testHorizontalFlexCardLayoutDynamicSizing() positioning = Positioning.FLEX, flexDirection = FlexDirection.HORIZONTAL, justifyContent = JustifyContent.SPACE_BETWEEN, - w = config.width - 20, - h = 50, + width = config.width - 20, + height = 50, gap = 10, }) @@ -961,8 +961,8 @@ function TestHorizontalFlexDirection:testHorizontalFlexCardLayoutDynamicSizing() parent = cardHeader, id = "cardTitle" .. i, positioning = Positioning.FLEX, - w = (config.width - 30) * 0.7, - h = 40, + width = (config.width - 30) * 0.7, + height = 40, }) local headerActions = Gui.new({ @@ -971,8 +971,8 @@ function TestHorizontalFlexDirection:testHorizontalFlexCardLayoutDynamicSizing() positioning = Positioning.FLEX, flexDirection = FlexDirection.HORIZONTAL, justifyContent = JustifyContent.FLEX_END, - w = (config.width - 30) * 0.3, - h = 40, + width = (config.width - 30) * 0.3, + height = 40, gap = 5, }) @@ -982,8 +982,8 @@ function TestHorizontalFlexDirection:testHorizontalFlexCardLayoutDynamicSizing() parent = headerActions, id = "actionBtn" .. i .. "_" .. j, positioning = Positioning.FLEX, - w = ((config.width - 30) * 0.3 - 5) / 2, - h = 35, + width = ((config.width - 30) * 0.3 - 5) / 2, + height = 35, }) end @@ -993,8 +993,8 @@ function TestHorizontalFlexDirection:testHorizontalFlexCardLayoutDynamicSizing() parent = card, id = "cardImage" .. i, positioning = Positioning.FLEX, - w = config.width - 20, - h = 200, + width = config.width - 20, + height = 200, }) end @@ -1004,8 +1004,8 @@ function TestHorizontalFlexDirection:testHorizontalFlexCardLayoutDynamicSizing() id = "cardContent" .. i, positioning = Positioning.FLEX, flexDirection = FlexDirection.VERTICAL, - w = config.width - 20, - h = config.hasImage and 240 or 440, + width = config.width - 20, + height = config.hasImage and 240 or 440, gap = 8, }) @@ -1017,8 +1017,8 @@ function TestHorizontalFlexDirection:testHorizontalFlexCardLayoutDynamicSizing() positioning = Positioning.FLEX, flexDirection = FlexDirection.HORIZONTAL, justifyContent = JustifyContent.FLEX_START, - w = config.width - 40, - h = (config.hasImage and 230 or 430) / config.items - 8, + width = config.width - 40, + height = (config.hasImage and 230 or 430) / config.items - 8, gap = 10, }) @@ -1027,16 +1027,16 @@ function TestHorizontalFlexDirection:testHorizontalFlexCardLayoutDynamicSizing() parent = contentItem, id = "itemIcon" .. i .. "_" .. j, positioning = Positioning.FLEX, - w = 30, - h = (config.hasImage and 230 or 430) / config.items - 8, + width = 30, + height = (config.hasImage and 230 or 430) / config.items - 8, }) Gui.new({ parent = contentItem, id = "itemText" .. i .. "_" .. j, positioning = Positioning.FLEX, - w = config.width - 80, - h = (config.hasImage and 230 or 430) / config.items - 8, + width = config.width - 80, + height = (config.hasImage and 230 or 430) / config.items - 8, }) end @@ -1047,8 +1047,8 @@ function TestHorizontalFlexDirection:testHorizontalFlexCardLayoutDynamicSizing() positioning = Positioning.FLEX, flexDirection = FlexDirection.HORIZONTAL, justifyContent = JustifyContent.CENTER, - w = config.width - 20, - h = 50, + width = config.width - 20, + height = 50, gap = 15, }) @@ -1058,8 +1058,8 @@ function TestHorizontalFlexDirection:testHorizontalFlexCardLayoutDynamicSizing() parent = cardFooter, id = "footerBtn" .. i .. "_" .. j, positioning = Positioning.FLEX, - w = (config.width - 50) / 3, - h = 40, + width = (config.width - 50) / 3, + height = 40, }) end end @@ -1106,8 +1106,8 @@ function TestHorizontalFlexDirection:testHorizontalFlexOverflowScrolling() positioning = Positioning.ABSOLUTE, x = 100, y = 100, - w = 800, - h = 200, + width = 800, + height = 200, }) -- Content container (wider than viewport) @@ -1119,8 +1119,8 @@ function TestHorizontalFlexDirection:testHorizontalFlexOverflowScrolling() justifyContent = JustifyContent.FLEX_START, x = 0, -- This would change with scrolling y = 0, - w = 2000, -- Wider than scroll container - h = 180, + width = 2000, -- Wider than scroll container + height = 180, gap = 20, }) @@ -1130,8 +1130,8 @@ function TestHorizontalFlexDirection:testHorizontalFlexOverflowScrolling() parent = contentContainer, id = "scrollItem" .. i, positioning = Positioning.FLEX, - w = 120, - h = 160, + width = 120, + height = 160, }) -- Each item has internal horizontal layout @@ -1141,8 +1141,8 @@ function TestHorizontalFlexDirection:testHorizontalFlexOverflowScrolling() positioning = Positioning.FLEX, flexDirection = FlexDirection.HORIZONTAL, justifyContent = JustifyContent.CENTER, - w = 110, - h = 150, + width = 110, + height = 150, gap = 5, }) @@ -1153,8 +1153,8 @@ function TestHorizontalFlexDirection:testHorizontalFlexOverflowScrolling() id = "component" .. i .. "_" .. j, positioning = Positioning.FLEX, flexDirection = FlexDirection.VERTICAL, - w = 50, - h = 140, + width = 50, + height = 140, gap = 3, }) @@ -1164,8 +1164,8 @@ function TestHorizontalFlexDirection:testHorizontalFlexOverflowScrolling() parent = component, id = "subComponent" .. i .. "_" .. j .. "_" .. k, positioning = Positioning.FLEX, - w = 45, - h = 42, + width = 45, + height = 42, }) end end @@ -1203,8 +1203,8 @@ function TestHorizontalFlexDirection:testComplexHorizontalDashboardLayout() flexDirection = FlexDirection.VERTICAL, x = 0, y = 0, - w = 1600, - h = 1000, + width = 1600, + height = 1000, gap = 0, }) @@ -1215,8 +1215,8 @@ function TestHorizontalFlexDirection:testComplexHorizontalDashboardLayout() positioning = Positioning.FLEX, flexDirection = FlexDirection.HORIZONTAL, justifyContent = JustifyContent.SPACE_BETWEEN, - w = 1600, - h = 80, + width = 1600, + height = 80, gap = 20, }) @@ -1227,8 +1227,8 @@ function TestHorizontalFlexDirection:testComplexHorizontalDashboardLayout() positioning = Positioning.FLEX, flexDirection = FlexDirection.HORIZONTAL, justifyContent = JustifyContent.FLEX_START, - w = 400, - h = 60, + width = 400, + height = 60, gap = 15, }) @@ -1237,16 +1237,16 @@ function TestHorizontalFlexDirection:testComplexHorizontalDashboardLayout() parent = headerLeft, id = "logo", positioning = Positioning.FLEX, - w = 60, - h = 60, + width = 60, + height = 60, }) Gui.new({ parent = headerLeft, id = "title", positioning = Positioning.FLEX, - w = 300, - h = 60, + width = 300, + height = 60, }) -- Header center - search and navigation @@ -1256,8 +1256,8 @@ function TestHorizontalFlexDirection:testComplexHorizontalDashboardLayout() positioning = Positioning.FLEX, flexDirection = FlexDirection.HORIZONTAL, justifyContent = JustifyContent.CENTER, - w = 800, - h = 60, + width = 800, + height = 60, gap = 20, }) @@ -1266,8 +1266,8 @@ function TestHorizontalFlexDirection:testComplexHorizontalDashboardLayout() parent = headerCenter, id = "searchBar", positioning = Positioning.FLEX, - w = 400, - h = 50, + width = 400, + height = 50, }) -- Quick actions @@ -1277,8 +1277,8 @@ function TestHorizontalFlexDirection:testComplexHorizontalDashboardLayout() positioning = Positioning.FLEX, flexDirection = FlexDirection.HORIZONTAL, justifyContent = JustifyContent.SPACE_EVENLY, - w = 300, - h = 50, + width = 300, + height = 50, gap = 10, }) @@ -1287,8 +1287,8 @@ function TestHorizontalFlexDirection:testComplexHorizontalDashboardLayout() parent = quickActions, id = "quickAction" .. i, positioning = Positioning.FLEX, - w = 65, - h = 45, + width = 65, + height = 45, }) end @@ -1299,8 +1299,8 @@ function TestHorizontalFlexDirection:testComplexHorizontalDashboardLayout() positioning = Positioning.FLEX, flexDirection = FlexDirection.HORIZONTAL, justifyContent = JustifyContent.FLEX_END, - w = 300, - h = 60, + width = 300, + height = 60, gap = 10, }) @@ -1309,16 +1309,16 @@ function TestHorizontalFlexDirection:testComplexHorizontalDashboardLayout() parent = headerRight, id = "notifications", positioning = Positioning.FLEX, - w = 50, - h = 50, + width = 50, + height = 50, }) Gui.new({ parent = headerRight, id = "userMenu", positioning = Positioning.FLEX, - w = 200, - h = 50, + width = 200, + height = 50, }) -- Main dashboard content (horizontal sections) @@ -1328,8 +1328,8 @@ function TestHorizontalFlexDirection:testComplexHorizontalDashboardLayout() positioning = Positioning.FLEX, flexDirection = FlexDirection.HORIZONTAL, justifyContent = JustifyContent.FLEX_START, - w = 1600, - h = 920, + width = 1600, + height = 920, gap = 0, }) @@ -1339,8 +1339,8 @@ function TestHorizontalFlexDirection:testComplexHorizontalDashboardLayout() id = "leftSidebar", positioning = Positioning.FLEX, flexDirection = FlexDirection.VERTICAL, - w = 250, - h = 920, + width = 250, + height = 920, gap = 10, }) @@ -1351,8 +1351,8 @@ function TestHorizontalFlexDirection:testComplexHorizontalDashboardLayout() id = "sidebarSection" .. i, positioning = Positioning.FLEX, flexDirection = FlexDirection.VERTICAL, - w = 240, - h = 170, + width = 240, + height = 170, gap = 5, }) @@ -1361,8 +1361,8 @@ function TestHorizontalFlexDirection:testComplexHorizontalDashboardLayout() parent = sidebarSection, id = "sectionHeader" .. i, positioning = Positioning.FLEX, - w = 230, - h = 30, + width = 230, + height = 30, }) -- Section items @@ -1371,8 +1371,8 @@ function TestHorizontalFlexDirection:testComplexHorizontalDashboardLayout() parent = sidebarSection, id = "sectionItem" .. i .. "_" .. j, positioning = Positioning.FLEX, - w = 230, - h = 30, + width = 230, + height = 30, }) end end @@ -1383,8 +1383,8 @@ function TestHorizontalFlexDirection:testComplexHorizontalDashboardLayout() id = "centerArea", positioning = Positioning.FLEX, flexDirection = FlexDirection.VERTICAL, - w = 1100, - h = 920, + width = 1100, + height = 920, gap = 20, }) @@ -1395,8 +1395,8 @@ function TestHorizontalFlexDirection:testComplexHorizontalDashboardLayout() positioning = Positioning.FLEX, flexDirection = FlexDirection.HORIZONTAL, justifyContent = JustifyContent.SPACE_BETWEEN, - w = 1080, - h = 280, + width = 1080, + height = 280, gap = 20, }) @@ -1407,8 +1407,8 @@ function TestHorizontalFlexDirection:testComplexHorizontalDashboardLayout() id = "topWidget" .. i, positioning = Positioning.FLEX, flexDirection = FlexDirection.VERTICAL, - w = 250, - h = 260, + width = 250, + height = 260, gap = 10, }) @@ -1419,8 +1419,8 @@ function TestHorizontalFlexDirection:testComplexHorizontalDashboardLayout() positioning = Positioning.FLEX, flexDirection = FlexDirection.HORIZONTAL, justifyContent = JustifyContent.SPACE_BETWEEN, - w = 240, - h = 40, + width = 240, + height = 40, gap = 10, }) @@ -1428,16 +1428,16 @@ function TestHorizontalFlexDirection:testComplexHorizontalDashboardLayout() parent = widgetHeader, id = "widgetTitle" .. i, positioning = Positioning.FLEX, - w = 180, - h = 35, + width = 180, + height = 35, }) Gui.new({ parent = widgetHeader, id = "widgetControls" .. i, positioning = Positioning.FLEX, - w = 50, - h = 35, + width = 50, + height = 35, }) -- Widget content @@ -1445,8 +1445,8 @@ function TestHorizontalFlexDirection:testComplexHorizontalDashboardLayout() parent = widget, id = "topWidgetContent" .. i, positioning = Positioning.FLEX, - w = 240, - h = 200, + width = 240, + height = 200, }) end @@ -1457,8 +1457,8 @@ function TestHorizontalFlexDirection:testComplexHorizontalDashboardLayout() positioning = Positioning.FLEX, flexDirection = FlexDirection.HORIZONTAL, justifyContent = JustifyContent.SPACE_AROUND, - w = 1080, - h = 600, + width = 1080, + height = 600, gap = 30, }) @@ -1468,8 +1468,8 @@ function TestHorizontalFlexDirection:testComplexHorizontalDashboardLayout() id = "largeWidget", positioning = Positioning.FLEX, flexDirection = FlexDirection.VERTICAL, - w = 700, - h = 580, + width = 700, + height = 580, gap = 15, }) @@ -1478,8 +1478,8 @@ function TestHorizontalFlexDirection:testComplexHorizontalDashboardLayout() parent = largeWidget, id = "largeWidgetHeader", positioning = Positioning.FLEX, - w = 680, - h = 50, + width = 680, + height = 50, }) local largeWidgetContent = Gui.new({ @@ -1488,8 +1488,8 @@ function TestHorizontalFlexDirection:testComplexHorizontalDashboardLayout() positioning = Positioning.FLEX, flexDirection = FlexDirection.HORIZONTAL, justifyContent = JustifyContent.SPACE_BETWEEN, - w = 680, - h = 500, + width = 680, + height = 500, gap = 20, }) @@ -1498,8 +1498,8 @@ function TestHorizontalFlexDirection:testComplexHorizontalDashboardLayout() parent = largeWidgetContent, id = "chart", positioning = Positioning.FLEX, - w = 400, - h = 480, + width = 400, + height = 480, }) local details = Gui.new({ @@ -1507,8 +1507,8 @@ function TestHorizontalFlexDirection:testComplexHorizontalDashboardLayout() id = "details", positioning = Positioning.FLEX, flexDirection = FlexDirection.VERTICAL, - w = 240, - h = 480, + width = 240, + height = 480, gap = 10, }) @@ -1518,8 +1518,8 @@ function TestHorizontalFlexDirection:testComplexHorizontalDashboardLayout() parent = details, id = "detailItem" .. i, positioning = Positioning.FLEX, - w = 230, - h = 70, + width = 230, + height = 70, }) end @@ -1529,8 +1529,8 @@ function TestHorizontalFlexDirection:testComplexHorizontalDashboardLayout() id = "smallWidgets", positioning = Positioning.FLEX, flexDirection = FlexDirection.VERTICAL, - w = 300, - h = 580, + width = 300, + height = 580, gap = 20, }) @@ -1541,8 +1541,8 @@ function TestHorizontalFlexDirection:testComplexHorizontalDashboardLayout() id = "smallWidget" .. i, positioning = Positioning.FLEX, flexDirection = FlexDirection.VERTICAL, - w = 280, - h = 173, + width = 280, + height = 173, gap = 10, }) @@ -1550,16 +1550,16 @@ function TestHorizontalFlexDirection:testComplexHorizontalDashboardLayout() parent = smallWidget, id = "smallWidgetHeader" .. i, positioning = Positioning.FLEX, - w = 270, - h = 35, + width = 270, + height = 35, }) Gui.new({ parent = smallWidget, id = "smallWidgetContent" .. i, positioning = Positioning.FLEX, - w = 270, - h = 128, + width = 270, + height = 128, }) end @@ -1569,8 +1569,8 @@ function TestHorizontalFlexDirection:testComplexHorizontalDashboardLayout() id = "rightSidebar", positioning = Positioning.FLEX, flexDirection = FlexDirection.VERTICAL, - w = 250, - h = 920, + width = 250, + height = 920, gap = 15, }) @@ -1580,8 +1580,8 @@ function TestHorizontalFlexDirection:testComplexHorizontalDashboardLayout() parent = rightSidebar, id = "activityItem" .. i, positioning = Positioning.FLEX, - w = 240, - h = 100, + width = 240, + height = 100, }) end diff --git a/testing/__tests__/04_flex_direction_vertical_tests.lua b/testing/__tests__/04_flex_direction_vertical_tests.lua index 38af146..031b7c8 100644 --- a/testing/__tests__/04_flex_direction_vertical_tests.lua +++ b/testing/__tests__/04_flex_direction_vertical_tests.lua @@ -34,8 +34,8 @@ function TestVerticalFlexDirection:testCreateElementWithVerticalFlexDirection() flexDirection = FlexDirection.VERTICAL, x = 0, y = 0, - w = 100, - h = 300, + width = 100, + height = 300, }) -- Verify element was created with correct properties @@ -53,14 +53,14 @@ function TestVerticalFlexDirection:testSingleChildVerticalLayout() flexDirection = FlexDirection.VERTICAL, x = 0, y = 0, - w = 100, - h = 300, + width = 100, + height = 300, }) local child = Gui.new({ id = "single_child", - w = 80, - h = 50, + width = 80, + height = 50, }) parent:addChild(child) @@ -78,27 +78,27 @@ function TestVerticalFlexDirection:testMultipleChildrenVerticalLayout() flexDirection = FlexDirection.VERTICAL, x = 0, y = 0, - w = 100, - h = 300, + width = 100, + height = 300, gap = 10, }) local child1 = Gui.new({ id = "child1", - w = 80, - h = 50, + width = 80, + height = 50, }) local child2 = Gui.new({ id = "child2", - w = 70, - h = 40, + width = 70, + height = 40, }) local child3 = Gui.new({ id = "child3", - w = 60, - h = 30, + width = 60, + height = 30, }) parent:addChild(child1) @@ -124,8 +124,8 @@ function TestVerticalFlexDirection:testEmptyParentVerticalLayout() flexDirection = FlexDirection.VERTICAL, x = 0, y = 0, - w = 100, - h = 300, + width = 100, + height = 300, }) -- Should not cause any errors and should have no children @@ -141,21 +141,21 @@ function TestVerticalFlexDirection:testVerticalLayoutFlexStart() justifyContent = JustifyContent.FLEX_START, x = 0, y = 0, - w = 100, - h = 300, + width = 100, + height = 300, gap = 10, }) local child1 = Gui.new({ id = "child1", - w = 80, - h = 50, + width = 80, + height = 50, }) local child2 = Gui.new({ id = "child2", - w = 70, - h = 40, + width = 70, + height = 40, }) parent:addChild(child1) @@ -175,21 +175,21 @@ function TestVerticalFlexDirection:testVerticalLayoutCenter() justifyContent = JustifyContent.CENTER, x = 0, y = 0, - w = 100, - h = 300, + width = 100, + height = 300, gap = 10, }) local child1 = Gui.new({ id = "child1", - w = 80, - h = 50, + width = 80, + height = 50, }) local child2 = Gui.new({ id = "child2", - w = 70, - h = 40, + width = 70, + height = 40, }) parent:addChild(child1) @@ -213,21 +213,21 @@ function TestVerticalFlexDirection:testVerticalLayoutFlexEnd() justifyContent = JustifyContent.FLEX_END, x = 0, y = 0, - w = 100, - h = 300, + width = 100, + height = 300, gap = 10, }) local child1 = Gui.new({ id = "child1", - w = 80, - h = 50, + width = 80, + height = 50, }) local child2 = Gui.new({ id = "child2", - w = 70, - h = 40, + width = 70, + height = 40, }) parent:addChild(child1) @@ -251,14 +251,14 @@ function TestVerticalFlexDirection:testSingleChildVerticalLayoutCentered() justifyContent = JustifyContent.CENTER, x = 20, y = 10, - w = 100, - h = 300, + width = 100, + height = 300, }) local child = Gui.new({ id = "single_child", - w = 80, - h = 50, + width = 80, + height = 50, }) parent:addChild(child) @@ -278,20 +278,20 @@ function TestVerticalFlexDirection:testVerticalLayoutMaintainsChildWidths() alignItems = AlignItems.FLEX_START, -- Explicitly set to maintain child widths x = 0, y = 0, - w = 100, - h = 300, + width = 100, + height = 300, }) local child1 = Gui.new({ id = "child1", - w = 80, - h = 50, + width = 80, + height = 50, }) local child2 = Gui.new({ id = "child2", - w = 60, - h = 40, -- Different width + width = 60, + height = 40, -- Different width }) parent:addChild(child1) @@ -311,20 +311,20 @@ function TestVerticalFlexDirection:testVerticalLayoutAlignItemsCenter() alignItems = AlignItems.CENTER, x = 0, y = 0, - w = 100, - h = 300, + width = 100, + height = 300, }) local child1 = Gui.new({ id = "child1", - w = 80, - h = 50, + width = 80, + height = 50, }) local child2 = Gui.new({ id = "child2", - w = 60, - h = 40, + width = 60, + height = 40, }) parent:addChild(child1) @@ -347,20 +347,20 @@ function TestVerticalFlexDirection:testVerticalLayoutAlignItemsFlexEnd() alignItems = AlignItems.FLEX_END, x = 0, y = 0, - w = 100, - h = 300, + width = 100, + height = 300, }) local child1 = Gui.new({ id = "child1", - w = 80, - h = 50, + width = 80, + height = 50, }) local child2 = Gui.new({ id = "child2", - w = 60, - h = 40, + width = 60, + height = 40, }) parent:addChild(child1) @@ -383,20 +383,20 @@ function TestVerticalFlexDirection:testVerticalLayoutAlignItemsStretch() alignItems = AlignItems.STRETCH, x = 0, y = 0, - w = 100, - h = 300, + width = 100, + height = 300, }) local child1 = Gui.new({ id = "child1", - w = 80, - h = 50, + width = 80, + height = 50, }) local child2 = Gui.new({ id = "child2", - w = 60, - h = 40, + width = 60, + height = 40, }) parent:addChild(child1) @@ -416,27 +416,27 @@ function TestVerticalFlexDirection:testVerticalLayoutSpaceBetween() justifyContent = JustifyContent.SPACE_BETWEEN, x = 0, y = 0, - w = 100, - h = 300, + width = 100, + height = 300, gap = 0, -- Space-between controls spacing, not gap }) local child1 = Gui.new({ id = "child1", - w = 80, - h = 50, + width = 80, + height = 50, }) local child2 = Gui.new({ id = "child2", - w = 70, - h = 40, + width = 70, + height = 40, }) local child3 = Gui.new({ id = "child3", - w = 60, - h = 30, + width = 60, + height = 30, }) parent:addChild(child1) @@ -463,21 +463,21 @@ function TestVerticalFlexDirection:testVerticalLayoutCustomGap() flexDirection = FlexDirection.VERTICAL, x = 0, y = 0, - w = 100, - h = 300, + width = 100, + height = 300, gap = 20, -- Custom gap }) local child1 = Gui.new({ id = "child1", - w = 80, - h = 50, + width = 80, + height = 50, }) local child2 = Gui.new({ id = "child2", - w = 70, - h = 40, + width = 70, + height = 40, }) parent:addChild(child1) @@ -497,14 +497,14 @@ function TestVerticalFlexDirection:testVerticalLayoutWithPositioningOffset() justifyContent = JustifyContent.CENTER, x = 50, y = 100, - w = 100, - h = 300, + width = 100, + height = 300, }) local child = Gui.new({ id = "single_child", - w = 80, - h = 50, + width = 80, + height = 50, }) parent:addChild(child) @@ -523,8 +523,8 @@ function TestVerticalFlexDirection:testComplexVerticalSidebarLayout() flexDirection = FlexDirection.VERTICAL, x = 0, y = 0, - w = 300, - h = 800, + width = 300, + height = 800, gap = 20, }) @@ -533,13 +533,13 @@ function TestVerticalFlexDirection:testComplexVerticalSidebarLayout() id = "header", positioning = Positioning.FLEX, flexDirection = FlexDirection.VERTICAL, - w = 280, - h = 120, + width = 280, + height = 120, gap = 10, }) - local logo = Gui.new({ id = "logo", w = 100, h = 40 }) - local userInfo = Gui.new({ id = "userInfo", w = 250, h = 60 }) + local logo = Gui.new({ id = "logo", width = 100, height = 40 }) + local userInfo = Gui.new({ id = "userInfo", width = 250, height = 60 }) header:addChild(logo) header:addChild(userInfo) @@ -549,8 +549,8 @@ function TestVerticalFlexDirection:testComplexVerticalSidebarLayout() id = "navigation", positioning = Positioning.FLEX, flexDirection = FlexDirection.VERTICAL, - w = 280, - h = 400, + width = 280, + height = 400, gap = 5, }) @@ -558,8 +558,8 @@ function TestVerticalFlexDirection:testComplexVerticalSidebarLayout() id = "mainMenu", positioning = Positioning.FLEX, flexDirection = FlexDirection.VERTICAL, - w = 280, - h = 200, + width = 280, + height = 200, gap = 2, }) @@ -567,8 +567,8 @@ function TestVerticalFlexDirection:testComplexVerticalSidebarLayout() for i = 1, 5 do local menuItem = Gui.new({ id = "menuItem" .. i, - w = 270, - h = 35, + width = 270, + height = 35, }) mainMenu:addChild(menuItem) end @@ -577,8 +577,8 @@ function TestVerticalFlexDirection:testComplexVerticalSidebarLayout() id = "subMenu", positioning = Positioning.FLEX, flexDirection = FlexDirection.VERTICAL, - w = 260, - h = 180, + width = 260, + height = 180, gap = 3, }) @@ -586,8 +586,8 @@ function TestVerticalFlexDirection:testComplexVerticalSidebarLayout() for i = 1, 4 do local subMenuItem = Gui.new({ id = "subMenuItem" .. i, - w = 240, - h = 30, + width = 240, + height = 30, }) subMenu:addChild(subMenuItem) end @@ -601,14 +601,14 @@ function TestVerticalFlexDirection:testComplexVerticalSidebarLayout() positioning = Positioning.FLEX, flexDirection = FlexDirection.VERTICAL, justifyContent = JustifyContent.FLEX_END, - w = 280, - h = 200, + width = 280, + height = 200, gap = 10, }) - local settings = Gui.new({ id = "settings", w = 200, h = 50 }) - local help = Gui.new({ id = "help", w = 180, h = 40 }) - local logout = Gui.new({ id = "logout", w = 120, h = 35 }) + local settings = Gui.new({ id = "settings", width = 200, height = 50 }) + local help = Gui.new({ id = "help", width = 180, height = 40 }) + local logout = Gui.new({ id = "logout", width = 120, height = 35 }) footer:addChild(settings) footer:addChild(help) @@ -639,8 +639,8 @@ function TestVerticalFlexDirection:testMultiLevelAccordionLayout() flexDirection = FlexDirection.VERTICAL, x = 0, y = 0, - w = 400, - h = 600, + width = 400, + height = 600, gap = 5, }) @@ -650,23 +650,23 @@ function TestVerticalFlexDirection:testMultiLevelAccordionLayout() id = "section" .. sectionIndex, positioning = Positioning.FLEX, flexDirection = FlexDirection.VERTICAL, - w = 380, - h = 180, + width = 380, + height = 180, gap = 2, }) local sectionHeader = Gui.new({ id = "sectionHeader" .. sectionIndex, - w = 380, - h = 40, + width = 380, + height = 40, }) local sectionContent = Gui.new({ id = "sectionContent" .. sectionIndex, positioning = Positioning.FLEX, flexDirection = FlexDirection.VERTICAL, - w = 360, - h = 130, + width = 360, + height = 130, gap = 3, }) @@ -676,21 +676,21 @@ function TestVerticalFlexDirection:testMultiLevelAccordionLayout() id = "subsection" .. sectionIndex .. "_" .. subIndex, positioning = Positioning.FLEX, flexDirection = FlexDirection.VERTICAL, - w = 340, - h = 40, + width = 340, + height = 40, gap = 1, }) local subHeader = Gui.new({ id = "subHeader" .. sectionIndex .. "_" .. subIndex, - w = 340, - h = 20, + width = 340, + height = 20, }) local subContent = Gui.new({ id = "subContent" .. sectionIndex .. "_" .. subIndex, - w = 320, - h = 18, + width = 320, + height = 18, }) subsection:addChild(subHeader) @@ -730,8 +730,8 @@ function TestVerticalFlexDirection:testVerticalChatMessageLayout() justifyContent = JustifyContent.FLEX_END, x = 0, y = 0, - w = 350, - h = 500, + width = 350, + height = 500, gap = 8, }) @@ -748,8 +748,8 @@ function TestVerticalFlexDirection:testVerticalChatMessageLayout() id = "messageGroup" .. i, positioning = Positioning.FLEX, flexDirection = FlexDirection.VERTICAL, - w = 330, - h = msgType.hasReactions and 80 or 60, + width = 330, + height = msgType.hasReactions and 80 or 60, gap = 4, }) @@ -757,16 +757,16 @@ function TestVerticalFlexDirection:testVerticalChatMessageLayout() id = "messageRow" .. i, positioning = Positioning.FLEX, flexDirection = FlexDirection.HORIZONTAL, - w = 330, - h = 40, + width = 330, + height = 40, gap = 8, }) if msgType.hasAvatar then local avatar = Gui.new({ id = "avatar" .. i, - w = 32, - h = 32, + width = 32, + height = 32, }) messageRow:addChild(avatar) end @@ -775,21 +775,21 @@ function TestVerticalFlexDirection:testVerticalChatMessageLayout() id = "messageContent" .. i, positioning = Positioning.FLEX, flexDirection = FlexDirection.VERTICAL, - w = msgType.hasAvatar and 290 or 330, - h = 35, + width = msgType.hasAvatar and 290 or 330, + height = 35, gap = 2, }) local messageText = Gui.new({ id = "messageText" .. i, - w = msgType.hasAvatar and 280 or 320, - h = 20, + width = msgType.hasAvatar and 280 or 320, + height = 20, }) local timestamp = Gui.new({ id = "timestamp" .. i, - w = 60, - h = 12, + width = 60, + height = 12, }) messageContent:addChild(messageText) @@ -802,8 +802,8 @@ function TestVerticalFlexDirection:testVerticalChatMessageLayout() id = "reactions" .. i, positioning = Positioning.FLEX, flexDirection = FlexDirection.HORIZONTAL, - w = 150, - h = 20, + width = 150, + height = 20, gap = 3, }) @@ -811,8 +811,8 @@ function TestVerticalFlexDirection:testVerticalChatMessageLayout() for j = 1, 3 do local reaction = Gui.new({ id = "reaction" .. i .. "_" .. j, - w = 25, - h = 18, + width = 25, + height = 18, }) reactions:addChild(reaction) end @@ -840,8 +840,8 @@ function TestVerticalFlexDirection:testNestedFormLayout() flexDirection = FlexDirection.VERTICAL, x = 0, y = 0, - w = 500, - h = 700, + width = 500, + height = 700, gap = 20, }) @@ -850,13 +850,13 @@ function TestVerticalFlexDirection:testNestedFormLayout() id = "formHeader", positioning = Positioning.FLEX, flexDirection = FlexDirection.VERTICAL, - w = 480, - h = 80, + width = 480, + height = 80, gap = 10, }) - local title = Gui.new({ id = "title", w = 300, h = 30 }) - local description = Gui.new({ id = "description", w = 450, h = 40 }) + local title = Gui.new({ id = "title", width = 300, height = 30 }) + local description = Gui.new({ id = "description", width = 450, height = 40 }) formHeader:addChild(title) formHeader:addChild(description) @@ -866,12 +866,12 @@ function TestVerticalFlexDirection:testNestedFormLayout() id = "personalSection", positioning = Positioning.FLEX, flexDirection = FlexDirection.VERTICAL, - w = 480, - h = 200, + width = 480, + height = 200, gap = 15, }) - local personalTitle = Gui.new({ id = "personalTitle", w = 200, h = 25 }) + local personalTitle = Gui.new({ id = "personalTitle", width = 200, height = 25 }) personalSection:addChild(personalTitle) -- Field groups within personal section @@ -879,14 +879,14 @@ function TestVerticalFlexDirection:testNestedFormLayout() id = "nameGroup", positioning = Positioning.FLEX, flexDirection = FlexDirection.VERTICAL, - w = 460, - h = 80, + width = 460, + height = 80, gap = 8, }) - local nameLabel = Gui.new({ id = "nameLabel", w = 100, h = 20 }) - local nameInput = Gui.new({ id = "nameInput", w = 400, h = 35 }) - local nameError = Gui.new({ id = "nameError", w = 350, h = 15 }) + local nameLabel = Gui.new({ id = "nameLabel", width = 100, height = 20 }) + local nameInput = Gui.new({ id = "nameInput", width = 400, height = 35 }) + local nameError = Gui.new({ id = "nameError", width = 350, height = 15 }) nameGroup:addChild(nameLabel) nameGroup:addChild(nameInput) @@ -896,14 +896,14 @@ function TestVerticalFlexDirection:testNestedFormLayout() id = "emailGroup", positioning = Positioning.FLEX, flexDirection = FlexDirection.VERTICAL, - w = 460, - h = 80, + width = 460, + height = 80, gap = 8, }) - local emailLabel = Gui.new({ id = "emailLabel", w = 100, h = 20 }) - local emailInput = Gui.new({ id = "emailInput", w = 400, h = 35 }) - local emailError = Gui.new({ id = "emailError", w = 350, h = 15 }) + local emailLabel = Gui.new({ id = "emailLabel", width = 100, height = 20 }) + local emailInput = Gui.new({ id = "emailInput", width = 400, height = 35 }) + local emailError = Gui.new({ id = "emailError", width = 350, height = 15 }) emailGroup:addChild(emailLabel) emailGroup:addChild(emailInput) @@ -917,12 +917,12 @@ function TestVerticalFlexDirection:testNestedFormLayout() id = "addressSection", positioning = Positioning.FLEX, flexDirection = FlexDirection.VERTICAL, - w = 480, - h = 300, + width = 480, + height = 300, gap = 15, }) - local addressTitle = Gui.new({ id = "addressTitle", w = 200, h = 25 }) + local addressTitle = Gui.new({ id = "addressTitle", width = 200, height = 25 }) addressSection:addChild(addressTitle) -- Street address group @@ -930,14 +930,14 @@ function TestVerticalFlexDirection:testNestedFormLayout() id = "streetGroup", positioning = Positioning.FLEX, flexDirection = FlexDirection.VERTICAL, - w = 460, - h = 80, + width = 460, + height = 80, gap = 8, }) - local streetLabel = Gui.new({ id = "streetLabel", w = 120, h = 20 }) - local streetInput = Gui.new({ id = "streetInput", w = 400, h = 35 }) - local streetError = Gui.new({ id = "streetError", w = 350, h = 15 }) + local streetLabel = Gui.new({ id = "streetLabel", width = 120, height = 20 }) + local streetInput = Gui.new({ id = "streetInput", width = 400, height = 35 }) + local streetError = Gui.new({ id = "streetError", width = 350, height = 15 }) streetGroup:addChild(streetLabel) streetGroup:addChild(streetInput) @@ -948,25 +948,25 @@ function TestVerticalFlexDirection:testNestedFormLayout() id = "locationGroup", positioning = Positioning.FLEX, flexDirection = FlexDirection.VERTICAL, - w = 460, - h = 120, + width = 460, + height = 120, gap = 8, }) - local locationLabel = Gui.new({ id = "locationLabel", w = 150, h = 20 }) + local locationLabel = Gui.new({ id = "locationLabel", width = 150, height = 20 }) local locationInputs = Gui.new({ id = "locationInputs", positioning = Positioning.FLEX, flexDirection = FlexDirection.HORIZONTAL, - w = 450, - h = 35, + width = 450, + height = 35, gap = 10, }) - local cityInput = Gui.new({ id = "cityInput", w = 200, h = 35 }) - local stateInput = Gui.new({ id = "stateInput", w = 100, h = 35 }) - local zipInput = Gui.new({ id = "zipInput", w = 120, h = 35 }) + local cityInput = Gui.new({ id = "cityInput", width = 200, height = 35 }) + local stateInput = Gui.new({ id = "stateInput", width = 100, height = 35 }) + local zipInput = Gui.new({ id = "zipInput", width = 120, height = 35 }) locationInputs:addChild(cityInput) locationInputs:addChild(stateInput) @@ -976,14 +976,14 @@ function TestVerticalFlexDirection:testNestedFormLayout() id = "locationErrors", positioning = Positioning.FLEX, flexDirection = FlexDirection.VERTICAL, - w = 450, - h = 45, + width = 450, + height = 45, gap = 3, }) - local cityError = Gui.new({ id = "cityError", w = 200, h = 12 }) - local stateError = Gui.new({ id = "stateError", w = 150, h = 12 }) - local zipError = Gui.new({ id = "zipError", w = 180, h = 12 }) + local cityError = Gui.new({ id = "cityError", width = 200, height = 12 }) + local stateError = Gui.new({ id = "stateError", width = 150, height = 12 }) + local zipError = Gui.new({ id = "zipError", width = 180, height = 12 }) locationErrors:addChild(cityError) locationErrors:addChild(stateError) @@ -1002,13 +1002,13 @@ function TestVerticalFlexDirection:testNestedFormLayout() positioning = Positioning.FLEX, flexDirection = FlexDirection.HORIZONTAL, justifyContent = JustifyContent.FLEX_END, - w = 480, - h = 50, + width = 480, + height = 50, gap = 15, }) - local cancelButton = Gui.new({ id = "cancelButton", w = 80, h = 40 }) - local submitButton = Gui.new({ id = "submitButton", w = 100, h = 40 }) + local cancelButton = Gui.new({ id = "cancelButton", width = 80, height = 40 }) + local submitButton = Gui.new({ id = "submitButton", width = 100, height = 40 }) formActions:addChild(cancelButton) formActions:addChild(submitButton) @@ -1042,8 +1042,8 @@ function TestVerticalFlexDirection:testCalendarTimelineLayout() flexDirection = FlexDirection.VERTICAL, x = 0, y = 0, - w = 600, - h = 800, + width = 600, + height = 800, gap = 10, }) @@ -1055,23 +1055,23 @@ function TestVerticalFlexDirection:testCalendarTimelineLayout() id = "day" .. dayIndex, positioning = Positioning.FLEX, flexDirection = FlexDirection.VERTICAL, - w = 580, - h = 140, + width = 580, + height = 140, gap = 8, }) local dayHeader = Gui.new({ id = "dayHeader" .. dayIndex, - w = 580, - h = 30, + width = 580, + height = 30, }) local eventsContainer = Gui.new({ id = "eventsContainer" .. dayIndex, positioning = Positioning.FLEX, flexDirection = FlexDirection.VERTICAL, - w = 560, - h = 100, + width = 560, + height = 100, gap = 5, }) @@ -1083,21 +1083,21 @@ function TestVerticalFlexDirection:testCalendarTimelineLayout() id = "event" .. dayIndex .. "_" .. eventIndex, positioning = Positioning.FLEX, flexDirection = FlexDirection.VERTICAL, - w = 540, - h = 20, + width = 540, + height = 20, gap = 2, }) local eventTime = Gui.new({ id = "eventTime" .. dayIndex .. "_" .. eventIndex, - w = 80, - h = 12, + width = 80, + height = 12, }) local eventTitle = Gui.new({ id = "eventTitle" .. dayIndex .. "_" .. eventIndex, - w = 400, - h = 15, + width = 400, + height = 15, }) -- Some events have additional details @@ -1106,21 +1106,21 @@ function TestVerticalFlexDirection:testCalendarTimelineLayout() id = "eventDetails" .. dayIndex .. "_" .. eventIndex, positioning = Positioning.FLEX, flexDirection = FlexDirection.VERTICAL, - w = 380, - h = 25, + width = 380, + height = 25, gap = 2, }) local eventLocation = Gui.new({ id = "eventLocation" .. dayIndex .. "_" .. eventIndex, - w = 200, - h = 10, + width = 200, + height = 10, }) local eventAttendees = Gui.new({ id = "eventAttendees" .. dayIndex .. "_" .. eventIndex, - w = 300, - h = 10, + width = 300, + height = 10, }) eventDetails:addChild(eventLocation) @@ -1170,8 +1170,8 @@ function TestVerticalFlexDirection:testComplexDashboardWidgetLayout() flexDirection = FlexDirection.VERTICAL, x = 0, y = 0, - w = 800, - h = 1000, + width = 800, + height = 1000, gap = 25, }) @@ -1180,8 +1180,8 @@ function TestVerticalFlexDirection:testComplexDashboardWidgetLayout() id = "dashboardHeader", positioning = Positioning.FLEX, flexDirection = FlexDirection.VERTICAL, - w = 780, - h = 100, + width = 780, + height = 100, gap = 12, }) @@ -1189,33 +1189,33 @@ function TestVerticalFlexDirection:testComplexDashboardWidgetLayout() id = "breadcrumbs", positioning = Positioning.FLEX, flexDirection = FlexDirection.HORIZONTAL, - w = 400, - h = 20, + width = 400, + height = 20, gap = 8, }) for i = 1, 4 do local crumb = Gui.new({ id = "crumb" .. i, - w = 80, - h = 18, + width = 80, + height = 18, }) breadcrumbs:addChild(crumb) end - local pageTitle = Gui.new({ id = "pageTitle", w = 300, h = 40 }) + local pageTitle = Gui.new({ id = "pageTitle", width = 300, height = 40 }) local pageActions = Gui.new({ id = "pageActions", positioning = Positioning.FLEX, flexDirection = FlexDirection.HORIZONTAL, - w = 250, - h = 30, + width = 250, + height = 30, gap = 10, }) - local refreshButton = Gui.new({ id = "refreshButton", w = 70, h = 28 }) - local exportButton = Gui.new({ id = "exportButton", w = 80, h = 28 }) - local settingsButton = Gui.new({ id = "settingsButton", w = 75, h = 28 }) + local refreshButton = Gui.new({ id = "refreshButton", width = 70, height = 28 }) + local exportButton = Gui.new({ id = "exportButton", width = 80, height = 28 }) + local settingsButton = Gui.new({ id = "settingsButton", width = 75, height = 28 }) pageActions:addChild(refreshButton) pageActions:addChild(exportButton) @@ -1230,8 +1230,8 @@ function TestVerticalFlexDirection:testComplexDashboardWidgetLayout() id = "topWidgetRow", positioning = Positioning.FLEX, flexDirection = FlexDirection.HORIZONTAL, - w = 780, - h = 250, + width = 780, + height = 250, gap = 20, }) @@ -1241,8 +1241,8 @@ function TestVerticalFlexDirection:testComplexDashboardWidgetLayout() id = "metricWidget" .. i, positioning = Positioning.FLEX, flexDirection = FlexDirection.VERTICAL, - w = 240, - h = 240, + width = 240, + height = 240, gap = 10, }) @@ -1251,13 +1251,13 @@ function TestVerticalFlexDirection:testComplexDashboardWidgetLayout() positioning = Positioning.FLEX, flexDirection = FlexDirection.HORIZONTAL, justifyContent = JustifyContent.SPACE_BETWEEN, - w = 220, - h = 30, + width = 220, + height = 30, gap = 5, }) - local widgetTitle = Gui.new({ id = "widgetTitle" .. i, w = 150, h = 25 }) - local widgetMenu = Gui.new({ id = "widgetMenu" .. i, w = 20, h = 20 }) + local widgetTitle = Gui.new({ id = "widgetTitle" .. i, width = 150, height = 25 }) + local widgetMenu = Gui.new({ id = "widgetMenu" .. i, width = 20, height = 20 }) widgetHeader:addChild(widgetTitle) widgetHeader:addChild(widgetMenu) @@ -1268,14 +1268,14 @@ function TestVerticalFlexDirection:testComplexDashboardWidgetLayout() flexDirection = FlexDirection.VERTICAL, justifyContent = JustifyContent.CENTER, alignItems = AlignItems.CENTER, - w = 220, - h = 150, + width = 220, + height = 150, gap = 8, }) - local metricValue = Gui.new({ id = "metricValue" .. i, w = 120, h = 50 }) - local metricLabel = Gui.new({ id = "metricLabel" .. i, w = 100, h = 20 }) - local metricTrend = Gui.new({ id = "metricTrend" .. i, w = 80, h = 15 }) + local metricValue = Gui.new({ id = "metricValue" .. i, width = 120, height = 50 }) + local metricLabel = Gui.new({ id = "metricLabel" .. i, width = 100, height = 20 }) + local metricTrend = Gui.new({ id = "metricTrend" .. i, width = 80, height = 15 }) widgetContent:addChild(metricValue) widgetContent:addChild(metricLabel) @@ -1283,8 +1283,8 @@ function TestVerticalFlexDirection:testComplexDashboardWidgetLayout() local widgetFooter = Gui.new({ id = "widgetFooter" .. i, - w = 220, - h = 25, + width = 220, + height = 25, }) metricWidget:addChild(widgetHeader) @@ -1299,8 +1299,8 @@ function TestVerticalFlexDirection:testComplexDashboardWidgetLayout() id = "chartSection", positioning = Positioning.FLEX, flexDirection = FlexDirection.VERTICAL, - w = 780, - h = 400, + width = 780, + height = 400, gap = 15, }) @@ -1309,24 +1309,24 @@ function TestVerticalFlexDirection:testComplexDashboardWidgetLayout() positioning = Positioning.FLEX, flexDirection = FlexDirection.HORIZONTAL, justifyContent = JustifyContent.SPACE_BETWEEN, - w = 760, - h = 40, + width = 760, + height = 40, gap = 10, }) - local chartTitle = Gui.new({ id = "chartTitle", w = 200, h = 35 }) + local chartTitle = Gui.new({ id = "chartTitle", width = 200, height = 35 }) local chartControls = Gui.new({ id = "chartControls", positioning = Positioning.FLEX, flexDirection = FlexDirection.HORIZONTAL, - w = 300, - h = 35, + width = 300, + height = 35, gap = 8, }) - local timeRangeSelect = Gui.new({ id = "timeRangeSelect", w = 120, h = 30 }) - local chartTypeSelect = Gui.new({ id = "chartTypeSelect", w = 100, h = 30 }) - local fullscreenButton = Gui.new({ id = "fullscreenButton", w = 60, h = 30 }) + local timeRangeSelect = Gui.new({ id = "timeRangeSelect", width = 120, height = 30 }) + local chartTypeSelect = Gui.new({ id = "chartTypeSelect", width = 100, height = 30 }) + local fullscreenButton = Gui.new({ id = "fullscreenButton", width = 60, height = 30 }) chartControls:addChild(timeRangeSelect) chartControls:addChild(chartTypeSelect) @@ -1335,14 +1335,14 @@ function TestVerticalFlexDirection:testComplexDashboardWidgetLayout() chartHeader:addChild(chartTitle) chartHeader:addChild(chartControls) - local chartArea = Gui.new({ id = "chartArea", w = 760, h = 300 }) + local chartArea = Gui.new({ id = "chartArea", width = 760, height = 300 }) local chartLegend = Gui.new({ id = "chartLegend", positioning = Positioning.FLEX, flexDirection = FlexDirection.HORIZONTAL, - w = 600, - h = 30, + width = 600, + height = 30, gap = 15, }) @@ -1351,13 +1351,13 @@ function TestVerticalFlexDirection:testComplexDashboardWidgetLayout() id = "legendItem" .. i, positioning = Positioning.FLEX, flexDirection = FlexDirection.HORIZONTAL, - w = 120, - h = 25, + width = 120, + height = 25, gap = 5, }) - local legendColor = Gui.new({ id = "legendColor" .. i, w = 15, h = 15 }) - local legendLabel = Gui.new({ id = "legendLabel" .. i, w = 95, h = 20 }) + local legendColor = Gui.new({ id = "legendColor" .. i, width = 15, height = 15 }) + local legendLabel = Gui.new({ id = "legendLabel" .. i, width = 95, height = 20 }) legendItem:addChild(legendColor) legendItem:addChild(legendLabel) @@ -1373,8 +1373,8 @@ function TestVerticalFlexDirection:testComplexDashboardWidgetLayout() id = "tableSection", positioning = Positioning.FLEX, flexDirection = FlexDirection.VERTICAL, - w = 780, - h = 300, + width = 780, + height = 300, gap = 10, }) @@ -1383,12 +1383,12 @@ function TestVerticalFlexDirection:testComplexDashboardWidgetLayout() positioning = Positioning.FLEX, flexDirection = FlexDirection.HORIZONTAL, justifyContent = JustifyContent.SPACE_BETWEEN, - w = 760, - h = 35, + width = 760, + height = 35, }) - local tableTitle = Gui.new({ id = "tableTitle", w = 200, h = 30 }) - local tableSearch = Gui.new({ id = "tableSearch", w = 250, h = 30 }) + local tableTitle = Gui.new({ id = "tableTitle", width = 200, height = 30 }) + local tableSearch = Gui.new({ id = "tableSearch", width = 250, height = 30 }) tableHeader:addChild(tableTitle) tableHeader:addChild(tableSearch) @@ -1397,20 +1397,20 @@ function TestVerticalFlexDirection:testComplexDashboardWidgetLayout() id = "tableContent", positioning = Positioning.FLEX, flexDirection = FlexDirection.VERTICAL, - w = 760, - h = 200, + width = 760, + height = 200, gap = 2, }) - local tableHeaderRow = Gui.new({ id = "tableHeaderRow", w = 760, h = 35 }) + local tableHeaderRow = Gui.new({ id = "tableHeaderRow", width = 760, height = 35 }) tableContent:addChild(tableHeaderRow) -- Table rows for i = 1, 6 do local tableRow = Gui.new({ id = "tableRow" .. i, - w = 760, - h = 25, + width = 760, + height = 25, }) tableContent:addChild(tableRow) end @@ -1420,16 +1420,16 @@ function TestVerticalFlexDirection:testComplexDashboardWidgetLayout() positioning = Positioning.FLEX, flexDirection = FlexDirection.HORIZONTAL, justifyContent = JustifyContent.CENTER, - w = 300, - h = 40, + width = 300, + height = 40, gap = 5, }) for i = 1, 5 do local pageButton = Gui.new({ id = "pageButton" .. i, - w = 30, - h = 30, + width = 30, + height = 30, }) tablePagination:addChild(pageButton) end @@ -1476,16 +1476,16 @@ function TestVerticalFlexDirection:testMobileVerticalStackLayout() flexDirection = FlexDirection.VERTICAL, x = 0, y = 0, - w = 375, -- iPhone-style width - h = 812, -- iPhone-style height + width = 375, -- iPhone-style width + height = 812, -- iPhone-style height gap = 0, }) -- Status bar local statusBar = Gui.new({ id = "statusBar", - w = 375, - h = 44, + width = 375, + height = 44, }) -- Header with pull-to-refresh area @@ -1493,15 +1493,15 @@ function TestVerticalFlexDirection:testMobileVerticalStackLayout() id = "header", positioning = Positioning.FLEX, flexDirection = FlexDirection.VERTICAL, - w = 375, - h = 100, + width = 375, + height = 100, gap = 5, }) local pullToRefresh = Gui.new({ id = "pullToRefresh", - w = 375, - h = 30, + width = 375, + height = 30, }) local navigationBar = Gui.new({ @@ -1510,14 +1510,14 @@ function TestVerticalFlexDirection:testMobileVerticalStackLayout() flexDirection = FlexDirection.HORIZONTAL, justifyContent = JustifyContent.SPACE_BETWEEN, alignItems = AlignItems.CENTER, - w = 375, - h = 60, + width = 375, + height = 60, gap = 10, }) - local backButton = Gui.new({ id = "backButton", w = 40, h = 40 }) - local headerTitle = Gui.new({ id = "headerTitle", w = 200, h = 35 }) - local moreButton = Gui.new({ id = "moreButton", w = 40, h = 40 }) + local backButton = Gui.new({ id = "backButton", width = 40, height = 40 }) + local headerTitle = Gui.new({ id = "headerTitle", width = 200, height = 35 }) + local moreButton = Gui.new({ id = "moreButton", width = 40, height = 40 }) navigationBar:addChild(backButton) navigationBar:addChild(headerTitle) @@ -1531,8 +1531,8 @@ function TestVerticalFlexDirection:testMobileVerticalStackLayout() id = "contentArea", positioning = Positioning.FLEX, flexDirection = FlexDirection.VERTICAL, - w = 375, - h = 600, + width = 375, + height = 600, gap = 1, }) @@ -1542,8 +1542,8 @@ function TestVerticalFlexDirection:testMobileVerticalStackLayout() id = "feedItem" .. i, positioning = Positioning.FLEX, flexDirection = FlexDirection.VERTICAL, - w = 365, - h = i % 3 == 0 and 200 or 120, -- Some items are taller + width = 365, + height = i % 3 == 0 and 200 or 120, -- Some items are taller gap = 8, }) @@ -1552,29 +1552,29 @@ function TestVerticalFlexDirection:testMobileVerticalStackLayout() positioning = Positioning.FLEX, flexDirection = FlexDirection.HORIZONTAL, alignItems = AlignItems.CENTER, - w = 355, - h = 50, + width = 355, + height = 50, gap = 12, }) - local avatar = Gui.new({ id = "avatar" .. i, w = 40, h = 40 }) + local avatar = Gui.new({ id = "avatar" .. i, width = 40, height = 40 }) local userInfo = Gui.new({ id = "userInfo" .. i, positioning = Positioning.FLEX, flexDirection = FlexDirection.VERTICAL, - w = 200, - h = 40, + width = 200, + height = 40, gap = 3, }) - local username = Gui.new({ id = "username" .. i, w = 150, h = 18 }) - local timestamp = Gui.new({ id = "timestamp" .. i, w = 100, h = 14 }) + local username = Gui.new({ id = "username" .. i, width = 150, height = 18 }) + local timestamp = Gui.new({ id = "timestamp" .. i, width = 100, height = 14 }) userInfo:addChild(username) userInfo:addChild(timestamp) - local itemMenu = Gui.new({ id = "itemMenu" .. i, w = 30, h = 30 }) + local itemMenu = Gui.new({ id = "itemMenu" .. i, width = 30, height = 30 }) itemHeader:addChild(avatar) itemHeader:addChild(userInfo) @@ -1584,15 +1584,15 @@ function TestVerticalFlexDirection:testMobileVerticalStackLayout() id = "itemContent" .. i, positioning = Positioning.FLEX, flexDirection = FlexDirection.VERTICAL, - w = 355, - h = feedItem.height - 50 - 8, -- Remaining height after header + width = 355, + height = feedItem.height - 50 - 8, -- Remaining height after header gap = 5, }) local textContent = Gui.new({ id = "textContent" .. i, - w = 345, - h = 25, + width = 345, + height = 25, }) itemContent:addChild(textContent) @@ -1603,13 +1603,13 @@ function TestVerticalFlexDirection:testMobileVerticalStackLayout() id = "mediaContainer" .. i, positioning = Positioning.FLEX, flexDirection = FlexDirection.VERTICAL, - w = 345, - h = 100, + width = 345, + height = 100, gap = 3, }) - local media = Gui.new({ id = "media" .. i, w = 345, h = 80 }) - local mediaCaption = Gui.new({ id = "mediaCaption" .. i, w = 300, h = 15 }) + local media = Gui.new({ id = "media" .. i, width = 345, height = 80 }) + local mediaCaption = Gui.new({ id = "mediaCaption" .. i, width = 300, height = 15 }) mediaContainer:addChild(media) mediaContainer:addChild(mediaCaption) @@ -1623,8 +1623,8 @@ function TestVerticalFlexDirection:testMobileVerticalStackLayout() flexDirection = FlexDirection.HORIZONTAL, justifyContent = JustifyContent.SPACE_BETWEEN, alignItems = AlignItems.CENTER, - w = 345, - h = 40, + width = 345, + height = 40, gap = 15, }) @@ -1632,20 +1632,20 @@ function TestVerticalFlexDirection:testMobileVerticalStackLayout() id = "leftActions" .. i, positioning = Positioning.FLEX, flexDirection = FlexDirection.HORIZONTAL, - w = 150, - h = 35, + width = 150, + height = 35, gap = 20, }) - local likeButton = Gui.new({ id = "likeButton" .. i, w = 35, h = 30 }) - local commentButton = Gui.new({ id = "commentButton" .. i, w = 35, h = 30 }) - local shareButton = Gui.new({ id = "shareButton" .. i, w = 35, h = 30 }) + local likeButton = Gui.new({ id = "likeButton" .. i, width = 35, height = 30 }) + local commentButton = Gui.new({ id = "commentButton" .. i, width = 35, height = 30 }) + local shareButton = Gui.new({ id = "shareButton" .. i, width = 35, height = 30 }) leftActions:addChild(likeButton) leftActions:addChild(commentButton) leftActions:addChild(shareButton) - local saveButton = Gui.new({ id = "saveButton" .. i, w = 35, h = 30 }) + local saveButton = Gui.new({ id = "saveButton" .. i, width = 35, height = 30 }) interactionBar:addChild(leftActions) interactionBar:addChild(saveButton) @@ -1664,8 +1664,8 @@ function TestVerticalFlexDirection:testMobileVerticalStackLayout() flexDirection = FlexDirection.HORIZONTAL, justifyContent = JustifyContent.SPACE_AROUND, alignItems = AlignItems.CENTER, - w = 375, - h = 83, -- Includes safe area + width = 375, + height = 83, -- Includes safe area gap = 0, }) @@ -1676,13 +1676,13 @@ function TestVerticalFlexDirection:testMobileVerticalStackLayout() positioning = Positioning.FLEX, flexDirection = FlexDirection.VERTICAL, alignItems = AlignItems.CENTER, - w = 60, - h = 60, + width = 60, + height = 60, gap = 3, }) - local tabIcon = Gui.new({ id = "tabIcon" .. tabName, w = 24, h = 24 }) - local tabLabel = Gui.new({ id = "tabLabel" .. tabName, w = 50, h = 12 }) + local tabIcon = Gui.new({ id = "tabIcon" .. tabName, width = 24, height = 24 }) + local tabLabel = Gui.new({ id = "tabLabel" .. tabName, width = 50, height = 12 }) tab:addChild(tabIcon) tab:addChild(tabLabel) diff --git a/testing/__tests__/05_justify_content_tests.lua b/testing/__tests__/05_justify_content_tests.lua index b163f17..3d89ae5 100644 --- a/testing/__tests__/05_justify_content_tests.lua +++ b/testing/__tests__/05_justify_content_tests.lua @@ -34,8 +34,8 @@ function TestJustifyContent:testHorizontalFlexJustifyContentFlexStart() id = "container", x = 0, y = 0, - w = 300, - h = 100, + width = 300, + height = 100, positioning = Positioning.FLEX, flexDirection = FlexDirection.HORIZONTAL, justifyContent = JustifyContent.FLEX_START, @@ -44,22 +44,22 @@ function TestJustifyContent:testHorizontalFlexJustifyContentFlexStart() local child1 = Gui.new({ id = "child1", - w = 50, - h = 30, + width = 50, + height = 30, positioning = Positioning.FLEX, }) local child2 = Gui.new({ id = "child2", - w = 60, - h = 40, + width = 60, + height = 40, positioning = Positioning.FLEX, }) local child3 = Gui.new({ id = "child3", - w = 70, - h = 35, + width = 70, + height = 35, positioning = Positioning.FLEX, }) @@ -84,8 +84,8 @@ function TestJustifyContent:testHorizontalFlexJustifyContentCenter() id = "container", x = 0, y = 0, - w = 300, - h = 100, + width = 300, + height = 100, positioning = Positioning.FLEX, flexDirection = FlexDirection.HORIZONTAL, justifyContent = JustifyContent.CENTER, @@ -94,15 +94,15 @@ function TestJustifyContent:testHorizontalFlexJustifyContentCenter() local child1 = Gui.new({ id = "child1", - w = 50, - h = 30, + width = 50, + height = 30, positioning = Positioning.FLEX, }) local child2 = Gui.new({ id = "child2", - w = 60, - h = 40, + width = 60, + height = 40, positioning = Positioning.FLEX, }) @@ -122,8 +122,8 @@ function TestJustifyContent:testHorizontalFlexJustifyContentFlexEnd() id = "container", x = 0, y = 0, - w = 300, - h = 100, + width = 300, + height = 100, positioning = Positioning.FLEX, flexDirection = FlexDirection.HORIZONTAL, justifyContent = JustifyContent.FLEX_END, @@ -132,15 +132,15 @@ function TestJustifyContent:testHorizontalFlexJustifyContentFlexEnd() local child1 = Gui.new({ id = "child1", - w = 50, - h = 30, + width = 50, + height = 30, positioning = Positioning.FLEX, }) local child2 = Gui.new({ id = "child2", - w = 60, - h = 40, + width = 60, + height = 40, positioning = Positioning.FLEX, }) @@ -160,8 +160,8 @@ function TestJustifyContent:testHorizontalFlexJustifyContentSpaceBetween() id = "container", x = 0, y = 0, - w = 300, - h = 100, + width = 300, + height = 100, positioning = Positioning.FLEX, flexDirection = FlexDirection.HORIZONTAL, justifyContent = JustifyContent.SPACE_BETWEEN, @@ -170,22 +170,22 @@ function TestJustifyContent:testHorizontalFlexJustifyContentSpaceBetween() local child1 = Gui.new({ id = "child1", - w = 50, - h = 30, + width = 50, + height = 30, positioning = Positioning.FLEX, }) local child2 = Gui.new({ id = "child2", - w = 60, - h = 40, + width = 60, + height = 40, positioning = Positioning.FLEX, }) local child3 = Gui.new({ id = "child3", - w = 40, - h = 35, + width = 40, + height = 35, positioning = Positioning.FLEX, }) @@ -207,8 +207,8 @@ function TestJustifyContent:testHorizontalFlexJustifyContentSpaceAround() id = "container", x = 0, y = 0, - w = 300, - h = 100, + width = 300, + height = 100, positioning = Positioning.FLEX, flexDirection = FlexDirection.HORIZONTAL, justifyContent = JustifyContent.SPACE_AROUND, @@ -217,15 +217,15 @@ function TestJustifyContent:testHorizontalFlexJustifyContentSpaceAround() local child1 = Gui.new({ id = "child1", - w = 50, - h = 30, + width = 50, + height = 30, positioning = Positioning.FLEX, }) local child2 = Gui.new({ id = "child2", - w = 60, - h = 40, + width = 60, + height = 40, positioning = Positioning.FLEX, }) @@ -247,8 +247,8 @@ function TestJustifyContent:testHorizontalFlexJustifyContentSpaceEvenly() id = "container", x = 0, y = 0, - w = 300, - h = 100, + width = 300, + height = 100, positioning = Positioning.FLEX, flexDirection = FlexDirection.HORIZONTAL, justifyContent = JustifyContent.SPACE_EVENLY, @@ -257,15 +257,15 @@ function TestJustifyContent:testHorizontalFlexJustifyContentSpaceEvenly() local child1 = Gui.new({ id = "child1", - w = 50, - h = 30, + width = 50, + height = 30, positioning = Positioning.FLEX, }) local child2 = Gui.new({ id = "child2", - w = 60, - h = 40, + width = 60, + height = 40, positioning = Positioning.FLEX, }) @@ -286,8 +286,8 @@ function TestJustifyContent:testVerticalFlexJustifyContentFlexStart() id = "container", x = 0, y = 0, - w = 100, - h = 300, + width = 100, + height = 300, positioning = Positioning.FLEX, flexDirection = FlexDirection.VERTICAL, justifyContent = JustifyContent.FLEX_START, @@ -296,22 +296,22 @@ function TestJustifyContent:testVerticalFlexJustifyContentFlexStart() local child1 = Gui.new({ id = "child1", - w = 50, - h = 30, + width = 50, + height = 30, positioning = Positioning.FLEX, }) local child2 = Gui.new({ id = "child2", - w = 60, - h = 40, + width = 60, + height = 40, positioning = Positioning.FLEX, }) local child3 = Gui.new({ id = "child3", - w = 70, - h = 35, + width = 70, + height = 35, positioning = Positioning.FLEX, }) @@ -336,8 +336,8 @@ function TestJustifyContent:testVerticalFlexJustifyContentCenter() id = "container", x = 0, y = 0, - w = 100, - h = 300, + width = 100, + height = 300, positioning = Positioning.FLEX, flexDirection = FlexDirection.VERTICAL, justifyContent = JustifyContent.CENTER, @@ -346,15 +346,15 @@ function TestJustifyContent:testVerticalFlexJustifyContentCenter() local child1 = Gui.new({ id = "child1", - w = 50, - h = 30, + width = 50, + height = 30, positioning = Positioning.FLEX, }) local child2 = Gui.new({ id = "child2", - w = 60, - h = 40, + width = 60, + height = 40, positioning = Positioning.FLEX, }) @@ -374,8 +374,8 @@ function TestJustifyContent:testVerticalFlexJustifyContentFlexEnd() id = "container", x = 0, y = 0, - w = 100, - h = 300, + width = 100, + height = 300, positioning = Positioning.FLEX, flexDirection = FlexDirection.VERTICAL, justifyContent = JustifyContent.FLEX_END, @@ -384,15 +384,15 @@ function TestJustifyContent:testVerticalFlexJustifyContentFlexEnd() local child1 = Gui.new({ id = "child1", - w = 50, - h = 30, + width = 50, + height = 30, positioning = Positioning.FLEX, }) local child2 = Gui.new({ id = "child2", - w = 60, - h = 40, + width = 60, + height = 40, positioning = Positioning.FLEX, }) @@ -412,8 +412,8 @@ function TestJustifyContent:testVerticalFlexJustifyContentSpaceBetween() id = "container", x = 0, y = 0, - w = 100, - h = 300, + width = 100, + height = 300, positioning = Positioning.FLEX, flexDirection = FlexDirection.VERTICAL, justifyContent = JustifyContent.SPACE_BETWEEN, @@ -422,22 +422,22 @@ function TestJustifyContent:testVerticalFlexJustifyContentSpaceBetween() local child1 = Gui.new({ id = "child1", - w = 50, - h = 30, + width = 50, + height = 30, positioning = Positioning.FLEX, }) local child2 = Gui.new({ id = "child2", - w = 60, - h = 40, + width = 60, + height = 40, positioning = Positioning.FLEX, }) local child3 = Gui.new({ id = "child3", - w = 40, - h = 35, + width = 40, + height = 35, positioning = Positioning.FLEX, }) @@ -459,8 +459,8 @@ function TestJustifyContent:testVerticalFlexJustifyContentSpaceAround() id = "container", x = 0, y = 0, - w = 100, - h = 300, + width = 100, + height = 300, positioning = Positioning.FLEX, flexDirection = FlexDirection.VERTICAL, justifyContent = JustifyContent.SPACE_AROUND, @@ -469,15 +469,15 @@ function TestJustifyContent:testVerticalFlexJustifyContentSpaceAround() local child1 = Gui.new({ id = "child1", - w = 50, - h = 30, + width = 50, + height = 30, positioning = Positioning.FLEX, }) local child2 = Gui.new({ id = "child2", - w = 60, - h = 40, + width = 60, + height = 40, positioning = Positioning.FLEX, }) @@ -499,8 +499,8 @@ function TestJustifyContent:testVerticalFlexJustifyContentSpaceEvenly() id = "container", x = 0, y = 0, - w = 100, - h = 300, + width = 100, + height = 300, positioning = Positioning.FLEX, flexDirection = FlexDirection.VERTICAL, justifyContent = JustifyContent.SPACE_EVENLY, @@ -509,15 +509,15 @@ function TestJustifyContent:testVerticalFlexJustifyContentSpaceEvenly() local child1 = Gui.new({ id = "child1", - w = 50, - h = 30, + width = 50, + height = 30, positioning = Positioning.FLEX, }) local child2 = Gui.new({ id = "child2", - w = 60, - h = 40, + width = 60, + height = 40, positioning = Positioning.FLEX, }) @@ -538,8 +538,8 @@ function TestJustifyContent:testJustifyContentWithSingleChild() id = "container", x = 0, y = 0, - w = 300, - h = 100, + width = 300, + height = 100, positioning = Positioning.FLEX, flexDirection = FlexDirection.HORIZONTAL, justifyContent = JustifyContent.CENTER, @@ -548,8 +548,8 @@ function TestJustifyContent:testJustifyContentWithSingleChild() local child1 = Gui.new({ id = "child1", - w = 50, - h = 30, + width = 50, + height = 30, positioning = Positioning.FLEX, }) @@ -567,8 +567,8 @@ function TestJustifyContent:testJustifyContentWithNoAvailableSpace() id = "container", x = 0, y = 0, - w = 100, - h = 100, + width = 100, + height = 100, positioning = Positioning.FLEX, flexDirection = FlexDirection.HORIZONTAL, justifyContent = JustifyContent.SPACE_BETWEEN, @@ -577,15 +577,15 @@ function TestJustifyContent:testJustifyContentWithNoAvailableSpace() local child1 = Gui.new({ id = "child1", - w = 50, - h = 30, + width = 50, + height = 30, positioning = Positioning.FLEX, }) local child2 = Gui.new({ id = "child2", - w = 50, - h = 40, + width = 50, + height = 40, positioning = Positioning.FLEX, }) @@ -604,8 +604,8 @@ function TestJustifyContent:testJustifyContentWithParentCoordinates() id = "parent", x = 50, y = 30, - w = 400, - h = 200, + width = 400, + height = 200, positioning = Positioning.ABSOLUTE, }) @@ -613,8 +613,8 @@ function TestJustifyContent:testJustifyContentWithParentCoordinates() id = "container", x = 20, y = 10, - w = 300, - h = 100, + width = 300, + height = 100, positioning = Positioning.FLEX, flexDirection = FlexDirection.HORIZONTAL, justifyContent = JustifyContent.CENTER, @@ -623,15 +623,15 @@ function TestJustifyContent:testJustifyContentWithParentCoordinates() local child1 = Gui.new({ id = "child1", - w = 50, - h = 30, + width = 50, + height = 30, positioning = Positioning.FLEX, }) local child2 = Gui.new({ id = "child2", - w = 60, - h = 40, + width = 60, + height = 40, positioning = Positioning.FLEX, }) @@ -661,8 +661,8 @@ function TestJustifyContent:testComplexNavigationBarLayout() justifyContent = JustifyContent.SPACE_BETWEEN, x = 0, y = 0, - w = 1200, - h = 80, + width = 1200, + height = 80, gap = 0, }) @@ -672,14 +672,14 @@ function TestJustifyContent:testComplexNavigationBarLayout() positioning = Positioning.FLEX, flexDirection = FlexDirection.HORIZONTAL, alignItems = AlignItems.CENTER, - w = 250, - h = 70, + width = 250, + height = 70, gap = 15, }) - local logo = Gui.new({ id = "logo", w = 60, h = 50 }) - local brandName = Gui.new({ id = "brandName", w = 120, h = 30 }) - local beta = Gui.new({ id = "beta", w = 40, h = 20 }) + local logo = Gui.new({ id = "logo", width = 60, height = 50 }) + local brandName = Gui.new({ id = "brandName", width = 120, height = 30 }) + local beta = Gui.new({ id = "beta", width = 40, height = 20 }) logoSection:addChild(logo) logoSection:addChild(brandName) @@ -691,8 +691,8 @@ function TestJustifyContent:testComplexNavigationBarLayout() positioning = Positioning.FLEX, flexDirection = FlexDirection.HORIZONTAL, justifyContent = JustifyContent.CENTER, - w = 500, - h = 70, + width = 500, + height = 70, gap = 30, }) @@ -704,13 +704,13 @@ function TestJustifyContent:testComplexNavigationBarLayout() flexDirection = FlexDirection.VERTICAL, justifyContent = JustifyContent.CENTER, alignItems = AlignItems.CENTER, - w = 80, - h = 60, + width = 80, + height = 60, gap = 5, }) - local itemText = Gui.new({ id = "itemText" .. itemName, w = 70, h = 20 }) - local itemDot = Gui.new({ id = "itemDot" .. itemName, w = 6, h = 6 }) + local itemText = Gui.new({ id = "itemText" .. itemName, width = 70, height = 20 }) + local itemDot = Gui.new({ id = "itemDot" .. itemName, width = 6, height = 6 }) menuItem:addChild(itemText) menuItem:addChild(itemDot) @@ -724,15 +724,15 @@ function TestJustifyContent:testComplexNavigationBarLayout() flexDirection = FlexDirection.HORIZONTAL, justifyContent = JustifyContent.FLEX_END, alignItems = AlignItems.CENTER, - w = 300, - h = 70, + width = 300, + height = 70, gap = 12, }) - local searchButton = Gui.new({ id = "searchButton", w = 40, h = 40 }) - local loginButton = Gui.new({ id = "loginButton", w = 80, h = 35 }) - local signupButton = Gui.new({ id = "signupButton", w = 100, h = 40 }) - local mobileMenu = Gui.new({ id = "mobileMenu", w = 35, h = 35 }) + local searchButton = Gui.new({ id = "searchButton", width = 40, height = 40 }) + local loginButton = Gui.new({ id = "loginButton", width = 80, height = 35 }) + local signupButton = Gui.new({ id = "signupButton", width = 100, height = 40 }) + local mobileMenu = Gui.new({ id = "mobileMenu", width = 35, height = 35 }) actionsSection:addChild(searchButton) actionsSection:addChild(loginButton) @@ -774,8 +774,8 @@ function TestJustifyContent:testDashboardMetricsSpaceAround() justifyContent = JustifyContent.SPACE_AROUND, x = 0, y = 0, - w = 1000, - h = 200, + width = 1000, + height = 200, gap = 0, }) @@ -793,8 +793,8 @@ function TestJustifyContent:testDashboardMetricsSpaceAround() positioning = Positioning.FLEX, flexDirection = FlexDirection.VERTICAL, justifyContent = JustifyContent.SPACE_BETWEEN, - w = 220, - h = 180, + width = 220, + height = 180, gap = 10, }) @@ -805,13 +805,13 @@ function TestJustifyContent:testDashboardMetricsSpaceAround() flexDirection = FlexDirection.HORIZONTAL, justifyContent = JustifyContent.SPACE_BETWEEN, alignItems = AlignItems.CENTER, - w = 200, - h = 30, + width = 200, + height = 30, gap = 5, }) - local metricTitle = Gui.new({ id = "metricTitle" .. i, w = 100, h = 25 }) - local metricIcon = Gui.new({ id = "metricIcon" .. i, w = 24, h = 24 }) + local metricTitle = Gui.new({ id = "metricTitle" .. i, width = 100, height = 25 }) + local metricIcon = Gui.new({ id = "metricIcon" .. i, width = 24, height = 24 }) cardHeader:addChild(metricTitle) cardHeader:addChild(metricIcon) @@ -823,19 +823,19 @@ function TestJustifyContent:testDashboardMetricsSpaceAround() flexDirection = FlexDirection.VERTICAL, justifyContent = JustifyContent.CENTER, alignItems = AlignItems.CENTER, - w = 200, - h = 80, + width = 200, + height = 80, gap = 8, }) - local mainValue = Gui.new({ id = "mainValue" .. i, w = 120, h = 40 }) - local valueLabel = Gui.new({ id = "valueLabel" .. i, w = 80, h = 16 }) + local mainValue = Gui.new({ id = "mainValue" .. i, width = 120, height = 40 }) + local valueLabel = Gui.new({ id = "valueLabel" .. i, width = 80, height = 16 }) valueSection:addChild(mainValue) valueSection:addChild(valueLabel) if metric.hasTrend then - local trendIndicator = Gui.new({ id = "trendIndicator" .. i, w = 60, h = 20 }) + local trendIndicator = Gui.new({ id = "trendIndicator" .. i, width = 60, height = 20 }) valueSection:addChild(trendIndicator) valueSection.height = 100 end @@ -847,19 +847,19 @@ function TestJustifyContent:testDashboardMetricsSpaceAround() flexDirection = FlexDirection.HORIZONTAL, justifyContent = metric.hasChart and JustifyContent.CENTER or JustifyContent.SPACE_EVENLY, alignItems = AlignItems.CENTER, - w = 200, - h = 50, + width = 200, + height = 50, gap = 5, }) if metric.hasChart then - local miniChart = Gui.new({ id = "miniChart" .. i, w = 150, h = 40 }) + local miniChart = Gui.new({ id = "miniChart" .. i, width = 150, height = 40 }) bottomSection:addChild(miniChart) else -- Add comparison indicators - local prevPeriod = Gui.new({ id = "prevPeriod" .. i, w = 60, h = 20 }) - local comparison = Gui.new({ id = "comparison" .. i, w = 40, h = 20 }) - local target = Gui.new({ id = "target" .. i, w = 60, h = 20 }) + local prevPeriod = Gui.new({ id = "prevPeriod" .. i, width = 60, height = 20 }) + local comparison = Gui.new({ id = "comparison" .. i, width = 40, height = 20 }) + local target = Gui.new({ id = "target" .. i, width = 60, height = 20 }) bottomSection:addChild(prevPeriod) bottomSection:addChild(comparison) @@ -901,8 +901,8 @@ function TestJustifyContent:testComplexFormJustifyContentLayout() flexDirection = FlexDirection.VERTICAL, x = 0, y = 0, - w = 600, - h = 800, + width = 600, + height = 800, gap = 25, }) @@ -913,8 +913,8 @@ function TestJustifyContent:testComplexFormJustifyContentLayout() flexDirection = FlexDirection.HORIZONTAL, justifyContent = JustifyContent.SPACE_BETWEEN, alignItems = AlignItems.CENTER, - w = 580, - h = 60, + width = 580, + height = 60, gap = 0, }) @@ -922,13 +922,13 @@ function TestJustifyContent:testComplexFormJustifyContentLayout() id = "headerLeft", positioning = Positioning.FLEX, flexDirection = FlexDirection.VERTICAL, - w = 200, - h = 50, + width = 200, + height = 50, gap = 5, }) - local formTitle = Gui.new({ id = "formTitle", w = 180, h = 30 }) - local formSubtitle = Gui.new({ id = "formSubtitle", w = 200, h = 15 }) + local formTitle = Gui.new({ id = "formTitle", width = 180, height = 30 }) + local formSubtitle = Gui.new({ id = "formSubtitle", width = 200, height = 15 }) headerLeft:addChild(formTitle) headerLeft:addChild(formSubtitle) @@ -939,13 +939,13 @@ function TestJustifyContent:testComplexFormJustifyContentLayout() flexDirection = FlexDirection.HORIZONTAL, justifyContent = JustifyContent.FLEX_END, alignItems = AlignItems.CENTER, - w = 150, - h = 50, + width = 150, + height = 50, gap = 10, }) - local helpButton = Gui.new({ id = "helpButton", w = 30, h = 30 }) - local closeButton = Gui.new({ id = "closeButton", w = 30, h = 30 }) + local helpButton = Gui.new({ id = "helpButton", width = 30, height = 30 }) + local closeButton = Gui.new({ id = "closeButton", width = 30, height = 30 }) headerRight:addChild(helpButton) headerRight:addChild(closeButton) @@ -958,8 +958,8 @@ function TestJustifyContent:testComplexFormJustifyContentLayout() id = "personalSection", positioning = Positioning.FLEX, flexDirection = FlexDirection.VERTICAL, - w = 580, - h = 250, + width = 580, + height = 250, gap = 15, }) @@ -968,13 +968,13 @@ function TestJustifyContent:testComplexFormJustifyContentLayout() positioning = Positioning.FLEX, flexDirection = FlexDirection.HORIZONTAL, justifyContent = JustifyContent.FLEX_START, - w = 580, - h = 30, + width = 580, + height = 30, gap = 10, }) - local titleText = Gui.new({ id = "titleText", w = 150, h = 25 }) - local titleIcon = Gui.new({ id = "titleIcon", w = 20, h = 20 }) + local titleText = Gui.new({ id = "titleText", width = 150, height = 25 }) + local titleIcon = Gui.new({ id = "titleIcon", width = 20, height = 20 }) sectionTitle:addChild(titleText) sectionTitle:addChild(titleIcon) @@ -985,8 +985,8 @@ function TestJustifyContent:testComplexFormJustifyContentLayout() positioning = Positioning.FLEX, flexDirection = FlexDirection.HORIZONTAL, justifyContent = JustifyContent.SPACE_BETWEEN, - w = 580, - h = 60, + width = 580, + height = 60, gap = 15, }) @@ -994,13 +994,13 @@ function TestJustifyContent:testComplexFormJustifyContentLayout() id = "firstNameGroup", positioning = Positioning.FLEX, flexDirection = FlexDirection.VERTICAL, - w = 275, - h = 55, + width = 275, + height = 55, gap = 5, }) - local firstNameLabel = Gui.new({ id = "firstNameLabel", w = 80, h = 20 }) - local firstNameInput = Gui.new({ id = "firstNameInput", w = 275, h = 30 }) + local firstNameLabel = Gui.new({ id = "firstNameLabel", width = 80, height = 20 }) + local firstNameInput = Gui.new({ id = "firstNameInput", width = 275, height = 30 }) firstNameGroup:addChild(firstNameLabel) firstNameGroup:addChild(firstNameInput) @@ -1009,13 +1009,13 @@ function TestJustifyContent:testComplexFormJustifyContentLayout() id = "lastNameGroup", positioning = Positioning.FLEX, flexDirection = FlexDirection.VERTICAL, - w = 275, - h = 55, + width = 275, + height = 55, gap = 5, }) - local lastNameLabel = Gui.new({ id = "lastNameLabel", w = 80, h = 20 }) - local lastNameInput = Gui.new({ id = "lastNameInput", w = 275, h = 30 }) + local lastNameLabel = Gui.new({ id = "lastNameLabel", width = 80, height = 20 }) + local lastNameInput = Gui.new({ id = "lastNameInput", width = 275, height = 30 }) lastNameGroup:addChild(lastNameLabel) lastNameGroup:addChild(lastNameInput) @@ -1030,8 +1030,8 @@ function TestJustifyContent:testComplexFormJustifyContentLayout() flexDirection = FlexDirection.HORIZONTAL, justifyContent = JustifyContent.SPACE_EVENLY, alignItems = AlignItems.CENTER, - w = 580, - h = 50, + width = 580, + height = 50, gap = 0, }) @@ -1040,26 +1040,26 @@ function TestJustifyContent:testComplexFormJustifyContentLayout() positioning = Positioning.FLEX, flexDirection = FlexDirection.HORIZONTAL, alignItems = AlignItems.CENTER, - w = 120, - h = 40, + width = 120, + height = 40, gap = 8, }) - Gui.new({ parent = emailOption, id = "emailCheckbox", w = 20, h = 20 }) - Gui.new({ parent = emailOption, id = "emailLabel", w = 60, h = 18 }) + Gui.new({ parent = emailOption, id = "emailCheckbox", width = 20, height = 20 }) + Gui.new({ parent = emailOption, id = "emailLabel", width = 60, height = 18 }) local phoneOption = Gui.new({ id = "phoneOption", positioning = Positioning.FLEX, flexDirection = FlexDirection.HORIZONTAL, alignItems = AlignItems.CENTER, - w = 120, - h = 40, + width = 120, + height = 40, gap = 8, }) - local phoneCheckbox = Gui.new({ id = "phoneCheckbox", w = 20, h = 20 }) - local phoneLabel = Gui.new({ id = "phoneLabel", w = 60, h = 18 }) + local phoneCheckbox = Gui.new({ id = "phoneCheckbox", width = 20, height = 20 }) + local phoneLabel = Gui.new({ id = "phoneLabel", width = 60, height = 18 }) phoneOption:addChild(phoneCheckbox) phoneOption:addChild(phoneLabel) @@ -1069,13 +1069,13 @@ function TestJustifyContent:testComplexFormJustifyContentLayout() positioning = Positioning.FLEX, flexDirection = FlexDirection.HORIZONTAL, alignItems = AlignItems.CENTER, - w = 100, - h = 40, + width = 100, + height = 40, gap = 8, }) - local smsCheckbox = Gui.new({ id = "smsCheckbox", w = 20, h = 20 }) - local smsLabel = Gui.new({ id = "smsLabel", w = 50, h = 18 }) + local smsCheckbox = Gui.new({ id = "smsCheckbox", width = 20, height = 20 }) + local smsLabel = Gui.new({ id = "smsLabel", width = 50, height = 18 }) smsOption:addChild(smsCheckbox) smsOption:addChild(smsLabel) @@ -1093,8 +1093,8 @@ function TestJustifyContent:testComplexFormJustifyContentLayout() id = "actionsSection", positioning = Positioning.FLEX, flexDirection = FlexDirection.VERTICAL, - w = 580, - h = 120, + width = 580, + height = 120, gap = 20, }) @@ -1104,14 +1104,14 @@ function TestJustifyContent:testComplexFormJustifyContentLayout() flexDirection = FlexDirection.HORIZONTAL, justifyContent = JustifyContent.FLEX_END, alignItems = AlignItems.CENTER, - w = 580, - h = 45, + width = 580, + height = 45, gap = 15, }) - local cancelButton = Gui.new({ id = "cancelButton", w = 80, h = 40 }) - local saveButton = Gui.new({ id = "saveButton", w = 100, h = 40 }) - local submitButton = Gui.new({ id = "submitButton", w = 120, h = 40 }) + local cancelButton = Gui.new({ id = "cancelButton", width = 80, height = 40 }) + local saveButton = Gui.new({ id = "saveButton", width = 100, height = 40 }) + local submitButton = Gui.new({ id = "submitButton", width = 120, height = 40 }) primaryActions:addChild(cancelButton) primaryActions:addChild(saveButton) @@ -1123,13 +1123,13 @@ function TestJustifyContent:testComplexFormJustifyContentLayout() flexDirection = FlexDirection.HORIZONTAL, justifyContent = JustifyContent.CENTER, alignItems = AlignItems.CENTER, - w = 580, - h = 35, + width = 580, + height = 35, gap = 25, }) - local resetButton = Gui.new({ id = "resetButton", w = 70, h = 30 }) - local previewButton = Gui.new({ id = "previewButton", w = 80, h = 30 }) + local resetButton = Gui.new({ id = "resetButton", width = 70, height = 30 }) + local previewButton = Gui.new({ id = "previewButton", width = 80, height = 30 }) secondaryActions:addChild(resetButton) secondaryActions:addChild(previewButton) @@ -1178,8 +1178,8 @@ function TestJustifyContent:testGridLayoutJustifyContentVariations() flexDirection = FlexDirection.VERTICAL, x = 0, y = 0, - w = 800, - h = 600, + width = 800, + height = 600, gap = 20, }) @@ -1189,8 +1189,8 @@ function TestJustifyContent:testGridLayoutJustifyContentVariations() positioning = Positioning.FLEX, flexDirection = FlexDirection.HORIZONTAL, justifyContent = JustifyContent.SPACE_BETWEEN, - w = 780, - h = 120, + width = 780, + height = 120, gap = 0, }) @@ -1201,13 +1201,13 @@ function TestJustifyContent:testGridLayoutJustifyContentVariations() flexDirection = FlexDirection.VERTICAL, justifyContent = JustifyContent.CENTER, alignItems = AlignItems.CENTER, - w = 150, - h = 100, + width = 150, + height = 100, gap = 10, }) - local cardIcon = Gui.new({ id = "row1Icon" .. i, w = 40, h = 40 }) - local cardLabel = Gui.new({ id = "row1Label" .. i, w = 100, h = 20 }) + local cardIcon = Gui.new({ id = "row1Icon" .. i, width = 40, height = 40 }) + local cardLabel = Gui.new({ id = "row1Label" .. i, width = 100, height = 20 }) card:addChild(cardIcon) card:addChild(cardLabel) @@ -1220,8 +1220,8 @@ function TestJustifyContent:testGridLayoutJustifyContentVariations() positioning = Positioning.FLEX, flexDirection = FlexDirection.HORIZONTAL, justifyContent = JustifyContent.SPACE_AROUND, - w = 780, - h = 120, + width = 780, + height = 120, gap = 0, }) @@ -1231,8 +1231,8 @@ function TestJustifyContent:testGridLayoutJustifyContentVariations() positioning = Positioning.FLEX, flexDirection = FlexDirection.VERTICAL, justifyContent = JustifyContent.SPACE_BETWEEN, - w = 200, - h = 100, + width = 200, + height = 100, gap = 5, }) @@ -1241,19 +1241,19 @@ function TestJustifyContent:testGridLayoutJustifyContentVariations() positioning = Positioning.FLEX, flexDirection = FlexDirection.HORIZONTAL, justifyContent = JustifyContent.SPACE_BETWEEN, - w = 180, - h = 25, + width = 180, + height = 25, gap = 0, }) - local headerTitle = Gui.new({ id = "row2HeaderTitle" .. i, w = 100, h = 20 }) - local headerIcon = Gui.new({ id = "row2HeaderIcon" .. i, w = 20, h = 20 }) + local headerTitle = Gui.new({ id = "row2HeaderTitle" .. i, width = 100, height = 20 }) + local headerIcon = Gui.new({ id = "row2HeaderIcon" .. i, width = 20, height = 20 }) cardHeader:addChild(headerTitle) cardHeader:addChild(headerIcon) - local cardContent = Gui.new({ id = "row2Content" .. i, w = 180, h = 40 }) - local cardFooter = Gui.new({ id = "row2Footer" .. i, w = 180, h = 20 }) + local cardContent = Gui.new({ id = "row2Content" .. i, width = 180, height = 40 }) + local cardFooter = Gui.new({ id = "row2Footer" .. i, width = 180, height = 20 }) card:addChild(cardHeader) card:addChild(cardContent) @@ -1267,8 +1267,8 @@ function TestJustifyContent:testGridLayoutJustifyContentVariations() positioning = Positioning.FLEX, flexDirection = FlexDirection.HORIZONTAL, justifyContent = JustifyContent.SPACE_EVENLY, - w = 780, - h = 120, + width = 780, + height = 120, gap = 0, }) @@ -1279,14 +1279,14 @@ function TestJustifyContent:testGridLayoutJustifyContentVariations() flexDirection = FlexDirection.VERTICAL, justifyContent = JustifyContent.FLEX_END, alignItems = AlignItems.CENTER, - w = 100, - h = 100, + width = 100, + height = 100, gap = 5, }) - local itemValue = Gui.new({ id = "row3Value" .. i, w = 60, h = 30 }) - local itemLabel = Gui.new({ id = "row3Label" .. i, w = 80, h = 15 }) - local itemTrend = Gui.new({ id = "row3Trend" .. i, w = 40, h = 12 }) + local itemValue = Gui.new({ id = "row3Value" .. i, width = 60, height = 30 }) + local itemLabel = Gui.new({ id = "row3Label" .. i, width = 80, height = 15 }) + local itemTrend = Gui.new({ id = "row3Trend" .. i, width = 40, height = 12 }) item:addChild(itemValue) item:addChild(itemLabel) @@ -1300,8 +1300,8 @@ function TestJustifyContent:testGridLayoutJustifyContentVariations() positioning = Positioning.FLEX, flexDirection = FlexDirection.HORIZONTAL, justifyContent = JustifyContent.CENTER, - w = 780, - h = 120, + width = 780, + height = 120, gap = 10, }) @@ -1313,13 +1313,13 @@ function TestJustifyContent:testGridLayoutJustifyContentVariations() flexDirection = FlexDirection.HORIZONTAL, justifyContent = JustifyContent.CENTER, alignItems = AlignItems.CENTER, - w = 90, - h = 30, + width = 90, + height = 30, gap = 5, }) - local chipIcon = Gui.new({ id = "row4ChipIcon" .. i, w = 16, h = 16 }) - local chipText = Gui.new({ id = "row4ChipText" .. i, w = 60, h = 14 }) + local chipIcon = Gui.new({ id = "row4ChipIcon" .. i, width = 16, height = 16 }) + local chipText = Gui.new({ id = "row4ChipText" .. i, width = 60, height = 14 }) chip:addChild(chipIcon) chip:addChild(chipText) @@ -1383,8 +1383,8 @@ function TestJustifyContent:testMultiLevelNestedModalJustifyContent() alignItems = AlignItems.CENTER, x = 0, y = 0, - w = 1200, - h = 800, + width = 1200, + height = 800, gap = 0, }) @@ -1393,8 +1393,8 @@ function TestJustifyContent:testMultiLevelNestedModalJustifyContent() positioning = Positioning.FLEX, flexDirection = FlexDirection.VERTICAL, justifyContent = JustifyContent.SPACE_BETWEEN, - w = 600, - h = 500, + width = 600, + height = 500, gap = 0, }) @@ -1405,8 +1405,8 @@ function TestJustifyContent:testMultiLevelNestedModalJustifyContent() flexDirection = FlexDirection.HORIZONTAL, justifyContent = JustifyContent.SPACE_BETWEEN, alignItems = AlignItems.CENTER, - w = 580, - h = 60, + width = 580, + height = 60, gap = 0, }) @@ -1415,13 +1415,13 @@ function TestJustifyContent:testMultiLevelNestedModalJustifyContent() positioning = Positioning.FLEX, flexDirection = FlexDirection.HORIZONTAL, alignItems = AlignItems.CENTER, - w = 200, - h = 50, + width = 200, + height = 50, gap = 12, }) - local modalIcon = Gui.new({ id = "modalIcon", w = 24, h = 24 }) - local modalTitle = Gui.new({ id = "modalTitle", w = 150, h = 30 }) + local modalIcon = Gui.new({ id = "modalIcon", width = 24, height = 24 }) + local modalTitle = Gui.new({ id = "modalTitle", width = 150, height = 30 }) headerLeft:addChild(modalIcon) headerLeft:addChild(modalTitle) @@ -1432,13 +1432,13 @@ function TestJustifyContent:testMultiLevelNestedModalJustifyContent() flexDirection = FlexDirection.HORIZONTAL, justifyContent = JustifyContent.FLEX_END, alignItems = AlignItems.CENTER, - w = 100, - h = 50, + width = 100, + height = 50, gap = 8, }) - local minimizeButton = Gui.new({ id = "minimizeButton", w = 30, h = 30 }) - local closeButton = Gui.new({ id = "closeButton", w = 30, h = 30 }) + local minimizeButton = Gui.new({ id = "minimizeButton", width = 30, height = 30 }) + local closeButton = Gui.new({ id = "closeButton", width = 30, height = 30 }) headerRight:addChild(minimizeButton) headerRight:addChild(closeButton) @@ -1451,8 +1451,8 @@ function TestJustifyContent:testMultiLevelNestedModalJustifyContent() id = "modalContent", positioning = Positioning.FLEX, flexDirection = FlexDirection.VERTICAL, - w = 580, - h = 380, + width = 580, + height = 380, gap = 20, }) @@ -1462,8 +1462,8 @@ function TestJustifyContent:testMultiLevelNestedModalJustifyContent() positioning = Positioning.FLEX, flexDirection = FlexDirection.HORIZONTAL, justifyContent = JustifyContent.SPACE_EVENLY, - w = 580, - h = 50, + width = 580, + height = 50, gap = 0, }) @@ -1475,13 +1475,13 @@ function TestJustifyContent:testMultiLevelNestedModalJustifyContent() flexDirection = FlexDirection.VERTICAL, justifyContent = JustifyContent.CENTER, alignItems = AlignItems.CENTER, - w = 120, - h = 45, + width = 120, + height = 45, gap = 5, }) - local tabText = Gui.new({ id = "tabText" .. tabName, w = 80, h = 18 }) - local tabIndicator = Gui.new({ id = "tabIndicator" .. tabName, w = 60, h = 3 }) + local tabText = Gui.new({ id = "tabText" .. tabName, width = 80, height = 18 }) + local tabIndicator = Gui.new({ id = "tabIndicator" .. tabName, width = 60, height = 3 }) tab:addChild(tabText) tab:addChild(tabIndicator) @@ -1493,8 +1493,8 @@ function TestJustifyContent:testMultiLevelNestedModalJustifyContent() id = "settingsArea", positioning = Positioning.FLEX, flexDirection = FlexDirection.VERTICAL, - w = 580, - h = 250, + width = 580, + height = 250, gap = 15, }) @@ -1506,8 +1506,8 @@ function TestJustifyContent:testMultiLevelNestedModalJustifyContent() flexDirection = FlexDirection.HORIZONTAL, justifyContent = i % 2 == 1 and JustifyContent.SPACE_BETWEEN or JustifyContent.FLEX_START, alignItems = AlignItems.CENTER, - w = 560, - h = 50, + width = 560, + height = 50, gap = 15, }) @@ -1516,13 +1516,13 @@ function TestJustifyContent:testMultiLevelNestedModalJustifyContent() positioning = Positioning.FLEX, flexDirection = FlexDirection.VERTICAL, justifyContent = JustifyContent.CENTER, - w = 300, - h = 40, + width = 300, + height = 40, gap = 3, }) - local settingLabel = Gui.new({ id = "settingLabel" .. i, w = 200, h = 20 }) - local settingDescription = Gui.new({ id = "settingDescription" .. i, w = 280, h = 14 }) + local settingLabel = Gui.new({ id = "settingLabel" .. i, width = 200, height = 20 }) + local settingDescription = Gui.new({ id = "settingDescription" .. i, width = 280, height = 14 }) settingInfo:addChild(settingLabel) settingInfo:addChild(settingDescription) @@ -1533,19 +1533,19 @@ function TestJustifyContent:testMultiLevelNestedModalJustifyContent() flexDirection = FlexDirection.HORIZONTAL, justifyContent = JustifyContent.CENTER, alignItems = AlignItems.CENTER, - w = i % 2 == 1 and 100 or 200, - h = 35, + width = i % 2 == 1 and 100 or 200, + height = 35, gap = 8, }) if i % 2 == 1 then -- Toggle switch - local toggle = Gui.new({ id = "toggle" .. i, w = 60, h = 30 }) + local toggle = Gui.new({ id = "toggle" .. i, width = 60, height = 30 }) settingControl:addChild(toggle) else -- Dropdown or input - local input = Gui.new({ id = "input" .. i, w = 120, h = 30 }) - local button = Gui.new({ id = "button" .. i, w = 60, h = 28 }) + local input = Gui.new({ id = "input" .. i, width = 120, height = 30 }) + local button = Gui.new({ id = "button" .. i, width = 60, height = 28 }) settingControl:addChild(input) settingControl:addChild(button) end @@ -1565,8 +1565,8 @@ function TestJustifyContent:testMultiLevelNestedModalJustifyContent() flexDirection = FlexDirection.HORIZONTAL, justifyContent = JustifyContent.SPACE_BETWEEN, alignItems = AlignItems.CENTER, - w = 580, - h = 60, + width = 580, + height = 60, gap = 0, }) @@ -1576,13 +1576,13 @@ function TestJustifyContent:testMultiLevelNestedModalJustifyContent() flexDirection = FlexDirection.HORIZONTAL, justifyContent = JustifyContent.FLEX_START, alignItems = AlignItems.CENTER, - w = 200, - h = 50, + width = 200, + height = 50, gap = 10, }) - local resetButton = Gui.new({ id = "resetButton", w = 80, h = 35 }) - local helpLink = Gui.new({ id = "helpLink", w = 60, h = 20 }) + local resetButton = Gui.new({ id = "resetButton", width = 80, height = 35 }) + local helpLink = Gui.new({ id = "helpLink", width = 60, height = 20 }) footerLeft:addChild(resetButton) footerLeft:addChild(helpLink) @@ -1593,14 +1593,14 @@ function TestJustifyContent:testMultiLevelNestedModalJustifyContent() flexDirection = FlexDirection.HORIZONTAL, justifyContent = JustifyContent.FLEX_END, alignItems = AlignItems.CENTER, - w = 250, - h = 50, + width = 250, + height = 50, gap = 12, }) - local cancelButton = Gui.new({ id = "cancelButton", w = 70, h = 35 }) - local applyButton = Gui.new({ id = "applyButton", w = 70, h = 35 }) - local saveButton = Gui.new({ id = "saveButton", w = 80, h = 35 }) + local cancelButton = Gui.new({ id = "cancelButton", width = 70, height = 35 }) + local applyButton = Gui.new({ id = "applyButton", width = 70, height = 35 }) + local saveButton = Gui.new({ id = "saveButton", width = 80, height = 35 }) footerRight:addChild(cancelButton) footerRight:addChild(applyButton) diff --git a/testing/__tests__/06_align_items_tests.lua b/testing/__tests__/06_align_items_tests.lua index 6d8a857..079c68d 100644 --- a/testing/__tests__/06_align_items_tests.lua +++ b/testing/__tests__/06_align_items_tests.lua @@ -34,8 +34,8 @@ function TestAlignItems:testHorizontalFlexAlignItemsFlexStart() id = "container", x = 0, y = 0, - w = 300, - h = 100, + width = 300, + height = 100, positioning = Positioning.FLEX, flexDirection = FlexDirection.HORIZONTAL, alignItems = AlignItems.FLEX_START, @@ -43,22 +43,22 @@ function TestAlignItems:testHorizontalFlexAlignItemsFlexStart() local child1 = Gui.new({ id = "child1", - w = 50, - h = 30, + width = 50, + height = 30, positioning = Positioning.FLEX, }) local child2 = Gui.new({ id = "child2", - w = 60, - h = 40, + width = 60, + height = 40, positioning = Positioning.FLEX, }) local child3 = Gui.new({ id = "child3", - w = 70, - h = 20, + width = 70, + height = 20, positioning = Positioning.FLEX, }) @@ -83,8 +83,8 @@ function TestAlignItems:testHorizontalFlexAlignItemsCenter() id = "container", x = 0, y = 0, - w = 300, - h = 100, + width = 300, + height = 100, positioning = Positioning.FLEX, flexDirection = FlexDirection.HORIZONTAL, alignItems = AlignItems.CENTER, @@ -92,15 +92,15 @@ function TestAlignItems:testHorizontalFlexAlignItemsCenter() local child1 = Gui.new({ id = "child1", - w = 50, - h = 30, + width = 50, + height = 30, positioning = Positioning.FLEX, }) local child2 = Gui.new({ id = "child2", - w = 60, - h = 40, + width = 60, + height = 40, positioning = Positioning.FLEX, }) @@ -124,8 +124,8 @@ function TestAlignItems:testHorizontalFlexAlignItemsFlexEnd() id = "container", x = 0, y = 0, - w = 300, - h = 100, + width = 300, + height = 100, positioning = Positioning.FLEX, flexDirection = FlexDirection.HORIZONTAL, alignItems = AlignItems.FLEX_END, @@ -133,15 +133,15 @@ function TestAlignItems:testHorizontalFlexAlignItemsFlexEnd() local child1 = Gui.new({ id = "child1", - w = 50, - h = 30, + width = 50, + height = 30, positioning = Positioning.FLEX, }) local child2 = Gui.new({ id = "child2", - w = 60, - h = 40, + width = 60, + height = 40, positioning = Positioning.FLEX, }) @@ -165,8 +165,8 @@ function TestAlignItems:testHorizontalFlexAlignItemsStretch() id = "container", x = 0, y = 0, - w = 300, - h = 100, + width = 300, + height = 100, positioning = Positioning.FLEX, flexDirection = FlexDirection.HORIZONTAL, alignItems = AlignItems.STRETCH, @@ -174,15 +174,15 @@ function TestAlignItems:testHorizontalFlexAlignItemsStretch() local child1 = Gui.new({ id = "child1", - w = 50, - h = 30, + width = 50, + height = 30, positioning = Positioning.FLEX, }) local child2 = Gui.new({ id = "child2", - w = 60, - h = 40, + width = 60, + height = 40, positioning = Positioning.FLEX, }) @@ -202,8 +202,8 @@ function TestAlignItems:testVerticalFlexAlignItemsFlexStart() id = "container", x = 0, y = 0, - w = 200, - h = 300, + width = 200, + height = 300, positioning = Positioning.FLEX, flexDirection = FlexDirection.VERTICAL, alignItems = AlignItems.FLEX_START, @@ -211,22 +211,22 @@ function TestAlignItems:testVerticalFlexAlignItemsFlexStart() local child1 = Gui.new({ id = "child1", - w = 50, - h = 30, + width = 50, + height = 30, positioning = Positioning.FLEX, }) local child2 = Gui.new({ id = "child2", - w = 80, - h = 40, + width = 80, + height = 40, positioning = Positioning.FLEX, }) local child3 = Gui.new({ id = "child3", - w = 60, - h = 35, + width = 60, + height = 35, positioning = Positioning.FLEX, }) @@ -251,8 +251,8 @@ function TestAlignItems:testVerticalFlexAlignItemsCenter() id = "container", x = 0, y = 0, - w = 200, - h = 300, + width = 200, + height = 300, positioning = Positioning.FLEX, flexDirection = FlexDirection.VERTICAL, alignItems = AlignItems.CENTER, @@ -260,15 +260,15 @@ function TestAlignItems:testVerticalFlexAlignItemsCenter() local child1 = Gui.new({ id = "child1", - w = 50, - h = 30, + width = 50, + height = 30, positioning = Positioning.FLEX, }) local child2 = Gui.new({ id = "child2", - w = 80, - h = 40, + width = 80, + height = 40, positioning = Positioning.FLEX, }) @@ -292,8 +292,8 @@ function TestAlignItems:testVerticalFlexAlignItemsFlexEnd() id = "container", x = 0, y = 0, - w = 200, - h = 300, + width = 200, + height = 300, positioning = Positioning.FLEX, flexDirection = FlexDirection.VERTICAL, alignItems = AlignItems.FLEX_END, @@ -301,15 +301,15 @@ function TestAlignItems:testVerticalFlexAlignItemsFlexEnd() local child1 = Gui.new({ id = "child1", - w = 50, - h = 30, + width = 50, + height = 30, positioning = Positioning.FLEX, }) local child2 = Gui.new({ id = "child2", - w = 80, - h = 40, + width = 80, + height = 40, positioning = Positioning.FLEX, }) @@ -333,8 +333,8 @@ function TestAlignItems:testVerticalFlexAlignItemsStretch() id = "container", x = 0, y = 0, - w = 200, - h = 300, + width = 200, + height = 300, positioning = Positioning.FLEX, flexDirection = FlexDirection.VERTICAL, alignItems = AlignItems.STRETCH, @@ -342,15 +342,15 @@ function TestAlignItems:testVerticalFlexAlignItemsStretch() local child1 = Gui.new({ id = "child1", - w = 50, - h = 30, + width = 50, + height = 30, positioning = Positioning.FLEX, }) local child2 = Gui.new({ id = "child2", - w = 80, - h = 40, + width = 80, + height = 40, positioning = Positioning.FLEX, }) @@ -370,8 +370,8 @@ function TestAlignItems:testDefaultAlignItems() id = "container", x = 0, y = 0, - w = 300, - h = 100, + width = 300, + height = 100, positioning = Positioning.FLEX, flexDirection = FlexDirection.HORIZONTAL, -- No alignItems specified, should default to STRETCH @@ -379,8 +379,8 @@ function TestAlignItems:testDefaultAlignItems() local child = Gui.new({ id = "child", - w = 50, - h = 30, + width = 50, + height = 30, positioning = Positioning.FLEX, }) @@ -397,8 +397,8 @@ function TestAlignItems:testAlignItemsWithMixedChildSizes() id = "container", x = 0, y = 0, - w = 300, - h = 120, + width = 300, + height = 120, positioning = Positioning.FLEX, flexDirection = FlexDirection.HORIZONTAL, alignItems = AlignItems.CENTER, @@ -406,22 +406,22 @@ function TestAlignItems:testAlignItemsWithMixedChildSizes() local child1 = Gui.new({ id = "child1", - w = 40, - h = 20, + width = 40, + height = 20, positioning = Positioning.FLEX, }) local child2 = Gui.new({ id = "child2", - w = 50, - h = 80, + width = 50, + height = 80, positioning = Positioning.FLEX, }) local child3 = Gui.new({ id = "child3", - w = 60, - h = 30, + width = 60, + height = 30, positioning = Positioning.FLEX, }) @@ -444,8 +444,8 @@ function TestAlignItems:testAlignItemsWithSingleChild() id = "container", x = 0, y = 0, - w = 200, - h = 100, + width = 200, + height = 100, positioning = Positioning.FLEX, flexDirection = FlexDirection.HORIZONTAL, alignItems = AlignItems.FLEX_END, @@ -453,8 +453,8 @@ function TestAlignItems:testAlignItemsWithSingleChild() local child = Gui.new({ id = "child", - w = 50, - h = 30, + width = 50, + height = 30, positioning = Positioning.FLEX, }) @@ -470,8 +470,8 @@ function TestAlignItems:testAlignItemsWithContainerCoordinates() id = "container", x = 50, y = 20, - w = 300, - h = 100, + width = 300, + height = 100, positioning = Positioning.FLEX, flexDirection = FlexDirection.HORIZONTAL, alignItems = AlignItems.CENTER, @@ -479,8 +479,8 @@ function TestAlignItems:testAlignItemsWithContainerCoordinates() local child = Gui.new({ id = "child", - w = 60, - h = 40, + width = 60, + height = 40, positioning = Positioning.FLEX, }) @@ -498,8 +498,8 @@ function TestAlignItems:testAlignItemsBaseline() id = "container", x = 0, y = 0, - w = 300, - h = 100, + width = 300, + height = 100, positioning = Positioning.FLEX, flexDirection = FlexDirection.HORIZONTAL, alignItems = AlignItems.BASELINE, @@ -507,15 +507,15 @@ function TestAlignItems:testAlignItemsBaseline() local child1 = Gui.new({ id = "child1", - w = 50, - h = 30, + width = 50, + height = 30, positioning = Positioning.FLEX, }) local child2 = Gui.new({ id = "child2", - w = 60, - h = 40, + width = 60, + height = 40, positioning = Positioning.FLEX, }) @@ -533,8 +533,8 @@ function TestAlignItems:testAlignItemsWithGap() id = "container", x = 0, y = 0, - w = 300, - h = 100, + width = 300, + height = 100, positioning = Positioning.FLEX, flexDirection = FlexDirection.HORIZONTAL, alignItems = AlignItems.CENTER, @@ -543,15 +543,15 @@ function TestAlignItems:testAlignItemsWithGap() local child1 = Gui.new({ id = "child1", - w = 50, - h = 30, + width = 50, + height = 30, positioning = Positioning.FLEX, }) local child2 = Gui.new({ id = "child2", - w = 60, - h = 40, + width = 60, + height = 40, positioning = Positioning.FLEX, }) @@ -574,8 +574,8 @@ function TestAlignItems:testAlignItemsCrossAxisConsistency() id = "hContainer", x = 0, y = 0, - w = 200, - h = 100, + width = 200, + height = 100, positioning = Positioning.FLEX, flexDirection = FlexDirection.HORIZONTAL, alignItems = AlignItems.CENTER, @@ -583,8 +583,8 @@ function TestAlignItems:testAlignItemsCrossAxisConsistency() local hChild = Gui.new({ id = "hChild", - w = 50, - h = 40, + width = 50, + height = 40, positioning = Positioning.FLEX, }) @@ -595,8 +595,8 @@ function TestAlignItems:testAlignItemsCrossAxisConsistency() id = "vContainer", x = 0, y = 0, - w = 100, - h = 200, + width = 100, + height = 200, positioning = Positioning.FLEX, flexDirection = FlexDirection.VERTICAL, alignItems = AlignItems.CENTER, @@ -604,8 +604,8 @@ function TestAlignItems:testAlignItemsCrossAxisConsistency() local vChild = Gui.new({ id = "vChild", - w = 40, - h = 50, + width = 40, + height = 50, positioning = Positioning.FLEX, }) @@ -623,8 +623,8 @@ function TestAlignItems:testComplexCardLayoutMixedAlignItems() id = "card", x = 10, y = 10, - w = 300, - h = 200, + width = 300, + height = 200, positioning = Positioning.FLEX, flexDirection = FlexDirection.VERTICAL, alignItems = AlignItems.STRETCH, @@ -633,8 +633,8 @@ function TestAlignItems:testComplexCardLayoutMixedAlignItems() -- Card header with icon and title (horizontal layout, center-aligned) local header = Gui.new({ id = "header", - w = 300, - h = 50, + width = 300, + height = 50, positioning = Positioning.FLEX, flexDirection = FlexDirection.HORIZONTAL, alignItems = AlignItems.CENTER, @@ -642,22 +642,22 @@ function TestAlignItems:testComplexCardLayoutMixedAlignItems() local icon = Gui.new({ id = "icon", - w = 24, - h = 24, + width = 24, + height = 24, positioning = Positioning.FLEX, }) local title = Gui.new({ id = "title", - w = 200, - h = 24, + width = 200, + height = 24, positioning = Positioning.FLEX, }) local actions = Gui.new({ id = "actions", - w = 60, - h = 30, + width = 60, + height = 30, positioning = Positioning.FLEX, flexDirection = FlexDirection.HORIZONTAL, alignItems = AlignItems.FLEX_START, @@ -665,23 +665,23 @@ function TestAlignItems:testComplexCardLayoutMixedAlignItems() local btn1 = Gui.new({ id = "btn1", - w = 28, - h = 28, + width = 28, + height = 28, positioning = Positioning.FLEX, }) local btn2 = Gui.new({ id = "btn2", - w = 28, - h = 20, + width = 28, + height = 20, positioning = Positioning.FLEX, }) -- Card content with flex-end alignment local content = Gui.new({ id = "content", - w = 300, - h = 120, + width = 300, + height = 120, positioning = Positioning.FLEX, flexDirection = FlexDirection.VERTICAL, alignItems = AlignItems.FLEX_END, @@ -689,23 +689,23 @@ function TestAlignItems:testComplexCardLayoutMixedAlignItems() local contentText = Gui.new({ id = "contentText", - w = 250, - h = 80, + width = 250, + height = 80, positioning = Positioning.FLEX, }) local metadata = Gui.new({ id = "metadata", - w = 180, - h = 30, + width = 180, + height = 30, positioning = Positioning.FLEX, }) -- Card footer with space-between and center alignment local footer = Gui.new({ id = "footer", - w = 300, - h = 30, + width = 300, + height = 30, positioning = Positioning.FLEX, flexDirection = FlexDirection.HORIZONTAL, alignItems = AlignItems.CENTER, @@ -714,15 +714,15 @@ function TestAlignItems:testComplexCardLayoutMixedAlignItems() local timestamp = Gui.new({ id = "timestamp", - w = 80, - h = 16, + width = 80, + height = 16, positioning = Positioning.FLEX, }) local status = Gui.new({ id = "status", - w = 60, - h = 20, + width = 60, + height = 20, positioning = Positioning.FLEX, }) @@ -767,8 +767,8 @@ function TestAlignItems:testComplexMediaObjectNestedAlignments() id = "mediaContainer", x = 0, y = 0, - w = 400, - h = 150, + width = 400, + height = 150, positioning = Positioning.FLEX, flexDirection = FlexDirection.HORIZONTAL, alignItems = AlignItems.FLEX_START, @@ -777,8 +777,8 @@ function TestAlignItems:testComplexMediaObjectNestedAlignments() -- Media (image/avatar) section local mediaSection = Gui.new({ id = "mediaSection", - w = 80, - h = 150, + width = 80, + height = 150, positioning = Positioning.FLEX, flexDirection = FlexDirection.VERTICAL, alignItems = AlignItems.CENTER, @@ -786,23 +786,23 @@ function TestAlignItems:testComplexMediaObjectNestedAlignments() local avatar = Gui.new({ id = "avatar", - w = 60, - h = 60, + width = 60, + height = 60, positioning = Positioning.FLEX, }) local badge = Gui.new({ id = "badge", - w = 20, - h = 20, + width = 20, + height = 20, positioning = Positioning.FLEX, }) -- Content section with multiple alignment variations local contentSection = Gui.new({ id = "contentSection", - w = 280, - h = 150, + width = 280, + height = 150, positioning = Positioning.FLEX, flexDirection = FlexDirection.VERTICAL, alignItems = AlignItems.STRETCH, @@ -811,8 +811,8 @@ function TestAlignItems:testComplexMediaObjectNestedAlignments() -- Header with user info (flex-end alignment) local userHeader = Gui.new({ id = "userHeader", - w = 280, - h = 40, + width = 280, + height = 40, positioning = Positioning.FLEX, flexDirection = FlexDirection.HORIZONTAL, alignItems = AlignItems.FLEX_END, @@ -820,30 +820,30 @@ function TestAlignItems:testComplexMediaObjectNestedAlignments() local username = Gui.new({ id = "username", - w = 120, - h = 24, + width = 120, + height = 24, positioning = Positioning.FLEX, }) local timestamp = Gui.new({ id = "timestamp", - w = 80, - h = 16, + width = 80, + height = 16, positioning = Positioning.FLEX, }) local menu = Gui.new({ id = "menu", - w = 30, - h = 30, + width = 30, + height = 30, positioning = Positioning.FLEX, }) -- Main content with center alignment local mainContent = Gui.new({ id = "mainContent", - w = 280, - h = 80, + width = 280, + height = 80, positioning = Positioning.FLEX, flexDirection = FlexDirection.VERTICAL, alignItems = AlignItems.CENTER, @@ -851,15 +851,15 @@ function TestAlignItems:testComplexMediaObjectNestedAlignments() local text = Gui.new({ id = "text", - w = 260, - h = 60, + width = 260, + height = 60, positioning = Positioning.FLEX, }) local attachments = Gui.new({ id = "attachments", - w = 200, - h = 15, + width = 200, + height = 15, positioning = Positioning.FLEX, flexDirection = FlexDirection.HORIZONTAL, alignItems = AlignItems.CENTER, @@ -867,23 +867,23 @@ function TestAlignItems:testComplexMediaObjectNestedAlignments() local attach1 = Gui.new({ id = "attach1", - w = 12, - h = 12, + width = 12, + height = 12, positioning = Positioning.FLEX, }) local attach2 = Gui.new({ id = "attach2", - w = 12, - h = 8, + width = 12, + height = 8, positioning = Positioning.FLEX, }) -- Footer actions with space-between local actionsFooter = Gui.new({ id = "actionsFooter", - w = 280, - h = 30, + width = 280, + height = 30, positioning = Positioning.FLEX, flexDirection = FlexDirection.HORIZONTAL, alignItems = AlignItems.CENTER, @@ -892,8 +892,8 @@ function TestAlignItems:testComplexMediaObjectNestedAlignments() local reactions = Gui.new({ id = "reactions", - w = 100, - h = 20, + width = 100, + height = 20, positioning = Positioning.FLEX, flexDirection = FlexDirection.HORIZONTAL, alignItems = AlignItems.CENTER, @@ -901,22 +901,22 @@ function TestAlignItems:testComplexMediaObjectNestedAlignments() local like = Gui.new({ id = "like", - w = 16, - h = 16, + width = 16, + height = 16, positioning = Positioning.FLEX, }) local share = Gui.new({ id = "share", - w = 16, - h = 14, + width = 16, + height = 14, positioning = Positioning.FLEX, }) local moreActions = Gui.new({ id = "moreActions", - w = 60, - h = 24, + width = 60, + height = 24, positioning = Positioning.FLEX, }) @@ -974,8 +974,8 @@ function TestAlignItems:testComplexToolbarVariedAlignments() id = "toolbar", x = 0, y = 0, - w = 600, - h = 60, + width = 600, + height = 60, positioning = Positioning.FLEX, flexDirection = FlexDirection.HORIZONTAL, alignItems = AlignItems.CENTER, @@ -985,8 +985,8 @@ function TestAlignItems:testComplexToolbarVariedAlignments() -- Left section with logo and nav (flex-start alignment) local leftSection = Gui.new({ id = "leftSection", - w = 200, - h = 60, + width = 200, + height = 60, positioning = Positioning.FLEX, flexDirection = FlexDirection.HORIZONTAL, alignItems = AlignItems.FLEX_START, @@ -994,15 +994,15 @@ function TestAlignItems:testComplexToolbarVariedAlignments() local logo = Gui.new({ id = "logo", - w = 40, - h = 40, + width = 40, + height = 40, positioning = Positioning.FLEX, }) local navigation = Gui.new({ id = "navigation", - w = 150, - h = 50, + width = 150, + height = 50, positioning = Positioning.FLEX, flexDirection = FlexDirection.HORIZONTAL, alignItems = AlignItems.CENTER, @@ -1010,23 +1010,23 @@ function TestAlignItems:testComplexToolbarVariedAlignments() local navItem1 = Gui.new({ id = "navItem1", - w = 60, - h = 30, + width = 60, + height = 30, positioning = Positioning.FLEX, }) local navItem2 = Gui.new({ id = "navItem2", - w = 70, - h = 35, + width = 70, + height = 35, positioning = Positioning.FLEX, }) -- Center section with search (stretch alignment) local centerSection = Gui.new({ id = "centerSection", - w = 250, - h = 60, + width = 250, + height = 60, positioning = Positioning.FLEX, flexDirection = FlexDirection.VERTICAL, alignItems = AlignItems.STRETCH, @@ -1034,8 +1034,8 @@ function TestAlignItems:testComplexToolbarVariedAlignments() local searchContainer = Gui.new({ id = "searchContainer", - w = 250, - h = 40, + width = 250, + height = 40, positioning = Positioning.FLEX, flexDirection = FlexDirection.HORIZONTAL, alignItems = AlignItems.CENTER, @@ -1043,30 +1043,30 @@ function TestAlignItems:testComplexToolbarVariedAlignments() local searchInput = Gui.new({ id = "searchInput", - w = 200, - h = 32, + width = 200, + height = 32, positioning = Positioning.FLEX, }) local searchButton = Gui.new({ id = "searchButton", - w = 36, - h = 36, + width = 36, + height = 36, positioning = Positioning.FLEX, }) local searchHint = Gui.new({ id = "searchHint", - w = 250, - h = 16, + width = 250, + height = 16, positioning = Positioning.FLEX, }) -- Right section with user controls (flex-end alignment) local rightSection = Gui.new({ id = "rightSection", - w = 150, - h = 60, + width = 150, + height = 60, positioning = Positioning.FLEX, flexDirection = FlexDirection.HORIZONTAL, alignItems = AlignItems.FLEX_END, @@ -1074,8 +1074,8 @@ function TestAlignItems:testComplexToolbarVariedAlignments() local notifications = Gui.new({ id = "notifications", - w = 30, - h = 35, + width = 30, + height = 35, positioning = Positioning.FLEX, flexDirection = FlexDirection.VERTICAL, alignItems = AlignItems.CENTER, @@ -1083,22 +1083,22 @@ function TestAlignItems:testComplexToolbarVariedAlignments() local notifIcon = Gui.new({ id = "notifIcon", - w = 20, - h = 20, + width = 20, + height = 20, positioning = Positioning.FLEX, }) local notifBadge = Gui.new({ id = "notifBadge", - w = 12, - h = 12, + width = 12, + height = 12, positioning = Positioning.FLEX, }) local userMenu = Gui.new({ id = "userMenu", - w = 80, - h = 45, + width = 80, + height = 45, positioning = Positioning.FLEX, flexDirection = FlexDirection.HORIZONTAL, alignItems = AlignItems.CENTER, @@ -1106,15 +1106,15 @@ function TestAlignItems:testComplexToolbarVariedAlignments() local userAvatar = Gui.new({ id = "userAvatar", - w = 32, - h = 32, + width = 32, + height = 32, positioning = Positioning.FLEX, }) local dropdown = Gui.new({ id = "dropdown", - w = 40, - h = 25, + width = 40, + height = 25, positioning = Positioning.FLEX, }) @@ -1170,8 +1170,8 @@ function TestAlignItems:testComplexDashboardWidgetLayout() id = "dashboard", x = 0, y = 0, - w = 800, - h = 600, + width = 800, + height = 600, positioning = Positioning.FLEX, flexDirection = FlexDirection.VERTICAL, alignItems = AlignItems.STRETCH, @@ -1180,8 +1180,8 @@ function TestAlignItems:testComplexDashboardWidgetLayout() -- Header with title and controls local header = Gui.new({ id = "header", - w = 800, - h = 80, + width = 800, + height = 80, positioning = Positioning.FLEX, flexDirection = FlexDirection.HORIZONTAL, alignItems = AlignItems.CENTER, @@ -1190,8 +1190,8 @@ function TestAlignItems:testComplexDashboardWidgetLayout() local titleSection = Gui.new({ id = "titleSection", - w = 300, - h = 80, + width = 300, + height = 80, positioning = Positioning.FLEX, flexDirection = FlexDirection.VERTICAL, alignItems = AlignItems.FLEX_START, @@ -1199,22 +1199,22 @@ function TestAlignItems:testComplexDashboardWidgetLayout() local title = Gui.new({ id = "title", - w = 250, - h = 40, + width = 250, + height = 40, positioning = Positioning.FLEX, }) local subtitle = Gui.new({ id = "subtitle", - w = 200, - h = 24, + width = 200, + height = 24, positioning = Positioning.FLEX, }) local controlsSection = Gui.new({ id = "controlsSection", - w = 200, - h = 80, + width = 200, + height = 80, positioning = Positioning.FLEX, flexDirection = FlexDirection.HORIZONTAL, alignItems = AlignItems.FLEX_END, @@ -1222,30 +1222,30 @@ function TestAlignItems:testComplexDashboardWidgetLayout() local filterBtn = Gui.new({ id = "filterBtn", - w = 60, - h = 35, + width = 60, + height = 35, positioning = Positioning.FLEX, }) local exportBtn = Gui.new({ id = "exportBtn", - w = 70, - h = 35, + width = 70, + height = 35, positioning = Positioning.FLEX, }) local settingsBtn = Gui.new({ id = "settingsBtn", - w = 40, - h = 40, + width = 40, + height = 40, positioning = Positioning.FLEX, }) -- Main content area with widgets local mainContent = Gui.new({ id = "mainContent", - w = 800, - h = 480, + width = 800, + height = 480, positioning = Positioning.FLEX, flexDirection = FlexDirection.HORIZONTAL, alignItems = AlignItems.STRETCH, @@ -1254,8 +1254,8 @@ function TestAlignItems:testComplexDashboardWidgetLayout() -- Left panel with statistics (center alignment) local leftPanel = Gui.new({ id = "leftPanel", - w = 250, - h = 480, + width = 250, + height = 480, positioning = Positioning.FLEX, flexDirection = FlexDirection.VERTICAL, alignItems = AlignItems.CENTER, @@ -1263,8 +1263,8 @@ function TestAlignItems:testComplexDashboardWidgetLayout() local statCard1 = Gui.new({ id = "statCard1", - w = 220, - h = 120, + width = 220, + height = 120, positioning = Positioning.FLEX, flexDirection = FlexDirection.VERTICAL, alignItems = AlignItems.CENTER, @@ -1272,29 +1272,29 @@ function TestAlignItems:testComplexDashboardWidgetLayout() local stat1Value = Gui.new({ id = "stat1Value", - w = 100, - h = 40, + width = 100, + height = 40, positioning = Positioning.FLEX, }) local stat1Label = Gui.new({ id = "stat1Label", - w = 150, - h = 20, + width = 150, + height = 20, positioning = Positioning.FLEX, }) local stat1Chart = Gui.new({ id = "stat1Chart", - w = 180, - h = 50, + width = 180, + height = 50, positioning = Positioning.FLEX, }) local statCard2 = Gui.new({ id = "statCard2", - w = 220, - h = 120, + width = 220, + height = 120, positioning = Positioning.FLEX, flexDirection = FlexDirection.VERTICAL, alignItems = AlignItems.FLEX_END, @@ -1302,23 +1302,23 @@ function TestAlignItems:testComplexDashboardWidgetLayout() local stat2Value = Gui.new({ id = "stat2Value", - w = 120, - h = 35, + width = 120, + height = 35, positioning = Positioning.FLEX, }) local stat2Trend = Gui.new({ id = "stat2Trend", - w = 80, - h = 20, + width = 80, + height = 20, positioning = Positioning.FLEX, }) -- Center panel with main chart (stretch alignment) local centerPanel = Gui.new({ id = "centerPanel", - w = 400, - h = 480, + width = 400, + height = 480, positioning = Positioning.FLEX, flexDirection = FlexDirection.VERTICAL, alignItems = AlignItems.STRETCH, @@ -1326,8 +1326,8 @@ function TestAlignItems:testComplexDashboardWidgetLayout() local chartHeader = Gui.new({ id = "chartHeader", - w = 400, - h = 60, + width = 400, + height = 60, positioning = Positioning.FLEX, flexDirection = FlexDirection.HORIZONTAL, alignItems = AlignItems.CENTER, @@ -1336,15 +1336,15 @@ function TestAlignItems:testComplexDashboardWidgetLayout() local chartTitle = Gui.new({ id = "chartTitle", - w = 200, - h = 30, + width = 200, + height = 30, positioning = Positioning.FLEX, }) local chartControls = Gui.new({ id = "chartControls", - w = 120, - h = 40, + width = 120, + height = 40, positioning = Positioning.FLEX, flexDirection = FlexDirection.HORIZONTAL, alignItems = AlignItems.CENTER, @@ -1352,30 +1352,30 @@ function TestAlignItems:testComplexDashboardWidgetLayout() local timeRange = Gui.new({ id = "timeRange", - w = 80, - h = 25, + width = 80, + height = 25, positioning = Positioning.FLEX, }) local refreshBtn = Gui.new({ id = "refreshBtn", - w = 30, - h = 30, + width = 30, + height = 30, positioning = Positioning.FLEX, }) local mainChart = Gui.new({ id = "mainChart", - w = 400, - h = 380, + width = 400, + height = 380, positioning = Positioning.FLEX, }) -- Right panel with lists (flex-start alignment) local rightPanel = Gui.new({ id = "rightPanel", - w = 150, - h = 480, + width = 150, + height = 480, positioning = Positioning.FLEX, flexDirection = FlexDirection.VERTICAL, alignItems = AlignItems.FLEX_START, @@ -1383,8 +1383,8 @@ function TestAlignItems:testComplexDashboardWidgetLayout() local alertsList = Gui.new({ id = "alertsList", - w = 140, - h = 200, + width = 140, + height = 200, positioning = Positioning.FLEX, flexDirection = FlexDirection.VERTICAL, alignItems = AlignItems.STRETCH, @@ -1392,22 +1392,22 @@ function TestAlignItems:testComplexDashboardWidgetLayout() local alert1 = Gui.new({ id = "alert1", - w = 140, - h = 40, + width = 140, + height = 40, positioning = Positioning.FLEX, }) local alert2 = Gui.new({ id = "alert2", - w = 140, - h = 35, + width = 140, + height = 35, positioning = Positioning.FLEX, }) local tasksList = Gui.new({ id = "tasksList", - w = 130, - h = 240, + width = 130, + height = 240, positioning = Positioning.FLEX, flexDirection = FlexDirection.VERTICAL, alignItems = AlignItems.FLEX_END, @@ -1415,23 +1415,23 @@ function TestAlignItems:testComplexDashboardWidgetLayout() local task1 = Gui.new({ id = "task1", - w = 120, - h = 30, + width = 120, + height = 30, positioning = Positioning.FLEX, }) local task2 = Gui.new({ id = "task2", - w = 110, - h = 25, + width = 110, + height = 25, positioning = Positioning.FLEX, }) -- Footer with status info local footer = Gui.new({ id = "footer", - w = 800, - h = 40, + width = 800, + height = 40, positioning = Positioning.FLEX, flexDirection = FlexDirection.HORIZONTAL, alignItems = AlignItems.CENTER, @@ -1440,15 +1440,15 @@ function TestAlignItems:testComplexDashboardWidgetLayout() local status = Gui.new({ id = "status", - w = 200, - h = 20, + width = 200, + height = 20, positioning = Positioning.FLEX, }) local timestamp = Gui.new({ id = "timestamp", - w = 150, - h = 16, + width = 150, + height = 16, positioning = Positioning.FLEX, }) @@ -1537,8 +1537,8 @@ function TestAlignItems:testComplexFormMultiLevelAlignments() id = "form", x = 50, y = 50, - w = 500, - h = 600, + width = 500, + height = 600, positioning = Positioning.FLEX, flexDirection = FlexDirection.VERTICAL, alignItems = AlignItems.STRETCH, @@ -1547,8 +1547,8 @@ function TestAlignItems:testComplexFormMultiLevelAlignments() -- Form header with center alignment local formHeader = Gui.new({ id = "formHeader", - w = 500, - h = 80, + width = 500, + height = 80, positioning = Positioning.FLEX, flexDirection = FlexDirection.VERTICAL, alignItems = AlignItems.CENTER, @@ -1556,23 +1556,23 @@ function TestAlignItems:testComplexFormMultiLevelAlignments() local formTitle = Gui.new({ id = "formTitle", - w = 300, - h = 40, + width = 300, + height = 40, positioning = Positioning.FLEX, }) local formDescription = Gui.new({ id = "formDescription", - w = 400, - h = 30, + width = 400, + height = 30, positioning = Positioning.FLEX, }) -- Personal info section with flex-start alignment local personalSection = Gui.new({ id = "personalSection", - w = 500, - h = 200, + width = 500, + height = 200, positioning = Positioning.FLEX, flexDirection = FlexDirection.VERTICAL, alignItems = AlignItems.FLEX_START, @@ -1580,15 +1580,15 @@ function TestAlignItems:testComplexFormMultiLevelAlignments() local sectionTitle1 = Gui.new({ id = "sectionTitle1", - w = 200, - h = 30, + width = 200, + height = 30, positioning = Positioning.FLEX, }) local nameRow = Gui.new({ id = "nameRow", - w = 480, - h = 50, + width = 480, + height = 50, positioning = Positioning.FLEX, flexDirection = FlexDirection.HORIZONTAL, alignItems = AlignItems.CENTER, @@ -1596,8 +1596,8 @@ function TestAlignItems:testComplexFormMultiLevelAlignments() local firstNameField = Gui.new({ id = "firstNameField", - w = 220, - h = 40, + width = 220, + height = 40, positioning = Positioning.FLEX, flexDirection = FlexDirection.VERTICAL, alignItems = AlignItems.FLEX_START, @@ -1605,22 +1605,22 @@ function TestAlignItems:testComplexFormMultiLevelAlignments() local firstNameLabel = Gui.new({ id = "firstNameLabel", - w = 100, - h = 20, + width = 100, + height = 20, positioning = Positioning.FLEX, }) local firstNameInput = Gui.new({ id = "firstNameInput", - w = 200, - h = 35, + width = 200, + height = 35, positioning = Positioning.FLEX, }) local lastNameField = Gui.new({ id = "lastNameField", - w = 220, - h = 40, + width = 220, + height = 40, positioning = Positioning.FLEX, flexDirection = FlexDirection.VERTICAL, alignItems = AlignItems.FLEX_END, @@ -1628,22 +1628,22 @@ function TestAlignItems:testComplexFormMultiLevelAlignments() local lastNameLabel = Gui.new({ id = "lastNameLabel", - w = 120, - h = 20, + width = 120, + height = 20, positioning = Positioning.FLEX, }) local lastNameInput = Gui.new({ id = "lastNameInput", - w = 200, - h = 35, + width = 200, + height = 35, positioning = Positioning.FLEX, }) local emailRow = Gui.new({ id = "emailRow", - w = 480, - h = 60, + width = 480, + height = 60, positioning = Positioning.FLEX, flexDirection = FlexDirection.VERTICAL, alignItems = AlignItems.STRETCH, @@ -1651,23 +1651,23 @@ function TestAlignItems:testComplexFormMultiLevelAlignments() local emailLabel = Gui.new({ id = "emailLabel", - w = 100, - h = 20, + width = 100, + height = 20, positioning = Positioning.FLEX, }) local emailInput = Gui.new({ id = "emailInput", - w = 480, - h = 35, + width = 480, + height = 35, positioning = Positioning.FLEX, }) -- Preferences section with center alignment local preferencesSection = Gui.new({ id = "preferencesSection", - w = 500, - h = 180, + width = 500, + height = 180, positioning = Positioning.FLEX, flexDirection = FlexDirection.VERTICAL, alignItems = AlignItems.CENTER, @@ -1675,15 +1675,15 @@ function TestAlignItems:testComplexFormMultiLevelAlignments() local sectionTitle2 = Gui.new({ id = "sectionTitle2", - w = 250, - h = 30, + width = 250, + height = 30, positioning = Positioning.FLEX, }) local optionsContainer = Gui.new({ id = "optionsContainer", - w = 400, - h = 120, + width = 400, + height = 120, positioning = Positioning.FLEX, flexDirection = FlexDirection.HORIZONTAL, alignItems = AlignItems.FLEX_START, @@ -1691,8 +1691,8 @@ function TestAlignItems:testComplexFormMultiLevelAlignments() local leftOptions = Gui.new({ id = "leftOptions", - w = 180, - h = 120, + width = 180, + height = 120, positioning = Positioning.FLEX, flexDirection = FlexDirection.VERTICAL, alignItems = AlignItems.FLEX_START, @@ -1700,8 +1700,8 @@ function TestAlignItems:testComplexFormMultiLevelAlignments() local option1 = Gui.new({ id = "option1", - w = 150, - h = 25, + width = 150, + height = 25, positioning = Positioning.FLEX, flexDirection = FlexDirection.HORIZONTAL, alignItems = AlignItems.CENTER, @@ -1709,22 +1709,22 @@ function TestAlignItems:testComplexFormMultiLevelAlignments() local checkbox1 = Gui.new({ id = "checkbox1", - w = 20, - h = 20, + width = 20, + height = 20, positioning = Positioning.FLEX, }) local label1 = Gui.new({ id = "label1", - w = 120, - h = 18, + width = 120, + height = 18, positioning = Positioning.FLEX, }) local option2 = Gui.new({ id = "option2", - w = 160, - h = 25, + width = 160, + height = 25, positioning = Positioning.FLEX, flexDirection = FlexDirection.HORIZONTAL, alignItems = AlignItems.CENTER, @@ -1732,22 +1732,22 @@ function TestAlignItems:testComplexFormMultiLevelAlignments() local checkbox2 = Gui.new({ id = "checkbox2", - w = 20, - h = 20, + width = 20, + height = 20, positioning = Positioning.FLEX, }) local label2 = Gui.new({ id = "label2", - w = 130, - h = 18, + width = 130, + height = 18, positioning = Positioning.FLEX, }) local rightOptions = Gui.new({ id = "rightOptions", - w = 180, - h = 120, + width = 180, + height = 120, positioning = Positioning.FLEX, flexDirection = FlexDirection.VERTICAL, alignItems = AlignItems.FLEX_END, @@ -1755,23 +1755,23 @@ function TestAlignItems:testComplexFormMultiLevelAlignments() local dropdown = Gui.new({ id = "dropdown", - w = 150, - h = 35, + width = 150, + height = 35, positioning = Positioning.FLEX, }) local slider = Gui.new({ id = "slider", - w = 140, - h = 20, + width = 140, + height = 20, positioning = Positioning.FLEX, }) -- Form actions with space-between alignment local actionsSection = Gui.new({ id = "actionsSection", - w = 500, - h = 60, + width = 500, + height = 60, positioning = Positioning.FLEX, flexDirection = FlexDirection.HORIZONTAL, alignItems = AlignItems.CENTER, @@ -1780,15 +1780,15 @@ function TestAlignItems:testComplexFormMultiLevelAlignments() local cancelBtn = Gui.new({ id = "cancelBtn", - w = 80, - h = 40, + width = 80, + height = 40, positioning = Positioning.FLEX, }) local submitGroup = Gui.new({ id = "submitGroup", - w = 200, - h = 50, + width = 200, + height = 50, positioning = Positioning.FLEX, flexDirection = FlexDirection.HORIZONTAL, alignItems = AlignItems.CENTER, @@ -1796,15 +1796,15 @@ function TestAlignItems:testComplexFormMultiLevelAlignments() local saveBtn = Gui.new({ id = "saveBtn", - w = 80, - h = 40, + width = 80, + height = 40, positioning = Positioning.FLEX, }) local submitBtn = Gui.new({ id = "submitBtn", - w = 100, - h = 45, + width = 100, + height = 45, positioning = Positioning.FLEX, }) @@ -1889,8 +1889,8 @@ function TestAlignItems:testComplexModalDialogNestedAlignments() id = "backdrop", x = 0, y = 0, - w = 1024, - h = 768, + width = 1024, + height = 768, positioning = Positioning.FLEX, flexDirection = FlexDirection.HORIZONTAL, alignItems = AlignItems.CENTER, @@ -1900,8 +1900,8 @@ function TestAlignItems:testComplexModalDialogNestedAlignments() -- Modal dialog local modal = Gui.new({ id = "modal", - w = 600, - h = 500, + width = 600, + height = 500, positioning = Positioning.FLEX, flexDirection = FlexDirection.VERTICAL, alignItems = AlignItems.STRETCH, @@ -1910,8 +1910,8 @@ function TestAlignItems:testComplexModalDialogNestedAlignments() -- Modal header with space-between alignment local modalHeader = Gui.new({ id = "modalHeader", - w = 600, - h = 60, + width = 600, + height = 60, positioning = Positioning.FLEX, flexDirection = FlexDirection.HORIZONTAL, alignItems = AlignItems.CENTER, @@ -1920,8 +1920,8 @@ function TestAlignItems:testComplexModalDialogNestedAlignments() local headerLeft = Gui.new({ id = "headerLeft", - w = 300, - h = 60, + width = 300, + height = 60, positioning = Positioning.FLEX, flexDirection = FlexDirection.HORIZONTAL, alignItems = AlignItems.CENTER, @@ -1929,22 +1929,22 @@ function TestAlignItems:testComplexModalDialogNestedAlignments() local modalIcon = Gui.new({ id = "modalIcon", - w = 32, - h = 32, + width = 32, + height = 32, positioning = Positioning.FLEX, }) local modalTitle = Gui.new({ id = "modalTitle", - w = 250, - h = 30, + width = 250, + height = 30, positioning = Positioning.FLEX, }) local headerRight = Gui.new({ id = "headerRight", - w = 100, - h = 60, + width = 100, + height = 60, positioning = Positioning.FLEX, flexDirection = FlexDirection.HORIZONTAL, alignItems = AlignItems.CENTER, @@ -1953,23 +1953,23 @@ function TestAlignItems:testComplexModalDialogNestedAlignments() local helpBtn = Gui.new({ id = "helpBtn", - w = 30, - h = 30, + width = 30, + height = 30, positioning = Positioning.FLEX, }) local closeBtn = Gui.new({ id = "closeBtn", - w = 32, - h = 32, + width = 32, + height = 32, positioning = Positioning.FLEX, }) -- Modal content with mixed alignments local modalContent = Gui.new({ id = "modalContent", - w = 600, - h = 380, + width = 600, + height = 380, positioning = Positioning.FLEX, flexDirection = FlexDirection.HORIZONTAL, alignItems = AlignItems.STRETCH, @@ -1978,8 +1978,8 @@ function TestAlignItems:testComplexModalDialogNestedAlignments() -- Left sidebar with navigation local sidebar = Gui.new({ id = "sidebar", - w = 150, - h = 380, + width = 150, + height = 380, positioning = Positioning.FLEX, flexDirection = FlexDirection.VERTICAL, alignItems = AlignItems.STRETCH, @@ -1987,8 +1987,8 @@ function TestAlignItems:testComplexModalDialogNestedAlignments() local navItem1 = Gui.new({ id = "navItem1", - w = 150, - h = 40, + width = 150, + height = 40, positioning = Positioning.FLEX, flexDirection = FlexDirection.HORIZONTAL, alignItems = AlignItems.CENTER, @@ -1996,22 +1996,22 @@ function TestAlignItems:testComplexModalDialogNestedAlignments() local navIcon1 = Gui.new({ id = "navIcon1", - w = 20, - h = 20, + width = 20, + height = 20, positioning = Positioning.FLEX, }) local navLabel1 = Gui.new({ id = "navLabel1", - w = 100, - h = 18, + width = 100, + height = 18, positioning = Positioning.FLEX, }) local navItem2 = Gui.new({ id = "navItem2", - w = 150, - h = 40, + width = 150, + height = 40, positioning = Positioning.FLEX, flexDirection = FlexDirection.HORIZONTAL, alignItems = AlignItems.CENTER, @@ -2019,23 +2019,23 @@ function TestAlignItems:testComplexModalDialogNestedAlignments() local navIcon2 = Gui.new({ id = "navIcon2", - w = 20, - h = 20, + width = 20, + height = 20, positioning = Positioning.FLEX, }) local navLabel2 = Gui.new({ id = "navLabel2", - w = 110, - h = 18, + width = 110, + height = 18, positioning = Positioning.FLEX, }) -- Main content area local contentArea = Gui.new({ id = "contentArea", - w = 450, - h = 380, + width = 450, + height = 380, positioning = Positioning.FLEX, flexDirection = FlexDirection.VERTICAL, alignItems = AlignItems.FLEX_START, @@ -2044,8 +2044,8 @@ function TestAlignItems:testComplexModalDialogNestedAlignments() -- Content header with flex-end alignment local contentHeader = Gui.new({ id = "contentHeader", - w = 450, - h = 50, + width = 450, + height = 50, positioning = Positioning.FLEX, flexDirection = FlexDirection.HORIZONTAL, alignItems = AlignItems.FLEX_END, @@ -2053,15 +2053,15 @@ function TestAlignItems:testComplexModalDialogNestedAlignments() local contentTitle = Gui.new({ id = "contentTitle", - w = 200, - h = 35, + width = 200, + height = 35, positioning = Positioning.FLEX, }) local contentActions = Gui.new({ id = "contentActions", - w = 180, - h = 40, + width = 180, + height = 40, positioning = Positioning.FLEX, flexDirection = FlexDirection.HORIZONTAL, alignItems = AlignItems.CENTER, @@ -2069,30 +2069,30 @@ function TestAlignItems:testComplexModalDialogNestedAlignments() local editBtn = Gui.new({ id = "editBtn", - w = 50, - h = 30, + width = 50, + height = 30, positioning = Positioning.FLEX, }) local deleteBtn = Gui.new({ id = "deleteBtn", - w = 55, - h = 30, + width = 55, + height = 30, positioning = Positioning.FLEX, }) local moreBtn = Gui.new({ id = "moreBtn", - w = 30, - h = 30, + width = 30, + height = 30, positioning = Positioning.FLEX, }) -- Content body with center alignment local contentBody = Gui.new({ id = "contentBody", - w = 450, - h = 280, + width = 450, + height = 280, positioning = Positioning.FLEX, flexDirection = FlexDirection.VERTICAL, alignItems = AlignItems.CENTER, @@ -2100,23 +2100,23 @@ function TestAlignItems:testComplexModalDialogNestedAlignments() local contentText = Gui.new({ id = "contentText", - w = 400, - h = 150, + width = 400, + height = 150, positioning = Positioning.FLEX, }) local contentImage = Gui.new({ id = "contentImage", - w = 200, - h = 100, + width = 200, + height = 100, positioning = Positioning.FLEX, }) -- Content meta with flex-end alignment local contentMeta = Gui.new({ id = "contentMeta", - w = 350, - h = 30, + width = 350, + height = 30, positioning = Positioning.FLEX, flexDirection = FlexDirection.HORIZONTAL, alignItems = AlignItems.CENTER, @@ -2125,23 +2125,23 @@ function TestAlignItems:testComplexModalDialogNestedAlignments() local lastModified = Gui.new({ id = "lastModified", - w = 120, - h = 16, + width = 120, + height = 16, positioning = Positioning.FLEX, }) local author = Gui.new({ id = "author", - w = 100, - h = 18, + width = 100, + height = 18, positioning = Positioning.FLEX, }) -- Modal footer with center alignment local modalFooter = Gui.new({ id = "modalFooter", - w = 600, - h = 60, + width = 600, + height = 60, positioning = Positioning.FLEX, flexDirection = FlexDirection.HORIZONTAL, alignItems = AlignItems.CENTER, @@ -2150,8 +2150,8 @@ function TestAlignItems:testComplexModalDialogNestedAlignments() local footerActions = Gui.new({ id = "footerActions", - w = 300, - h = 50, + width = 300, + height = 50, positioning = Positioning.FLEX, flexDirection = FlexDirection.HORIZONTAL, alignItems = AlignItems.CENTER, @@ -2160,22 +2160,22 @@ function TestAlignItems:testComplexModalDialogNestedAlignments() local cancelModalBtn = Gui.new({ id = "cancelModalBtn", - w = 80, - h = 40, + width = 80, + height = 40, positioning = Positioning.FLEX, }) local applyBtn = Gui.new({ id = "applyBtn", - w = 70, - h = 40, + width = 70, + height = 40, positioning = Positioning.FLEX, }) local okBtn = Gui.new({ id = "okBtn", - w = 60, - h = 45, + width = 60, + height = 45, positioning = Positioning.FLEX, }) @@ -2257,4 +2257,3 @@ function TestAlignItems:testComplexModalDialogNestedAlignments() end luaunit.LuaUnit.run() - diff --git a/testing/__tests__/07_flex_wrap_tests.lua b/testing/__tests__/07_flex_wrap_tests.lua index b8765e8..4bd3e00 100644 --- a/testing/__tests__/07_flex_wrap_tests.lua +++ b/testing/__tests__/07_flex_wrap_tests.lua @@ -52,8 +52,8 @@ function TestFlexWrap01_NoWrapHorizontal() local container = createContainer({ x = 0, y = 0, - w = 200, - h = 100, + width = 200, + height = 100, positioning = Positioning.FLEX, flexDirection = FlexDirection.HORIZONTAL, flexWrap = FlexWrap.NOWRAP, @@ -63,9 +63,9 @@ function TestFlexWrap01_NoWrapHorizontal() }) -- Create children that would overflow if wrapped - local child1 = createChild(container, { w = 80, h = 30 }) - local child2 = createChild(container, { w = 80, h = 30 }) - local child3 = createChild(container, { w = 80, h = 30 }) + local child1 = createChild(container, { width = 80, height = 30 }) + local child2 = createChild(container, { width = 80, height = 30 }) + local child3 = createChild(container, { width = 80, height = 30 }) local positions = layoutAndGetPositions(container) @@ -85,8 +85,8 @@ function TestFlexWrap02_WrapHorizontal() local container = createContainer({ x = 0, y = 0, - w = 200, - h = 200, + width = 200, + height = 200, positioning = Positioning.FLEX, flexDirection = FlexDirection.HORIZONTAL, flexWrap = FlexWrap.WRAP, @@ -97,9 +97,9 @@ function TestFlexWrap02_WrapHorizontal() }) -- Create children that will wrap - local child1 = createChild(container, { w = 80, h = 30 }) - local child2 = createChild(container, { w = 80, h = 30 }) - local child3 = createChild(container, { w = 80, h = 30 }) -- This should wrap + local child1 = createChild(container, { width = 80, height = 30 }) + local child2 = createChild(container, { width = 80, height = 30 }) + local child3 = createChild(container, { width = 80, height = 30 }) -- This should wrap local positions = layoutAndGetPositions(container) @@ -120,8 +120,8 @@ function TestFlexWrap03_WrapReverseHorizontal() local container = createContainer({ x = 0, y = 0, - w = 200, - h = 200, + width = 200, + height = 200, positioning = Positioning.FLEX, flexDirection = FlexDirection.HORIZONTAL, flexWrap = FlexWrap.WRAP_REVERSE, @@ -132,9 +132,9 @@ function TestFlexWrap03_WrapReverseHorizontal() }) -- Create children that will wrap - local child1 = createChild(container, { w = 80, h = 30 }) - local child2 = createChild(container, { w = 80, h = 30 }) - local child3 = createChild(container, { w = 80, h = 30 }) -- This would wrap but lines are reversed + local child1 = createChild(container, { width = 80, height = 30 }) + local child2 = createChild(container, { width = 80, height = 30 }) + local child3 = createChild(container, { width = 80, height = 30 }) -- This would wrap but lines are reversed local positions = layoutAndGetPositions(container) @@ -154,8 +154,8 @@ function TestFlexWrap04_WrapVertical() local container = createContainer({ x = 0, y = 0, - w = 200, - h = 100, + width = 200, + height = 100, positioning = Positioning.FLEX, flexDirection = FlexDirection.VERTICAL, flexWrap = FlexWrap.WRAP, @@ -166,9 +166,9 @@ function TestFlexWrap04_WrapVertical() }) -- Create children that will wrap vertically - local child1 = createChild(container, { w = 30, h = 40 }) - local child2 = createChild(container, { w = 30, h = 40 }) - local child3 = createChild(container, { w = 30, h = 40 }) -- This should wrap to new column + local child1 = createChild(container, { width = 30, height = 40 }) + local child2 = createChild(container, { width = 30, height = 40 }) + local child3 = createChild(container, { width = 30, height = 40 }) -- This should wrap to new column local positions = layoutAndGetPositions(container) @@ -189,8 +189,8 @@ function TestFlexWrap05_WrapWithCenterJustify() local container = createContainer({ x = 0, y = 0, - w = 200, - h = 100, + width = 200, + height = 100, positioning = Positioning.FLEX, flexDirection = FlexDirection.HORIZONTAL, flexWrap = FlexWrap.WRAP, @@ -201,9 +201,9 @@ function TestFlexWrap05_WrapWithCenterJustify() }) -- Create children that will wrap - local child1 = createChild(container, { w = 80, h = 30 }) - local child2 = createChild(container, { w = 80, h = 30 }) - local child3 = createChild(container, { w = 60, h = 30 }) -- Different width, should wrap + local child1 = createChild(container, { width = 80, height = 30 }) + local child2 = createChild(container, { width = 80, height = 30 }) + local child3 = createChild(container, { width = 60, height = 30 }) -- Different width, should wrap local positions = layoutAndGetPositions(container) @@ -228,8 +228,8 @@ function TestFlexWrap06_WrapWithSpaceBetweenAlignContent() local container = createContainer({ x = 0, y = 0, - w = 200, - h = 120, + width = 200, + height = 120, positioning = Positioning.FLEX, flexDirection = FlexDirection.HORIZONTAL, flexWrap = FlexWrap.WRAP, @@ -240,9 +240,9 @@ function TestFlexWrap06_WrapWithSpaceBetweenAlignContent() }) -- Create children that will wrap into two lines - local child1 = createChild(container, { w = 80, h = 30 }) - local child2 = createChild(container, { w = 80, h = 30 }) - local child3 = createChild(container, { w = 80, h = 30 }) -- This should wrap + local child1 = createChild(container, { width = 80, height = 30 }) + local child2 = createChild(container, { width = 80, height = 30 }) + local child3 = createChild(container, { width = 80, height = 30 }) -- This should wrap local positions = layoutAndGetPositions(container) @@ -262,8 +262,8 @@ function TestFlexWrap07_WrapWithStretchAlignItems() local container = createContainer({ x = 0, y = 0, - w = 200, - h = 100, + width = 200, + height = 100, positioning = Positioning.FLEX, flexDirection = FlexDirection.HORIZONTAL, flexWrap = FlexWrap.WRAP, @@ -274,9 +274,9 @@ function TestFlexWrap07_WrapWithStretchAlignItems() }) -- Create children with different heights - local child1 = createChild(container, { w = 80, h = 20 }) - local child2 = createChild(container, { w = 80, h = 35 }) -- Tallest in first line - local child3 = createChild(container, { w = 80, h = 25 }) -- Wraps to second line + local child1 = createChild(container, { width = 80, height = 20 }) + local child2 = createChild(container, { width = 80, height = 35 }) -- Tallest in first line + local child3 = createChild(container, { width = 80, height = 25 }) -- Wraps to second line local positions = layoutAndGetPositions(container) @@ -298,8 +298,8 @@ function TestFlexWrap08_WrapWithCoordinateInheritance() local container = createContainer({ x = 50, y = 30, - w = 200, - h = 100, + width = 200, + height = 100, positioning = Positioning.FLEX, flexDirection = FlexDirection.HORIZONTAL, flexWrap = FlexWrap.WRAP, @@ -310,9 +310,9 @@ function TestFlexWrap08_WrapWithCoordinateInheritance() }) -- Create children that will wrap - local child1 = createChild(container, { w = 80, h = 30 }) - local child2 = createChild(container, { w = 80, h = 30 }) - local child3 = createChild(container, { w = 80, h = 30 }) -- This should wrap + local child1 = createChild(container, { width = 80, height = 30 }) + local child2 = createChild(container, { width = 80, height = 30 }) + local child3 = createChild(container, { width = 80, height = 30 }) -- This should wrap local positions = layoutAndGetPositions(container) @@ -332,8 +332,8 @@ function TestFlexWrap09_WrapWithPadding() local container = createContainer({ x = 0, y = 0, - w = 200, - h = 100, + width = 200, + height = 100, padding = { top = 15, right = 15, bottom = 15, left = 15 }, positioning = Positioning.FLEX, flexDirection = FlexDirection.HORIZONTAL, @@ -345,9 +345,9 @@ function TestFlexWrap09_WrapWithPadding() }) -- Create children that will wrap (considering reduced available space) - local child1 = createChild(container, { w = 70, h = 25 }) - local child2 = createChild(container, { w = 70, h = 25 }) - local child3 = createChild(container, { w = 70, h = 25 }) -- Should wrap due to padding + local child1 = createChild(container, { width = 70, height = 25 }) + local child2 = createChild(container, { width = 70, height = 25 }) + local child3 = createChild(container, { width = 70, height = 25 }) -- Should wrap due to padding local positions = layoutAndGetPositions(container) @@ -369,8 +369,8 @@ function TestFlexWrap10_WrapWithSpaceAroundAlignContent() local container = createContainer({ x = 0, y = 0, - w = 200, - h = 100, + width = 200, + height = 100, positioning = Positioning.FLEX, flexDirection = FlexDirection.HORIZONTAL, flexWrap = FlexWrap.WRAP, @@ -381,9 +381,9 @@ function TestFlexWrap10_WrapWithSpaceAroundAlignContent() }) -- Create children that will wrap into two lines - local child1 = createChild(container, { w = 80, h = 30 }) - local child2 = createChild(container, { w = 80, h = 30 }) - local child3 = createChild(container, { w = 80, h = 30 }) -- This should wrap + local child1 = createChild(container, { width = 80, height = 30 }) + local child2 = createChild(container, { width = 80, height = 30 }) + local child3 = createChild(container, { width = 80, height = 30 }) -- This should wrap local positions = layoutAndGetPositions(container) @@ -402,8 +402,8 @@ function TestFlexWrap11_SingleChildWrap() local container = createContainer({ x = 0, y = 0, - w = 100, - h = 100, + width = 100, + height = 100, positioning = Positioning.FLEX, flexDirection = FlexDirection.HORIZONTAL, flexWrap = FlexWrap.WRAP, @@ -412,7 +412,7 @@ function TestFlexWrap11_SingleChildWrap() gap = 10, }) - local child1 = createChild(container, { w = 50, h = 30 }) + local child1 = createChild(container, { width = 50, height = 30 }) local positions = layoutAndGetPositions(container) @@ -426,8 +426,8 @@ function TestFlexWrap12_MultipleWrappingLines() local container = createContainer({ x = 0, y = 0, - w = 200, - h = 200, + width = 200, + height = 200, positioning = Positioning.FLEX, flexDirection = FlexDirection.HORIZONTAL, flexWrap = FlexWrap.WRAP, @@ -438,11 +438,11 @@ function TestFlexWrap12_MultipleWrappingLines() }) -- Create children that will wrap into three lines - local child1 = createChild(container, { w = 80, h = 30 }) - local child2 = createChild(container, { w = 80, h = 30 }) - local child3 = createChild(container, { w = 80, h = 30 }) - local child4 = createChild(container, { w = 80, h = 30 }) - local child5 = createChild(container, { w = 80, h = 30 }) + local child1 = createChild(container, { width = 80, height = 30 }) + local child2 = createChild(container, { width = 80, height = 30 }) + local child3 = createChild(container, { width = 80, height = 30 }) + local child4 = createChild(container, { width = 80, height = 30 }) + local child5 = createChild(container, { width = 80, height = 30 }) local positions = layoutAndGetPositions(container) @@ -463,8 +463,8 @@ function TestFlexWrap13_WrapReverseMultipleLines() local container = createContainer({ x = 0, y = 0, - w = 200, - h = 150, + width = 200, + height = 150, positioning = Positioning.FLEX, flexDirection = FlexDirection.HORIZONTAL, flexWrap = FlexWrap.WRAP_REVERSE, @@ -475,11 +475,11 @@ function TestFlexWrap13_WrapReverseMultipleLines() }) -- Create children that will wrap into three lines - local child1 = createChild(container, { w = 80, h = 30 }) - local child2 = createChild(container, { w = 80, h = 30 }) - local child3 = createChild(container, { w = 80, h = 30 }) - local child4 = createChild(container, { w = 80, h = 30 }) - local child5 = createChild(container, { w = 80, h = 30 }) + local child1 = createChild(container, { width = 80, height = 30 }) + local child2 = createChild(container, { width = 80, height = 30 }) + local child3 = createChild(container, { width = 80, height = 30 }) + local child4 = createChild(container, { width = 80, height = 30 }) + local child5 = createChild(container, { width = 80, height = 30 }) local positions = layoutAndGetPositions(container) @@ -498,8 +498,8 @@ function TestFlexWrap14_ContainerTooSmall() local container = createContainer({ x = 0, y = 0, - w = 50, - h = 50, + width = 50, + height = 50, positioning = Positioning.FLEX, flexDirection = FlexDirection.HORIZONTAL, flexWrap = FlexWrap.WRAP, @@ -509,8 +509,8 @@ function TestFlexWrap14_ContainerTooSmall() }) -- Create children larger than container - local child1 = createChild(container, { w = 80, h = 30 }) - local child2 = createChild(container, { w = 80, h = 30 }) + local child1 = createChild(container, { width = 80, height = 30 }) + local child2 = createChild(container, { width = 80, height = 30 }) local positions = layoutAndGetPositions(container) @@ -527,8 +527,8 @@ function TestFlexWrap15_WrapWithMixedPositioning() local container = createContainer({ x = 0, y = 0, - w = 200, - h = 100, + width = 200, + height = 100, positioning = Positioning.FLEX, flexDirection = FlexDirection.HORIZONTAL, flexWrap = FlexWrap.WRAP, @@ -539,10 +539,11 @@ function TestFlexWrap15_WrapWithMixedPositioning() }) -- Create flex children and one absolute child - local child1 = createChild(container, { w = 80, h = 30 }) -- flex child - local child2 = createChild(container, { w = 80, h = 30, positioning = Positioning.ABSOLUTE, x = 150, y = 50 }) -- absolute child - local child3 = createChild(container, { w = 80, h = 30 }) -- flex child - local child4 = createChild(container, { w = 80, h = 30 }) -- flex child - should wrap + local child1 = createChild(container, { width = 80, height = 30 }) -- flex child + local child2 = + createChild(container, { width = 80, height = 30, positioning = Positioning.ABSOLUTE, x = 150, y = 50 }) -- absolute child + local child3 = createChild(container, { width = 80, height = 30 }) -- flex child + local child4 = createChild(container, { width = 80, height = 30 }) -- flex child - should wrap local positions = layoutAndGetPositions(container) @@ -564,8 +565,8 @@ function TestFlexWrap16_ComplexCardGridLayout() local gridContainer = createContainer({ x = 0, y = 0, - w = 600, - h = 400, + width = 600, + height = 400, positioning = Positioning.FLEX, flexDirection = FlexDirection.HORIZONTAL, flexWrap = FlexWrap.WRAP, @@ -579,8 +580,8 @@ function TestFlexWrap16_ComplexCardGridLayout() -- Create multiple cards that will wrap for i = 1, 6 do local card = createChild(gridContainer, { - w = 160, - h = 120, + width = 160, + height = 120, positioning = Positioning.FLEX, flexDirection = FlexDirection.VERTICAL, justifyContent = JustifyContent.SPACE_BETWEEN, @@ -591,7 +592,7 @@ function TestFlexWrap16_ComplexCardGridLayout() -- Card header local header = createChild(card, { - h = 24, + height = 24, positioning = Positioning.FLEX, flexDirection = FlexDirection.HORIZONTAL, justifyContent = JustifyContent.SPACE_BETWEEN, @@ -600,12 +601,12 @@ function TestFlexWrap16_ComplexCardGridLayout() }) -- Header title and icon - createChild(header, { w = 80, h = 16 }) -- title - createChild(header, { w = 16, h = 16 }) -- icon + createChild(header, { width = 80, height = 16 }) -- title + createChild(header, { width = 16, height = 16 }) -- icon -- Card content area local content = createChild(card, { - h = 60, + height = 60, positioning = Positioning.FLEX, flexDirection = FlexDirection.VERTICAL, justifyContent = JustifyContent.CENTER, @@ -614,12 +615,12 @@ function TestFlexWrap16_ComplexCardGridLayout() }) -- Content elements - createChild(content, { w = 40, h = 20 }) -- main content - createChild(content, { w = 60, h = 12 }) -- description + createChild(content, { width = 40, height = 20 }) -- main content + createChild(content, { width = 60, height = 12 }) -- description -- Card footer with action buttons local footer = createChild(card, { - h = 20, + height = 20, positioning = Positioning.FLEX, flexDirection = FlexDirection.HORIZONTAL, justifyContent = JustifyContent.FLEX_END, @@ -627,8 +628,8 @@ function TestFlexWrap16_ComplexCardGridLayout() gap = 6, }) - createChild(footer, { w = 24, h = 16 }) -- button 1 - createChild(footer, { w = 24, h = 16 }) -- button 2 + createChild(footer, { width = 24, height = 16 }) -- button 1 + createChild(footer, { width = 24, height = 16 }) -- button 2 end local positions = layoutAndGetPositions(gridContainer) @@ -671,8 +672,8 @@ function TestFlexWrap17_ComplexImageGalleryLayout() local gallery = createContainer({ x = 0, y = 0, - w = 800, - h = 600, + width = 800, + height = 600, positioning = Positioning.FLEX, flexDirection = FlexDirection.HORIZONTAL, flexWrap = FlexWrap.WRAP, @@ -686,8 +687,8 @@ function TestFlexWrap17_ComplexImageGalleryLayout() -- Create gallery items with different layouts for i = 1, 8 do local item = createChild(gallery, { - w = 180, - h = 200, + width = 180, + height = 200, positioning = Positioning.FLEX, flexDirection = FlexDirection.VERTICAL, justifyContent = JustifyContent.SPACE_BETWEEN, @@ -697,11 +698,11 @@ function TestFlexWrap17_ComplexImageGalleryLayout() }) -- Image area - createChild(item, { h = 140 }) -- image placeholder + createChild(item, { height = 140 }) -- image placeholder -- Caption area local caption = createChild(item, { - h = 40, + height = 40, positioning = Positioning.FLEX, flexDirection = FlexDirection.VERTICAL, justifyContent = JustifyContent.SPACE_BETWEEN, @@ -709,12 +710,12 @@ function TestFlexWrap17_ComplexImageGalleryLayout() gap = 4, }) - createChild(caption, { w = 120, h = 16 }) -- title - createChild(caption, { w = 80, h = 12 }) -- metadata + createChild(caption, { width = 120, height = 16 }) -- title + createChild(caption, { width = 80, height = 12 }) -- metadata -- Action bar local actions = createChild(item, { - h = 18, + height = 18, positioning = Positioning.FLEX, flexDirection = FlexDirection.HORIZONTAL, justifyContent = JustifyContent.SPACE_BETWEEN, @@ -724,8 +725,8 @@ function TestFlexWrap17_ComplexImageGalleryLayout() -- Left actions local leftActions = createChild(actions, { - w = 60, - h = 18, + width = 60, + height = 18, positioning = Positioning.FLEX, flexDirection = FlexDirection.HORIZONTAL, justifyContent = JustifyContent.FLEX_START, @@ -733,11 +734,11 @@ function TestFlexWrap17_ComplexImageGalleryLayout() gap = 4, }) - createChild(leftActions, { w = 16, h = 16 }) -- like button - createChild(leftActions, { w = 16, h = 16 }) -- share button + createChild(leftActions, { width = 16, height = 16 }) -- like button + createChild(leftActions, { width = 16, height = 16 }) -- share button -- Right actions - createChild(actions, { w = 16, h = 16 }) -- options menu + createChild(actions, { width = 16, height = 16 }) -- options menu end local positions = layoutAndGetPositions(gallery) @@ -777,8 +778,8 @@ function TestFlexWrap18_ComplexDashboardLayout() local dashboard = createContainer({ x = 0, y = 0, - w = 1000, - h = 700, + width = 1000, + height = 700, positioning = Positioning.FLEX, flexDirection = FlexDirection.VERTICAL, justifyContent = JustifyContent.FLEX_START, @@ -789,7 +790,7 @@ function TestFlexWrap18_ComplexDashboardLayout() -- Top metrics row (horizontal wrapping) local metricsRow = createChild(dashboard, { - h = 120, + height = 120, positioning = Positioning.FLEX, flexDirection = FlexDirection.HORIZONTAL, flexWrap = FlexWrap.WRAP, @@ -802,8 +803,8 @@ function TestFlexWrap18_ComplexDashboardLayout() -- Create metric cards for i = 1, 5 do local metric = createChild(metricsRow, { - w = 180, - h = 100, + width = 180, + height = 100, positioning = Positioning.FLEX, flexDirection = FlexDirection.VERTICAL, justifyContent = JustifyContent.SPACE_BETWEEN, @@ -814,7 +815,7 @@ function TestFlexWrap18_ComplexDashboardLayout() -- Metric header local header = createChild(metric, { - h = 20, + height = 20, positioning = Positioning.FLEX, flexDirection = FlexDirection.HORIZONTAL, justifyContent = JustifyContent.SPACE_BETWEEN, @@ -822,15 +823,15 @@ function TestFlexWrap18_ComplexDashboardLayout() gap = 8, }) - createChild(header, { w = 100, h = 14 }) -- title - createChild(header, { w = 16, h = 16 }) -- icon + createChild(header, { width = 100, height = 14 }) -- title + createChild(header, { width = 16, height = 16 }) -- icon -- Metric value - createChild(metric, { w = 80, h = 24 }) -- value + createChild(metric, { width = 80, height = 24 }) -- value -- Metric trend local trend = createChild(metric, { - h = 16, + height = 16, positioning = Positioning.FLEX, flexDirection = FlexDirection.HORIZONTAL, justifyContent = JustifyContent.FLEX_START, @@ -838,13 +839,13 @@ function TestFlexWrap18_ComplexDashboardLayout() gap = 4, }) - createChild(trend, { w = 12, h = 12 }) -- trend icon - createChild(trend, { w = 40, h = 12 }) -- trend text + createChild(trend, { width = 12, height = 12 }) -- trend icon + createChild(trend, { width = 40, height = 12 }) -- trend text end -- Content area with wrapping widgets local contentArea = createChild(dashboard, { - h = 500, + height = 500, positioning = Positioning.FLEX, flexDirection = FlexDirection.HORIZONTAL, flexWrap = FlexWrap.WRAP, @@ -856,8 +857,8 @@ function TestFlexWrap18_ComplexDashboardLayout() -- Large chart widget local chartWidget = createChild(contentArea, { - w = 600, - h = 300, + width = 600, + height = 300, positioning = Positioning.FLEX, flexDirection = FlexDirection.VERTICAL, justifyContent = JustifyContent.SPACE_BETWEEN, @@ -868,7 +869,7 @@ function TestFlexWrap18_ComplexDashboardLayout() -- Chart header local chartHeader = createChild(chartWidget, { - h = 32, + height = 32, positioning = Positioning.FLEX, flexDirection = FlexDirection.HORIZONTAL, justifyContent = JustifyContent.SPACE_BETWEEN, @@ -876,15 +877,15 @@ function TestFlexWrap18_ComplexDashboardLayout() gap = 12, }) - createChild(chartHeader, { w = 150, h = 20 }) -- chart title - createChild(chartHeader, { w = 80, h = 24 }) -- chart controls + createChild(chartHeader, { width = 150, height = 20 }) -- chart title + createChild(chartHeader, { width = 80, height = 24 }) -- chart controls -- Chart area - createChild(chartWidget, { h = 200 }) -- chart content + createChild(chartWidget, { height = 200 }) -- chart content -- Chart legend local legend = createChild(chartWidget, { - h = 24, + height = 24, positioning = Positioning.FLEX, flexDirection = FlexDirection.HORIZONTAL, flexWrap = FlexWrap.WRAP, @@ -896,8 +897,8 @@ function TestFlexWrap18_ComplexDashboardLayout() for i = 1, 4 do local legendItem = createChild(legend, { - w = 80, - h = 16, + width = 80, + height = 16, positioning = Positioning.FLEX, flexDirection = FlexDirection.HORIZONTAL, justifyContent = JustifyContent.FLEX_START, @@ -905,14 +906,14 @@ function TestFlexWrap18_ComplexDashboardLayout() gap = 6, }) - createChild(legendItem, { w = 12, h = 12 }) -- color indicator - createChild(legendItem, { w = 50, h = 12 }) -- legend text + createChild(legendItem, { width = 12, height = 12 }) -- color indicator + createChild(legendItem, { width = 50, height = 12 }) -- legend text end -- Side panel with stacked widgets local sidePanel = createChild(contentArea, { - w = 320, - h = 500, + width = 320, + height = 500, positioning = Positioning.FLEX, flexDirection = FlexDirection.VERTICAL, justifyContent = JustifyContent.FLEX_START, @@ -922,7 +923,7 @@ function TestFlexWrap18_ComplexDashboardLayout() -- Recent activity widget local activityWidget = createChild(sidePanel, { - h = 200, + height = 200, positioning = Positioning.FLEX, flexDirection = FlexDirection.VERTICAL, justifyContent = JustifyContent.FLEX_START, @@ -931,11 +932,11 @@ function TestFlexWrap18_ComplexDashboardLayout() padding = { top = 16, right = 16, bottom = 16, left = 16 }, }) - createChild(activityWidget, { h = 20 }) -- activity header + createChild(activityWidget, { height = 20 }) -- activity header -- Activity list local activityList = createChild(activityWidget, { - h = 150, + height = 150, positioning = Positioning.FLEX, flexDirection = FlexDirection.VERTICAL, justifyContent = JustifyContent.FLEX_START, @@ -945,7 +946,7 @@ function TestFlexWrap18_ComplexDashboardLayout() for i = 1, 5 do local activityItem = createChild(activityList, { - h = 24, + height = 24, positioning = Positioning.FLEX, flexDirection = FlexDirection.HORIZONTAL, justifyContent = JustifyContent.SPACE_BETWEEN, @@ -953,13 +954,13 @@ function TestFlexWrap18_ComplexDashboardLayout() gap = 8, }) - createChild(activityItem, { w = 200, h = 16 }) -- activity text - createChild(activityItem, { w = 60, h = 12 }) -- timestamp + createChild(activityItem, { width = 200, height = 16 }) -- activity text + createChild(activityItem, { width = 60, height = 12 }) -- timestamp end -- Quick actions widget local actionsWidget = createChild(sidePanel, { - h = 150, + height = 150, positioning = Positioning.FLEX, flexDirection = FlexDirection.VERTICAL, justifyContent = JustifyContent.SPACE_BETWEEN, @@ -968,11 +969,11 @@ function TestFlexWrap18_ComplexDashboardLayout() padding = { top = 16, right = 16, bottom = 16, left = 16 }, }) - createChild(actionsWidget, { h = 20 }) -- actions header + createChild(actionsWidget, { height = 20 }) -- actions header -- Action buttons grid local actionsGrid = createChild(actionsWidget, { - h = 100, + height = 100, positioning = Positioning.FLEX, flexDirection = FlexDirection.HORIZONTAL, flexWrap = FlexWrap.WRAP, @@ -983,7 +984,7 @@ function TestFlexWrap18_ComplexDashboardLayout() }) for i = 1, 6 do - createChild(actionsGrid, { w = 80, h = 40 }) -- action button + createChild(actionsGrid, { width = 80, height = 40 }) -- action button end local positions = layoutAndGetPositions(dashboard) @@ -1021,7 +1022,7 @@ function TestFlexWrap18_ComplexDashboardLayout() -- Legend should fit all 4 items in one row (80*4 + 16*3 = 368 < 560 available) luaunit.assertTrue(legend.children[1].y == legend.children[2].y) -- all items same row - luaunit.assertTrue(legend.children[3].y == legend.children[4].y) -- all items same row + luaunit.assertTrue(legend.children[3].y == legend.children[4].y) -- all items same row luaunit.assertTrue(legend.children[1].y == legend.children[3].y) -- all items same row -- Verify side panel actions grid wrapping @@ -1045,8 +1046,8 @@ function TestFlexWrap19_ComplexFormLayout() local form = createContainer({ x = 0, y = 0, - w = 800, - h = 600, + width = 800, + height = 600, positioning = Positioning.FLEX, flexDirection = FlexDirection.VERTICAL, justifyContent = JustifyContent.FLEX_START, @@ -1057,7 +1058,7 @@ function TestFlexWrap19_ComplexFormLayout() -- Form header local header = createChild(form, { - h = 60, + height = 60, positioning = Positioning.FLEX, flexDirection = FlexDirection.VERTICAL, justifyContent = JustifyContent.CENTER, @@ -1065,12 +1066,12 @@ function TestFlexWrap19_ComplexFormLayout() gap = 8, }) - createChild(header, { w = 200, h = 28 }) -- form title - createChild(header, { w = 300, h = 16 }) -- form description + createChild(header, { width = 200, height = 28 }) -- form title + createChild(header, { width = 300, height = 16 }) -- form description -- Personal info section with wrapping fields local personalSection = createChild(form, { - h = 150, + height = 150, positioning = Positioning.FLEX, flexDirection = FlexDirection.VERTICAL, justifyContent = JustifyContent.FLEX_START, @@ -1078,10 +1079,10 @@ function TestFlexWrap19_ComplexFormLayout() gap = 16, }) - createChild(personalSection, { w = 150, h = 20 }) -- section title + createChild(personalSection, { width = 150, height = 20 }) -- section title local personalFields = createChild(personalSection, { - h = 110, + height = 110, positioning = Positioning.FLEX, flexDirection = FlexDirection.HORIZONTAL, flexWrap = FlexWrap.WRAP, @@ -1094,8 +1095,8 @@ function TestFlexWrap19_ComplexFormLayout() -- Create field groups that will wrap for i = 1, 6 do local fieldGroup = createChild(personalFields, { - w = 220, - h = 70, + width = 220, + height = 70, positioning = Positioning.FLEX, flexDirection = FlexDirection.VERTICAL, justifyContent = JustifyContent.SPACE_BETWEEN, @@ -1103,14 +1104,14 @@ function TestFlexWrap19_ComplexFormLayout() gap = 8, }) - createChild(fieldGroup, { h = 16 }) -- field label - createChild(fieldGroup, { h = 36 }) -- input field - createChild(fieldGroup, { h = 12 }) -- help text + createChild(fieldGroup, { height = 16 }) -- field label + createChild(fieldGroup, { height = 36 }) -- input field + createChild(fieldGroup, { height = 12 }) -- help text end -- Address section with complex nested wrapping local addressSection = createChild(form, { - h = 200, + height = 200, positioning = Positioning.FLEX, flexDirection = FlexDirection.VERTICAL, justifyContent = JustifyContent.FLEX_START, @@ -1118,10 +1119,10 @@ function TestFlexWrap19_ComplexFormLayout() gap = 16, }) - createChild(addressSection, { w = 120, h = 20 }) -- section title + createChild(addressSection, { width = 120, height = 20 }) -- section title local addressContainer = createChild(addressSection, { - h = 160, + height = 160, positioning = Positioning.FLEX, flexDirection = FlexDirection.VERTICAL, justifyContent = JustifyContent.FLEX_START, @@ -1131,7 +1132,7 @@ function TestFlexWrap19_ComplexFormLayout() -- Primary address row local primaryAddress = createChild(addressContainer, { - h = 70, + height = 70, positioning = Positioning.FLEX, flexDirection = FlexDirection.HORIZONTAL, flexWrap = FlexWrap.WRAP, @@ -1143,8 +1144,8 @@ function TestFlexWrap19_ComplexFormLayout() -- Street address (full width) local streetField = createChild(primaryAddress, { - w = 704, - h = 70, -- full width minus gaps + width = 704, + height = 70, -- full width minus gaps positioning = Positioning.FLEX, flexDirection = FlexDirection.VERTICAL, justifyContent = JustifyContent.SPACE_BETWEEN, @@ -1152,13 +1153,13 @@ function TestFlexWrap19_ComplexFormLayout() gap = 8, }) - createChild(streetField, { h = 16 }) -- street label - createChild(streetField, { h = 36 }) -- street input - createChild(streetField, { h = 12 }) -- street help + createChild(streetField, { height = 16 }) -- street label + createChild(streetField, { height = 36 }) -- street input + createChild(streetField, { height = 12 }) -- street help -- Secondary address row with multiple fields local secondaryAddress = createChild(addressContainer, { - h = 70, + height = 70, positioning = Positioning.FLEX, flexDirection = FlexDirection.HORIZONTAL, flexWrap = FlexWrap.WRAP, @@ -1170,8 +1171,8 @@ function TestFlexWrap19_ComplexFormLayout() -- City field local cityField = createChild(secondaryAddress, { - w = 280, - h = 70, + width = 280, + height = 70, positioning = Positioning.FLEX, flexDirection = FlexDirection.VERTICAL, justifyContent = JustifyContent.SPACE_BETWEEN, @@ -1179,14 +1180,14 @@ function TestFlexWrap19_ComplexFormLayout() gap = 8, }) - createChild(cityField, { h = 16 }) -- city label - createChild(cityField, { h = 36 }) -- city input - createChild(cityField, { h = 12 }) -- city help + createChild(cityField, { height = 16 }) -- city label + createChild(cityField, { height = 36 }) -- city input + createChild(cityField, { height = 12 }) -- city help -- State field local stateField = createChild(secondaryAddress, { - w = 200, - h = 70, + width = 200, + height = 70, positioning = Positioning.FLEX, flexDirection = FlexDirection.VERTICAL, justifyContent = JustifyContent.SPACE_BETWEEN, @@ -1194,14 +1195,14 @@ function TestFlexWrap19_ComplexFormLayout() gap = 8, }) - createChild(stateField, { h = 16 }) -- state label - createChild(stateField, { h = 36 }) -- state input - createChild(stateField, { h = 12 }) -- state help + createChild(stateField, { height = 16 }) -- state label + createChild(stateField, { height = 36 }) -- state input + createChild(stateField, { height = 12 }) -- state help -- ZIP field local zipField = createChild(secondaryAddress, { - w = 180, - h = 70, + width = 180, + height = 70, positioning = Positioning.FLEX, flexDirection = FlexDirection.VERTICAL, justifyContent = JustifyContent.SPACE_BETWEEN, @@ -1209,13 +1210,13 @@ function TestFlexWrap19_ComplexFormLayout() gap = 8, }) - createChild(zipField, { h = 16 }) -- zip label - createChild(zipField, { h = 36 }) -- zip input - createChild(zipField, { h = 12 }) -- zip help + createChild(zipField, { height = 16 }) -- zip label + createChild(zipField, { height = 36 }) -- zip input + createChild(zipField, { height = 12 }) -- zip help -- Preferences section with wrapping checkboxes local preferencesSection = createChild(form, { - h = 120, + height = 120, positioning = Positioning.FLEX, flexDirection = FlexDirection.VERTICAL, justifyContent = JustifyContent.FLEX_START, @@ -1223,10 +1224,10 @@ function TestFlexWrap19_ComplexFormLayout() gap = 16, }) - createChild(preferencesSection, { w = 140, h = 20 }) -- section title + createChild(preferencesSection, { width = 140, height = 20 }) -- section title local preferencesGrid = createChild(preferencesSection, { - h = 80, + height = 80, positioning = Positioning.FLEX, flexDirection = FlexDirection.HORIZONTAL, flexWrap = FlexWrap.WRAP, @@ -1239,8 +1240,8 @@ function TestFlexWrap19_ComplexFormLayout() -- Create preference checkboxes that wrap for i = 1, 8 do local preference = createChild(preferencesGrid, { - w = 160, - h = 24, + width = 160, + height = 24, positioning = Positioning.FLEX, flexDirection = FlexDirection.HORIZONTAL, justifyContent = JustifyContent.FLEX_START, @@ -1248,13 +1249,13 @@ function TestFlexWrap19_ComplexFormLayout() gap = 8, }) - createChild(preference, { w = 16, h = 16 }) -- checkbox - createChild(preference, { w = 120, h = 16 }) -- checkbox label + createChild(preference, { width = 16, height = 16 }) -- checkbox + createChild(preference, { width = 120, height = 16 }) -- checkbox label end -- Form actions local actions = createChild(form, { - h = 48, + height = 48, positioning = Positioning.FLEX, flexDirection = FlexDirection.HORIZONTAL, justifyContent = JustifyContent.FLEX_END, @@ -1262,8 +1263,8 @@ function TestFlexWrap19_ComplexFormLayout() gap = 16, }) - createChild(actions, { w = 80, h = 36 }) -- cancel button - createChild(actions, { w = 100, h = 36 }) -- submit button + createChild(actions, { width = 80, height = 36 }) -- cancel button + createChild(actions, { width = 100, height = 36 }) -- submit button local positions = layoutAndGetPositions(form) @@ -1331,8 +1332,8 @@ function TestFlexWrap20_ComplexProductCatalog() local catalog = createContainer({ x = 0, y = 0, - w = 1200, - h = 800, + width = 1200, + height = 800, positioning = Positioning.FLEX, flexDirection = FlexDirection.VERTICAL, justifyContent = JustifyContent.FLEX_START, @@ -1342,7 +1343,7 @@ function TestFlexWrap20_ComplexProductCatalog() -- Catalog header with filters local header = createChild(catalog, { - h = 80, + height = 80, positioning = Positioning.FLEX, flexDirection = FlexDirection.HORIZONTAL, justifyContent = JustifyContent.SPACE_BETWEEN, @@ -1353,8 +1354,8 @@ function TestFlexWrap20_ComplexProductCatalog() -- Left header: title and breadcrumbs local leftHeader = createChild(header, { - w = 400, - h = 40, + width = 400, + height = 40, positioning = Positioning.FLEX, flexDirection = FlexDirection.VERTICAL, justifyContent = JustifyContent.SPACE_BETWEEN, @@ -1362,10 +1363,10 @@ function TestFlexWrap20_ComplexProductCatalog() gap = 8, }) - createChild(leftHeader, { w = 200, h = 24 }) -- page title + createChild(leftHeader, { width = 200, height = 24 }) -- page title local breadcrumbs = createChild(leftHeader, { - h = 16, + height = 16, positioning = Positioning.FLEX, flexDirection = FlexDirection.HORIZONTAL, flexWrap = FlexWrap.WRAP, @@ -1376,16 +1377,16 @@ function TestFlexWrap20_ComplexProductCatalog() }) for i = 1, 5 do - createChild(breadcrumbs, { w = 60, h = 14 }) -- breadcrumb item + createChild(breadcrumbs, { width = 60, height = 14 }) -- breadcrumb item if i < 5 then - createChild(breadcrumbs, { w = 8, h = 8 }) -- separator + createChild(breadcrumbs, { width = 8, height = 8 }) -- separator end end -- Right header: filters and controls local rightHeader = createChild(header, { - w = 700, - h = 40, + width = 700, + height = 40, positioning = Positioning.FLEX, flexDirection = FlexDirection.HORIZONTAL, flexWrap = FlexWrap.WRAP, @@ -1398,8 +1399,8 @@ function TestFlexWrap20_ComplexProductCatalog() -- Filter chips for i = 1, 6 do local filterChip = createChild(rightHeader, { - w = 80, - h = 28, + width = 80, + height = 28, positioning = Positioning.FLEX, flexDirection = FlexDirection.HORIZONTAL, justifyContent = JustifyContent.SPACE_BETWEEN, @@ -1408,17 +1409,17 @@ function TestFlexWrap20_ComplexProductCatalog() padding = { top = 4, right = 8, bottom = 4, left = 8 }, }) - createChild(filterChip, { w = 50, h = 12 }) -- filter text - createChild(filterChip, { w = 12, h = 12 }) -- close button + createChild(filterChip, { width = 50, height = 12 }) -- filter text + createChild(filterChip, { width = 12, height = 12 }) -- close button end -- Sort dropdown - createChild(rightHeader, { w = 120, h = 32 }) -- sort control + createChild(rightHeader, { width = 120, height = 32 }) -- sort control -- View toggle local viewToggle = createChild(rightHeader, { - w = 80, - h = 32, + width = 80, + height = 32, positioning = Positioning.FLEX, flexDirection = FlexDirection.HORIZONTAL, justifyContent = JustifyContent.CENTER, @@ -1426,13 +1427,13 @@ function TestFlexWrap20_ComplexProductCatalog() gap = 4, }) - createChild(viewToggle, { w = 24, h = 24 }) -- grid view button - createChild(viewToggle, { w = 24, h = 24 }) -- list view button + createChild(viewToggle, { width = 24, height = 24 }) -- grid view button + createChild(viewToggle, { width = 24, height = 24 }) -- list view button -- Product grid with sophisticated wrapping local productGrid = createChild(catalog, { - w = 1200, - h = 680, + width = 1200, + height = 680, positioning = Positioning.FLEX, flexDirection = FlexDirection.HORIZONTAL, flexWrap = FlexWrap.WRAP, @@ -1446,8 +1447,8 @@ function TestFlexWrap20_ComplexProductCatalog() -- Create product cards with varying layouts for i = 1, 15 do local product = createChild(productGrid, { - w = 220, - h = 300, + width = 220, + height = 300, positioning = Positioning.FLEX, flexDirection = FlexDirection.VERTICAL, justifyContent = JustifyContent.SPACE_BETWEEN, @@ -1458,18 +1459,18 @@ function TestFlexWrap20_ComplexProductCatalog() -- Product image with overlay local imageContainer = createChild(product, { - h = 160, + height = 160, positioning = Positioning.FLEX, flexDirection = FlexDirection.COLUMN, justifyContent = JustifyContent.SPACE_BETWEEN, alignItems = AlignItems.STRETCH, }) - createChild(imageContainer, { h = 140 }) -- product image + createChild(imageContainer, { height = 140 }) -- product image -- Image overlay with quick actions local overlay = createChild(imageContainer, { - h = 20, + height = 20, positioning = Positioning.FLEX, flexDirection = FlexDirection.HORIZONTAL, justifyContent = JustifyContent.FLEX_END, @@ -1477,12 +1478,12 @@ function TestFlexWrap20_ComplexProductCatalog() gap = 4, }) - createChild(overlay, { w = 16, h = 16 }) -- favorite button - createChild(overlay, { w = 16, h = 16 }) -- quick view button + createChild(overlay, { width = 16, height = 16 }) -- favorite button + createChild(overlay, { width = 16, height = 16 }) -- quick view button -- Product info local info = createChild(product, { - h = 80, + height = 80, positioning = Positioning.FLEX, flexDirection = FlexDirection.VERTICAL, justifyContent = JustifyContent.SPACE_BETWEEN, @@ -1490,12 +1491,12 @@ function TestFlexWrap20_ComplexProductCatalog() gap = 6, }) - createChild(info, { w = 160, h = 16 }) -- product title - createChild(info, { w = 120, h = 12 }) -- product brand + createChild(info, { width = 160, height = 16 }) -- product title + createChild(info, { width = 120, height = 12 }) -- product brand -- Rating and reviews local rating = createChild(info, { - h = 16, + height = 16, positioning = Positioning.FLEX, flexDirection = FlexDirection.HORIZONTAL, justifyContent = JustifyContent.FLEX_START, @@ -1505,8 +1506,8 @@ function TestFlexWrap20_ComplexProductCatalog() -- Star rating local stars = createChild(rating, { - w = 80, - h = 14, + width = 80, + height = 14, positioning = Positioning.FLEX, flexDirection = FlexDirection.HORIZONTAL, justifyContent = JustifyContent.FLEX_START, @@ -1515,14 +1516,14 @@ function TestFlexWrap20_ComplexProductCatalog() }) for j = 1, 5 do - createChild(stars, { w = 12, h = 12 }) -- star icon + createChild(stars, { width = 12, height = 12 }) -- star icon end - createChild(rating, { w = 40, h = 12 }) -- review count + createChild(rating, { width = 40, height = 12 }) -- review count -- Price and variants local pricing = createChild(info, { - h = 20, + height = 20, positioning = Positioning.FLEX, flexDirection = FlexDirection.HORIZONTAL, justifyContent = JustifyContent.SPACE_BETWEEN, @@ -1530,11 +1531,11 @@ function TestFlexWrap20_ComplexProductCatalog() gap = 8, }) - createChild(pricing, { w = 60, h = 18 }) -- price + createChild(pricing, { width = 60, height = 18 }) -- price local variants = createChild(pricing, { - w = 80, - h = 16, + width = 80, + height = 16, positioning = Positioning.FLEX, flexDirection = FlexDirection.HORIZONTAL, flexWrap = FlexWrap.WRAP, @@ -1545,12 +1546,12 @@ function TestFlexWrap20_ComplexProductCatalog() }) for j = 1, 4 do - createChild(variants, { w = 16, h = 16 }) -- color variant + createChild(variants, { width = 16, height = 16 }) -- color variant end -- Product actions local actions = createChild(product, { - h = 32, + height = 32, positioning = Positioning.FLEX, flexDirection = FlexDirection.HORIZONTAL, justifyContent = JustifyContent.SPACE_BETWEEN, @@ -1558,8 +1559,8 @@ function TestFlexWrap20_ComplexProductCatalog() gap = 8, }) - createChild(actions, { w = 100, h = 28 }) -- add to cart button - createChild(actions, { w = 28, h = 28 }) -- wishlist button + createChild(actions, { width = 100, height = 28 }) -- add to cart button + createChild(actions, { width = 28, height = 28 }) -- wishlist button end local positions = layoutAndGetPositions(catalog) diff --git a/testing/__tests__/08_comprehensive_flex_tests.lua b/testing/__tests__/08_comprehensive_flex_tests.lua index fc3dbcd..1727097 100644 --- a/testing/__tests__/08_comprehensive_flex_tests.lua +++ b/testing/__tests__/08_comprehensive_flex_tests.lua @@ -52,8 +52,8 @@ function TestComprehensiveFlex:testComplexRowLayoutWithWrapAndAlignment() local container = createContainer({ x = 0, y = 0, - w = 150, - h = 120, + width = 150, + height = 120, positioning = Positioning.FLEX, flexDirection = FlexDirection.HORIZONTAL, justifyContent = JustifyContent.SPACE_BETWEEN, @@ -65,23 +65,23 @@ function TestComprehensiveFlex:testComplexRowLayoutWithWrapAndAlignment() -- Add children that will wrap to second line local child1 = createChild(container, { - w = 40, - h = 30, + width = 40, + height = 30, }) local child2 = createChild(container, { - w = 40, - h = 30, + width = 40, + height = 30, }) local child3 = createChild(container, { - w = 40, - h = 30, + width = 40, + height = 30, }) local child4 = createChild(container, { - w = 40, - h = 30, + width = 40, + height = 30, }) local positions = layoutAndGetPositions(container) @@ -107,8 +107,8 @@ function TestComprehensiveFlex:testNestedFlexContainersComplexLayout() local outerContainer = createContainer({ x = 0, y = 0, - w = 180, - h = 160, + width = 180, + height = 160, positioning = Positioning.FLEX, flexDirection = FlexDirection.VERTICAL, justifyContent = JustifyContent.SPACE_AROUND, @@ -118,8 +118,8 @@ function TestComprehensiveFlex:testNestedFlexContainersComplexLayout() -- Inner container 1 - horizontal flex local innerContainer1 = createChild(outerContainer, { - w = 140, - h = 50, + width = 140, + height = 50, positioning = Positioning.FLEX, flexDirection = FlexDirection.HORIZONTAL, justifyContent = JustifyContent.CENTER, @@ -129,8 +129,8 @@ function TestComprehensiveFlex:testNestedFlexContainersComplexLayout() -- Inner container 2 - horizontal flex with wrap local innerContainer2 = createChild(outerContainer, { - w = 140, - h = 50, + width = 140, + height = 50, positioning = Positioning.FLEX, flexDirection = FlexDirection.HORIZONTAL, justifyContent = JustifyContent.FLEX_START, @@ -142,24 +142,24 @@ function TestComprehensiveFlex:testNestedFlexContainersComplexLayout() -- Add children to inner container 1 local item1 = createChild(innerContainer1, { - w = 30, - h = 20, + width = 30, + height = 20, }) local item2 = createChild(innerContainer1, { - w = 30, - h = 35, + width = 30, + height = 35, }) -- Add children to inner container 2 local item3 = createChild(innerContainer2, { - w = 40, - h = 25, + width = 40, + height = 25, }) local item4 = createChild(innerContainer2, { - w = 40, - h = 25, + width = 40, + height = 25, }) local outerPositions = layoutAndGetPositions(outerContainer) @@ -198,8 +198,8 @@ function TestComprehensiveFlex:testFlexWithAbsolutePositioning() local container = createContainer({ x = 0, y = 0, - w = 160, - h = 100, + width = 160, + height = 100, positioning = Positioning.FLEX, flexDirection = FlexDirection.HORIZONTAL, justifyContent = JustifyContent.SPACE_EVENLY, @@ -211,13 +211,13 @@ function TestComprehensiveFlex:testFlexWithAbsolutePositioning() -- Regular flex children local flexChild1 = createChild(container, { - w = 30, - h = 20, + width = 30, + height = 20, }) local flexChild2 = createChild(container, { - w = 30, - h = 20, + width = 30, + height = 20, }) -- Absolute positioned child (should not affect flex layout) @@ -225,13 +225,13 @@ function TestComprehensiveFlex:testFlexWithAbsolutePositioning() positioning = Positioning.ABSOLUTE, x = 10, y = 10, - w = 20, - h = 15, + width = 20, + height = 15, }) local flexChild3 = createChild(container, { - w = 30, - h = 20, + width = 30, + height = 20, }) local positions = layoutAndGetPositions(container) @@ -258,8 +258,8 @@ function TestComprehensiveFlex:testComplexWrappingWithMixedAlignments() local container = createContainer({ x = 0, y = 0, - w = 120, - h = 150, + width = 120, + height = 150, positioning = Positioning.FLEX, flexDirection = FlexDirection.HORIZONTAL, justifyContent = JustifyContent.SPACE_AROUND, @@ -272,8 +272,8 @@ function TestComprehensiveFlex:testComplexWrappingWithMixedAlignments() -- Add 5 children that will wrap into multiple lines for i = 1, 5 do createChild(container, { - w = 35, - h = 25, + width = 35, + height = 25, }) end @@ -307,8 +307,8 @@ function TestComprehensiveFlex:testDeeplyNestedFlexContainers() local level1 = createContainer({ x = 0, y = 0, - w = 200, - h = 150, + width = 200, + height = 150, positioning = Positioning.FLEX, flexDirection = FlexDirection.VERTICAL, justifyContent = JustifyContent.CENTER, @@ -317,8 +317,8 @@ function TestComprehensiveFlex:testDeeplyNestedFlexContainers() }) local level2 = createChild(level1, { - w = 160, - h = 100, + width = 160, + height = 100, positioning = Positioning.FLEX, flexDirection = FlexDirection.HORIZONTAL, justifyContent = JustifyContent.SPACE_BETWEEN, @@ -327,8 +327,8 @@ function TestComprehensiveFlex:testDeeplyNestedFlexContainers() }) local level3a = createChild(level2, { - w = 70, - h = 80, + width = 70, + height = 80, positioning = Positioning.FLEX, flexDirection = FlexDirection.VERTICAL, justifyContent = JustifyContent.FLEX_END, @@ -337,8 +337,8 @@ function TestComprehensiveFlex:testDeeplyNestedFlexContainers() }) local level3b = createChild(level2, { - w = 70, - h = 80, + width = 70, + height = 80, positioning = Positioning.FLEX, flexDirection = FlexDirection.VERTICAL, justifyContent = JustifyContent.FLEX_START, @@ -348,18 +348,18 @@ function TestComprehensiveFlex:testDeeplyNestedFlexContainers() -- Add leaf elements local leafA1 = createChild(level3a, { - w = 30, - h = 20, + width = 30, + height = 20, }) local leafA2 = createChild(level3a, { - w = 25, - h = 15, + width = 25, + height = 15, }) local leafB1 = createChild(level3b, { - w = 35, - h = 18, + width = 35, + height = 18, }) local level1Positions = layoutAndGetPositions(level1) @@ -420,8 +420,8 @@ function TestComprehensiveFlex:testComplexApplicationLayout() local app = createContainer({ x = 0, y = 0, - w = 1200, - h = 800, + width = 1200, + height = 800, positioning = Positioning.FLEX, flexDirection = FlexDirection.VERTICAL, justifyContent = JustifyContent.FLEX_START, @@ -431,7 +431,7 @@ function TestComprehensiveFlex:testComplexApplicationLayout() -- Top navigation bar local navbar = createChild(app, { - h = 60, + height = 60, positioning = Positioning.FLEX, flexDirection = FlexDirection.HORIZONTAL, justifyContent = JustifyContent.SPACE_BETWEEN, @@ -442,8 +442,8 @@ function TestComprehensiveFlex:testComplexApplicationLayout() -- Left section of navbar local navLeft = createChild(navbar, { - w = 300, - h = 40, + width = 300, + height = 40, positioning = Positioning.FLEX, flexDirection = FlexDirection.HORIZONTAL, justifyContent = JustifyContent.FLEX_START, @@ -451,14 +451,14 @@ function TestComprehensiveFlex:testComplexApplicationLayout() gap = 16, }) - createChild(navLeft, { w = 120, h = 28 }) -- logo - createChild(navLeft, { w = 80, h = 24 }) -- home link - createChild(navLeft, { w = 80, h = 24 }) -- products link + createChild(navLeft, { width = 120, height = 28 }) -- logo + createChild(navLeft, { width = 80, height = 24 }) -- home link + createChild(navLeft, { width = 80, height = 24 }) -- products link -- Center section of navbar with search local navCenter = createChild(navbar, { - w = 400, - h = 40, + width = 400, + height = 40, positioning = Positioning.FLEX, flexDirection = FlexDirection.HORIZONTAL, justifyContent = JustifyContent.CENTER, @@ -466,13 +466,13 @@ function TestComprehensiveFlex:testComplexApplicationLayout() gap = 8, }) - createChild(navCenter, { w = 300, h = 32 }) -- search input - createChild(navCenter, { w = 32, h = 32 }) -- search button + createChild(navCenter, { width = 300, height = 32 }) -- search input + createChild(navCenter, { width = 32, height = 32 }) -- search button -- Right section of navbar local navRight = createChild(navbar, { - w = 200, - h = 40, + width = 200, + height = 40, positioning = Positioning.FLEX, flexDirection = FlexDirection.HORIZONTAL, justifyContent = JustifyContent.FLEX_END, @@ -480,13 +480,13 @@ function TestComprehensiveFlex:testComplexApplicationLayout() gap = 12, }) - createChild(navRight, { w = 32, h = 32 }) -- notifications - createChild(navRight, { w = 32, h = 32 }) -- cart - createChild(navRight, { w = 80, h = 32 }) -- user menu + createChild(navRight, { width = 32, height = 32 }) -- notifications + createChild(navRight, { width = 32, height = 32 }) -- cart + createChild(navRight, { width = 80, height = 32 }) -- user menu -- Main content area local mainContent = createChild(app, { - h = 740, -- 800 - 60 navbar + height = 740, -- 800 - 60 navbar positioning = Positioning.FLEX, flexDirection = FlexDirection.HORIZONTAL, justifyContent = JustifyContent.FLEX_START, @@ -496,8 +496,8 @@ function TestComprehensiveFlex:testComplexApplicationLayout() -- Left sidebar local sidebar = createChild(mainContent, { - w = 250, - h = 740, + width = 250, + height = 740, positioning = Positioning.FLEX, flexDirection = FlexDirection.VERTICAL, justifyContent = JustifyContent.FLEX_START, @@ -508,7 +508,7 @@ function TestComprehensiveFlex:testComplexApplicationLayout() -- Sidebar navigation local sideNav = createChild(sidebar, { - h = 300, + height = 300, positioning = Positioning.FLEX, flexDirection = FlexDirection.VERTICAL, justifyContent = JustifyContent.FLEX_START, @@ -516,12 +516,12 @@ function TestComprehensiveFlex:testComplexApplicationLayout() gap = 8, }) - createChild(sideNav, { h = 24 }) -- nav title + createChild(sideNav, { height = 24 }) -- nav title -- Navigation items with nested structure for i = 1, 8 do local navItem = createChild(sideNav, { - h = 32, + height = 32, positioning = Positioning.FLEX, flexDirection = FlexDirection.HORIZONTAL, justifyContent = JustifyContent.SPACE_BETWEEN, @@ -531,8 +531,8 @@ function TestComprehensiveFlex:testComplexApplicationLayout() }) local navItemLeft = createChild(navItem, { - w = 150, - h = 24, + width = 150, + height = 24, positioning = Positioning.FLEX, flexDirection = FlexDirection.HORIZONTAL, justifyContent = JustifyContent.FLEX_START, @@ -540,17 +540,17 @@ function TestComprehensiveFlex:testComplexApplicationLayout() gap = 8, }) - createChild(navItemLeft, { w = 16, h = 16 }) -- icon - createChild(navItemLeft, { w = 100, h = 16 }) -- label + createChild(navItemLeft, { width = 16, height = 16 }) -- icon + createChild(navItemLeft, { width = 100, height = 16 }) -- label if i <= 3 then -- some items have badges - createChild(navItem, { w = 20, h = 16 }) -- badge + createChild(navItem, { width = 20, height = 16 }) -- badge end end -- Sidebar widget area local sideWidget = createChild(sidebar, { - h = 200, + height = 200, positioning = Positioning.FLEX, flexDirection = FlexDirection.VERTICAL, justifyContent = JustifyContent.SPACE_BETWEEN, @@ -559,10 +559,10 @@ function TestComprehensiveFlex:testComplexApplicationLayout() padding = { top = 16, right = 16, bottom = 16, left = 16 }, }) - createChild(sideWidget, { h = 20 }) -- widget title + createChild(sideWidget, { height = 20 }) -- widget title local widgetContent = createChild(sideWidget, { - h = 120, + height = 120, positioning = Positioning.FLEX, flexDirection = FlexDirection.VERTICAL, justifyContent = JustifyContent.SPACE_BETWEEN, @@ -572,7 +572,7 @@ function TestComprehensiveFlex:testComplexApplicationLayout() for i = 1, 4 do local widgetItem = createChild(widgetContent, { - h = 24, + height = 24, positioning = Positioning.FLEX, flexDirection = FlexDirection.HORIZONTAL, justifyContent = JustifyContent.SPACE_BETWEEN, @@ -580,16 +580,16 @@ function TestComprehensiveFlex:testComplexApplicationLayout() gap = 8, }) - createChild(widgetItem, { w = 120, h = 16 }) -- widget text - createChild(widgetItem, { w = 40, h = 12 }) -- widget value + createChild(widgetItem, { width = 120, height = 16 }) -- widget text + createChild(widgetItem, { width = 40, height = 12 }) -- widget value end - createChild(sideWidget, { h = 32 }) -- widget action button + createChild(sideWidget, { height = 32 }) -- widget action button -- Main content panel local contentPanel = createChild(mainContent, { - w = 950, - h = 740, -- 1200 - 250 sidebar + width = 950, + height = 740, -- 1200 - 250 sidebar positioning = Positioning.FLEX, flexDirection = FlexDirection.VERTICAL, justifyContent = JustifyContent.FLEX_START, @@ -599,7 +599,7 @@ function TestComprehensiveFlex:testComplexApplicationLayout() -- Content header with breadcrumbs and actions local contentHeader = createChild(contentPanel, { - h = 80, + height = 80, positioning = Positioning.FLEX, flexDirection = FlexDirection.HORIZONTAL, justifyContent = JustifyContent.SPACE_BETWEEN, @@ -610,8 +610,8 @@ function TestComprehensiveFlex:testComplexApplicationLayout() -- Breadcrumbs and title section local headerLeft = createChild(contentHeader, { - w = 500, - h = 40, + width = 500, + height = 40, positioning = Positioning.FLEX, flexDirection = FlexDirection.VERTICAL, justifyContent = JustifyContent.SPACE_BETWEEN, @@ -621,7 +621,7 @@ function TestComprehensiveFlex:testComplexApplicationLayout() -- Breadcrumbs local breadcrumbs = createChild(headerLeft, { - h = 16, + height = 16, positioning = Positioning.FLEX, flexDirection = FlexDirection.HORIZONTAL, flexWrap = FlexWrap.WRAP, @@ -632,18 +632,18 @@ function TestComprehensiveFlex:testComplexApplicationLayout() }) for i = 1, 4 do - createChild(breadcrumbs, { w = 60, h = 14 }) -- breadcrumb + createChild(breadcrumbs, { width = 60, height = 14 }) -- breadcrumb if i < 4 then - createChild(breadcrumbs, { w = 8, h = 8 }) -- separator + createChild(breadcrumbs, { width = 8, height = 8 }) -- separator end end - createChild(headerLeft, { w = 200, h = 24 }) -- page title + createChild(headerLeft, { width = 200, height = 24 }) -- page title -- Action buttons section local headerRight = createChild(contentHeader, { - w = 300, - h = 40, + width = 300, + height = 40, positioning = Positioning.FLEX, flexDirection = FlexDirection.HORIZONTAL, flexWrap = FlexWrap.WRAP, @@ -653,13 +653,13 @@ function TestComprehensiveFlex:testComplexApplicationLayout() gap = 12, }) - createChild(headerRight, { w = 80, h = 32 }) -- filter button - createChild(headerRight, { w = 80, h = 32 }) -- sort button - createChild(headerRight, { w = 100, h = 32 }) -- primary action + createChild(headerRight, { width = 80, height = 32 }) -- filter button + createChild(headerRight, { width = 80, height = 32 }) -- sort button + createChild(headerRight, { width = 100, height = 32 }) -- primary action -- Main content area with complex layouts local contentMain = createChild(contentPanel, { - h = 660, -- 740 - 80 header + height = 660, -- 740 - 80 header positioning = Positioning.FLEX, flexDirection = FlexDirection.HORIZONTAL, justifyContent = JustifyContent.FLEX_START, @@ -670,8 +670,8 @@ function TestComprehensiveFlex:testComplexApplicationLayout() -- Content grid area local contentGrid = createChild(contentMain, { - w = 600, - h = 640, + width = 600, + height = 640, positioning = Positioning.FLEX, flexDirection = FlexDirection.VERTICAL, justifyContent = JustifyContent.FLEX_START, @@ -681,7 +681,7 @@ function TestComprehensiveFlex:testComplexApplicationLayout() -- Grid header with filters local gridHeader = createChild(contentGrid, { - h = 60, + height = 60, positioning = Positioning.FLEX, flexDirection = FlexDirection.HORIZONTAL, flexWrap = FlexWrap.WRAP, @@ -693,8 +693,8 @@ function TestComprehensiveFlex:testComplexApplicationLayout() -- Active filters local activeFilters = createChild(gridHeader, { - w = 350, - h = 32, + width = 350, + height = 32, positioning = Positioning.FLEX, flexDirection = FlexDirection.HORIZONTAL, flexWrap = FlexWrap.WRAP, @@ -706,8 +706,8 @@ function TestComprehensiveFlex:testComplexApplicationLayout() for i = 1, 4 do local filterChip = createChild(activeFilters, { - w = 70, - h = 24, + width = 70, + height = 24, positioning = Positioning.FLEX, flexDirection = FlexDirection.HORIZONTAL, justifyContent = JustifyContent.SPACE_BETWEEN, @@ -716,14 +716,14 @@ function TestComprehensiveFlex:testComplexApplicationLayout() padding = { top = 2, right = 6, bottom = 2, left = 6 }, }) - createChild(filterChip, { w = 40, h = 12 }) -- filter text - createChild(filterChip, { w = 12, h = 12 }) -- close button + createChild(filterChip, { width = 40, height = 12 }) -- filter text + createChild(filterChip, { width = 12, height = 12 }) -- close button end -- Grid controls local gridControls = createChild(gridHeader, { - w = 150, - h = 32, + width = 150, + height = 32, positioning = Positioning.FLEX, flexDirection = FlexDirection.HORIZONTAL, justifyContent = JustifyContent.FLEX_END, @@ -731,12 +731,12 @@ function TestComprehensiveFlex:testComplexApplicationLayout() gap = 8, }) - createChild(gridControls, { w = 60, h = 28 }) -- view toggle - createChild(gridControls, { w = 60, h = 28 }) -- sort dropdown + createChild(gridControls, { width = 60, height = 28 }) -- view toggle + createChild(gridControls, { width = 60, height = 28 }) -- sort dropdown -- Item grid local itemGrid = createChild(contentGrid, { - h = 560, + height = 560, positioning = Positioning.FLEX, flexDirection = FlexDirection.HORIZONTAL, flexWrap = FlexWrap.WRAP, @@ -749,8 +749,8 @@ function TestComprehensiveFlex:testComplexApplicationLayout() -- Create grid items for i = 1, 6 do local gridItem = createChild(itemGrid, { - w = 180, - h = 240, + width = 180, + height = 240, positioning = Positioning.FLEX, flexDirection = FlexDirection.VERTICAL, justifyContent = JustifyContent.SPACE_BETWEEN, @@ -759,10 +759,10 @@ function TestComprehensiveFlex:testComplexApplicationLayout() padding = { top = 16, right = 16, bottom = 16, left = 16 }, }) - createChild(gridItem, { h = 120 }) -- item image + createChild(gridItem, { height = 120 }) -- item image local itemInfo = createChild(gridItem, { - h = 60, + height = 60, positioning = Positioning.FLEX, flexDirection = FlexDirection.VERTICAL, justifyContent = JustifyContent.SPACE_BETWEEN, @@ -770,11 +770,11 @@ function TestComprehensiveFlex:testComplexApplicationLayout() gap = 4, }) - createChild(itemInfo, { w = 140, h = 16 }) -- item title - createChild(itemInfo, { w = 100, h = 12 }) -- item description + createChild(itemInfo, { width = 140, height = 16 }) -- item title + createChild(itemInfo, { width = 100, height = 12 }) -- item description local itemMeta = createChild(itemInfo, { - h = 16, + height = 16, positioning = Positioning.FLEX, flexDirection = FlexDirection.HORIZONTAL, justifyContent = JustifyContent.SPACE_BETWEEN, @@ -782,11 +782,11 @@ function TestComprehensiveFlex:testComplexApplicationLayout() gap = 8, }) - createChild(itemMeta, { w = 60, h = 14 }) -- price - createChild(itemMeta, { w = 40, h = 14 }) -- rating + createChild(itemMeta, { width = 60, height = 14 }) -- price + createChild(itemMeta, { width = 40, height = 14 }) -- rating local itemActions = createChild(gridItem, { - h = 32, + height = 32, positioning = Positioning.FLEX, flexDirection = FlexDirection.HORIZONTAL, justifyContent = JustifyContent.SPACE_BETWEEN, @@ -794,14 +794,14 @@ function TestComprehensiveFlex:testComplexApplicationLayout() gap = 8, }) - createChild(itemActions, { w = 100, h = 28 }) -- primary action - createChild(itemActions, { w = 28, h = 28 }) -- secondary action + createChild(itemActions, { width = 100, height = 28 }) -- primary action + createChild(itemActions, { width = 28, height = 28 }) -- secondary action end -- Right detail panel local detailPanel = createChild(contentMain, { - w = 290, - h = 640, + width = 290, + height = 640, positioning = Positioning.FLEX, flexDirection = FlexDirection.VERTICAL, justifyContent = JustifyContent.FLEX_START, @@ -812,7 +812,7 @@ function TestComprehensiveFlex:testComplexApplicationLayout() -- Detail header local detailHeader = createChild(detailPanel, { - h = 60, + height = 60, positioning = Positioning.FLEX, flexDirection = FlexDirection.VERTICAL, justifyContent = JustifyContent.SPACE_BETWEEN, @@ -820,12 +820,12 @@ function TestComprehensiveFlex:testComplexApplicationLayout() gap = 8, }) - createChild(detailHeader, { h = 24 }) -- detail title - createChild(detailHeader, { h = 16 }) -- detail subtitle + createChild(detailHeader, { height = 24 }) -- detail title + createChild(detailHeader, { height = 16 }) -- detail subtitle -- Detail content with complex nested structure local detailContent = createChild(detailPanel, { - h = 480, + height = 480, positioning = Positioning.FLEX, flexDirection = FlexDirection.VERTICAL, justifyContent = JustifyContent.FLEX_START, @@ -836,7 +836,7 @@ function TestComprehensiveFlex:testComplexApplicationLayout() -- Detail sections for i = 1, 3 do local detailSection = createChild(detailContent, { - h = 140, + height = 140, positioning = Positioning.FLEX, flexDirection = FlexDirection.VERTICAL, justifyContent = JustifyContent.FLEX_START, @@ -845,10 +845,10 @@ function TestComprehensiveFlex:testComplexApplicationLayout() padding = { top = 12, right = 12, bottom = 12, left = 12 }, }) - createChild(detailSection, { h = 18 }) -- section title + createChild(detailSection, { height = 18 }) -- section title local sectionContent = createChild(detailSection, { - h = 90, + height = 90, positioning = Positioning.FLEX, flexDirection = FlexDirection.VERTICAL, justifyContent = JustifyContent.FLEX_START, @@ -858,7 +858,7 @@ function TestComprehensiveFlex:testComplexApplicationLayout() for j = 1, 4 do local contentRow = createChild(sectionContent, { - h = 18, + height = 18, positioning = Positioning.FLEX, flexDirection = FlexDirection.HORIZONTAL, justifyContent = JustifyContent.SPACE_BETWEEN, @@ -866,14 +866,14 @@ function TestComprehensiveFlex:testComplexApplicationLayout() gap = 8, }) - createChild(contentRow, { w = 120, h = 14 }) -- row label - createChild(contentRow, { w = 80, h = 14 }) -- row value + createChild(contentRow, { width = 120, height = 14 }) -- row label + createChild(contentRow, { width = 80, height = 14 }) -- row value end end -- Detail actions local detailActions = createChild(detailPanel, { - h = 80, + height = 80, positioning = Positioning.FLEX, flexDirection = FlexDirection.VERTICAL, justifyContent = JustifyContent.SPACE_BETWEEN, @@ -881,8 +881,8 @@ function TestComprehensiveFlex:testComplexApplicationLayout() gap = 12, }) - createChild(detailActions, { h = 32 }) -- primary action - createChild(detailActions, { h = 28 }) -- secondary action + createChild(detailActions, { height = 32 }) -- primary action + createChild(detailActions, { height = 28 }) -- secondary action -- Layout and test positions local appPositions = layoutAndGetPositions(app) @@ -960,8 +960,8 @@ function TestComprehensiveFlex:testComplexDashboardLayout() local dashboard = createContainer({ x = 0, y = 0, - w = 1400, - h = 900, + width = 1400, + height = 900, positioning = Positioning.FLEX, flexDirection = FlexDirection.VERTICAL, justifyContent = JustifyContent.FLEX_START, @@ -971,7 +971,7 @@ function TestComprehensiveFlex:testComplexDashboardLayout() -- Dashboard header with complex controls local dashHeader = createChild(dashboard, { - h = 80, + height = 80, positioning = Positioning.FLEX, flexDirection = FlexDirection.HORIZONTAL, justifyContent = JustifyContent.SPACE_BETWEEN, @@ -982,8 +982,8 @@ function TestComprehensiveFlex:testComplexDashboardLayout() -- Header left: title and time range local headerLeft = createChild(dashHeader, { - w = 400, - h = 48, + width = 400, + height = 48, positioning = Positioning.FLEX, flexDirection = FlexDirection.HORIZONTAL, justifyContent = JustifyContent.FLEX_START, @@ -991,11 +991,11 @@ function TestComprehensiveFlex:testComplexDashboardLayout() gap = 20, }) - createChild(headerLeft, { w = 200, h = 32 }) -- dashboard title + createChild(headerLeft, { width = 200, height = 32 }) -- dashboard title local timeRange = createChild(headerLeft, { - w = 160, - h = 32, + width = 160, + height = 32, positioning = Positioning.FLEX, flexDirection = FlexDirection.HORIZONTAL, justifyContent = JustifyContent.SPACE_BETWEEN, @@ -1004,13 +1004,13 @@ function TestComprehensiveFlex:testComplexDashboardLayout() padding = { top = 4, right = 8, bottom = 4, left = 8 }, }) - createChild(timeRange, { w = 100, h = 16 }) -- time range text - createChild(timeRange, { w = 16, h = 16 }) -- dropdown arrow + createChild(timeRange, { width = 100, height = 16 }) -- time range text + createChild(timeRange, { width = 16, height = 16 }) -- dropdown arrow -- Header center: key metrics local headerCenter = createChild(dashHeader, { - w = 600, - h = 48, + width = 600, + height = 48, positioning = Positioning.FLEX, flexDirection = FlexDirection.HORIZONTAL, flexWrap = FlexWrap.WRAP, @@ -1023,8 +1023,8 @@ function TestComprehensiveFlex:testComplexDashboardLayout() -- Quick metrics for i = 1, 4 do local metric = createChild(headerCenter, { - w = 120, - h = 40, + width = 120, + height = 40, positioning = Positioning.FLEX, flexDirection = FlexDirection.VERTICAL, justifyContent = JustifyContent.SPACE_BETWEEN, @@ -1032,14 +1032,14 @@ function TestComprehensiveFlex:testComplexDashboardLayout() gap = 4, }) - createChild(metric, { w = 60, h = 16 }) -- metric value - createChild(metric, { w = 80, h = 12 }) -- metric label + createChild(metric, { width = 60, height = 16 }) -- metric value + createChild(metric, { width = 80, height = 12 }) -- metric label end -- Header right: actions and settings local headerRight = createChild(dashHeader, { - w = 280, - h = 48, + width = 280, + height = 48, positioning = Positioning.FLEX, flexDirection = FlexDirection.HORIZONTAL, flexWrap = FlexWrap.WRAP, @@ -1049,14 +1049,14 @@ function TestComprehensiveFlex:testComplexDashboardLayout() gap = 12, }) - createChild(headerRight, { w = 36, h = 36 }) -- refresh button - createChild(headerRight, { w = 36, h = 36 }) -- fullscreen button - createChild(headerRight, { w = 100, h = 36 }) -- export button - createChild(headerRight, { w = 36, h = 36 }) -- settings button + createChild(headerRight, { width = 36, height = 36 }) -- refresh button + createChild(headerRight, { width = 36, height = 36 }) -- fullscreen button + createChild(headerRight, { width = 100, height = 36 }) -- export button + createChild(headerRight, { width = 36, height = 36 }) -- settings button -- Main dashboard content local dashContent = createChild(dashboard, { - h = 820, -- 900 - 80 header + height = 820, -- 900 - 80 header positioning = Positioning.FLEX, flexDirection = FlexDirection.HORIZONTAL, justifyContent = JustifyContent.FLEX_START, @@ -1066,8 +1066,8 @@ function TestComprehensiveFlex:testComplexDashboardLayout() -- Left sidebar with navigation and filters local dashSidebar = createChild(dashContent, { - w = 280, - h = 820, + width = 280, + height = 820, positioning = Positioning.FLEX, flexDirection = FlexDirection.VERTICAL, justifyContent = JustifyContent.FLEX_START, @@ -1078,7 +1078,7 @@ function TestComprehensiveFlex:testComplexDashboardLayout() -- Sidebar navigation local sidebarNav = createChild(dashSidebar, { - h = 300, + height = 300, positioning = Positioning.FLEX, flexDirection = FlexDirection.VERTICAL, justifyContent = JustifyContent.FLEX_START, @@ -1086,12 +1086,12 @@ function TestComprehensiveFlex:testComplexDashboardLayout() gap = 12, }) - createChild(sidebarNav, { h = 24 }) -- nav title + createChild(sidebarNav, { height = 24 }) -- nav title -- Navigation groups for i = 1, 3 do local navGroup = createChild(sidebarNav, { - h = 80, + height = 80, positioning = Positioning.FLEX, flexDirection = FlexDirection.VERTICAL, justifyContent = JustifyContent.FLEX_START, @@ -1099,11 +1099,11 @@ function TestComprehensiveFlex:testComplexDashboardLayout() gap = 4, }) - createChild(navGroup, { h = 20 }) -- group title + createChild(navGroup, { height = 20 }) -- group title for j = 1, 3 do local navItem = createChild(navGroup, { - h = 20, + height = 20, positioning = Positioning.FLEX, flexDirection = FlexDirection.HORIZONTAL, justifyContent = JustifyContent.SPACE_BETWEEN, @@ -1112,16 +1112,16 @@ function TestComprehensiveFlex:testComplexDashboardLayout() padding = { top = 2, right = 8, bottom = 2, left = 16 }, }) - createChild(navItem, { w = 160, h = 14 }) -- nav label + createChild(navItem, { width = 160, height = 14 }) -- nav label if j == 1 then - createChild(navItem, { w = 20, h = 12 }) -- active indicator + createChild(navItem, { width = 20, height = 12 }) -- active indicator end end end -- Sidebar filters local sidebarFilters = createChild(dashSidebar, { - h = 250, + height = 250, positioning = Positioning.FLEX, flexDirection = FlexDirection.VERTICAL, justifyContent = JustifyContent.FLEX_START, @@ -1130,12 +1130,12 @@ function TestComprehensiveFlex:testComplexDashboardLayout() padding = { top = 16, right = 16, bottom = 16, left = 0 }, }) - createChild(sidebarFilters, { h = 24 }) -- filters title + createChild(sidebarFilters, { height = 24 }) -- filters title -- Filter groups for i = 1, 3 do local filterGroup = createChild(sidebarFilters, { - h = 60, + height = 60, positioning = Positioning.FLEX, flexDirection = FlexDirection.VERTICAL, justifyContent = JustifyContent.FLEX_START, @@ -1143,10 +1143,10 @@ function TestComprehensiveFlex:testComplexDashboardLayout() gap = 8, }) - createChild(filterGroup, { h = 16 }) -- filter group title + createChild(filterGroup, { height = 16 }) -- filter group title local filterOptions = createChild(filterGroup, { - h = 36, + height = 36, positioning = Positioning.FLEX, flexDirection = FlexDirection.VERTICAL, justifyContent = JustifyContent.FLEX_START, @@ -1156,7 +1156,7 @@ function TestComprehensiveFlex:testComplexDashboardLayout() for j = 1, 2 do local filterOption = createChild(filterOptions, { - h = 16, + height = 16, positioning = Positioning.FLEX, flexDirection = FlexDirection.HORIZONTAL, justifyContent = JustifyContent.FLEX_START, @@ -1164,14 +1164,14 @@ function TestComprehensiveFlex:testComplexDashboardLayout() gap = 8, }) - createChild(filterOption, { w = 16, h = 12 }) -- checkbox - createChild(filterOption, { w = 120, h = 12 }) -- option label + createChild(filterOption, { width = 16, height = 12 }) -- checkbox + createChild(filterOption, { width = 120, height = 12 }) -- option label end end -- Sidebar recent activity local sidebarActivity = createChild(dashSidebar, { - h = 200, + height = 200, positioning = Positioning.FLEX, flexDirection = FlexDirection.VERTICAL, justifyContent = JustifyContent.FLEX_START, @@ -1180,10 +1180,10 @@ function TestComprehensiveFlex:testComplexDashboardLayout() padding = { top = 16, right = 16, bottom = 0, left = 0 }, }) - createChild(sidebarActivity, { h = 20 }) -- activity title + createChild(sidebarActivity, { height = 20 }) -- activity title local activityList = createChild(sidebarActivity, { - h = 160, + height = 160, positioning = Positioning.FLEX, flexDirection = FlexDirection.VERTICAL, justifyContent = JustifyContent.FLEX_START, @@ -1193,7 +1193,7 @@ function TestComprehensiveFlex:testComplexDashboardLayout() for i = 1, 6 do local activityItem = createChild(activityList, { - h = 24, + height = 24, positioning = Positioning.FLEX, flexDirection = FlexDirection.HORIZONTAL, justifyContent = JustifyContent.SPACE_BETWEEN, @@ -1202,8 +1202,8 @@ function TestComprehensiveFlex:testComplexDashboardLayout() }) local activityLeft = createChild(activityItem, { - w = 160, - h = 16, + width = 160, + height = 16, positioning = Positioning.FLEX, flexDirection = FlexDirection.HORIZONTAL, justifyContent = JustifyContent.FLEX_START, @@ -1211,16 +1211,16 @@ function TestComprehensiveFlex:testComplexDashboardLayout() gap = 6, }) - createChild(activityLeft, { w = 12, h = 12 }) -- status dot - createChild(activityLeft, { w = 120, h = 12 }) -- activity text + createChild(activityLeft, { width = 12, height = 12 }) -- status dot + createChild(activityLeft, { width = 120, height = 12 }) -- activity text - createChild(activityItem, { w = 40, h = 10 }) -- timestamp + createChild(activityItem, { width = 40, height = 10 }) -- timestamp end -- Main content panels area local dashMain = createChild(dashContent, { - w = 1120, - h = 820, -- 1400 - 280 sidebar + width = 1120, + height = 820, -- 1400 - 280 sidebar positioning = Positioning.FLEX, flexDirection = FlexDirection.VERTICAL, justifyContent = JustifyContent.FLEX_START, @@ -1231,7 +1231,7 @@ function TestComprehensiveFlex:testComplexDashboardLayout() -- Top metrics row local topMetrics = createChild(dashMain, { - h = 140, + height = 140, positioning = Positioning.FLEX, flexDirection = FlexDirection.HORIZONTAL, flexWrap = FlexWrap.WRAP, @@ -1244,8 +1244,8 @@ function TestComprehensiveFlex:testComplexDashboardLayout() -- Large metric cards for i = 1, 4 do local metricCard = createChild(topMetrics, { - w = 250, - h = 120, + width = 250, + height = 120, positioning = Positioning.FLEX, flexDirection = FlexDirection.VERTICAL, justifyContent = JustifyContent.SPACE_BETWEEN, @@ -1256,7 +1256,7 @@ function TestComprehensiveFlex:testComplexDashboardLayout() -- Card header local cardHeader = createChild(metricCard, { - h = 24, + height = 24, positioning = Positioning.FLEX, flexDirection = FlexDirection.HORIZONTAL, justifyContent = JustifyContent.SPACE_BETWEEN, @@ -1264,12 +1264,12 @@ function TestComprehensiveFlex:testComplexDashboardLayout() gap = 8, }) - createChild(cardHeader, { w = 120, h = 16 }) -- metric title - createChild(cardHeader, { w = 20, h = 16 }) -- trend icon + createChild(cardHeader, { width = 120, height = 16 }) -- metric title + createChild(cardHeader, { width = 20, height = 16 }) -- trend icon -- Metric value and change local cardValue = createChild(metricCard, { - h = 32, + height = 32, positioning = Positioning.FLEX, flexDirection = FlexDirection.HORIZONTAL, justifyContent = JustifyContent.SPACE_BETWEEN, @@ -1277,16 +1277,16 @@ function TestComprehensiveFlex:testComplexDashboardLayout() gap = 8, }) - createChild(cardValue, { w = 100, h = 28 }) -- main value - createChild(cardValue, { w = 60, h = 16 }) -- change percentage + createChild(cardValue, { width = 100, height = 28 }) -- main value + createChild(cardValue, { width = 60, height = 16 }) -- change percentage -- Mini chart area - createChild(metricCard, { h = 24 }) -- mini chart + createChild(metricCard, { height = 24 }) -- mini chart end -- Middle content row with charts local middleContent = createChild(dashMain, { - h = 320, + height = 320, positioning = Positioning.FLEX, flexDirection = FlexDirection.HORIZONTAL, justifyContent = JustifyContent.SPACE_BETWEEN, @@ -1296,8 +1296,8 @@ function TestComprehensiveFlex:testComplexDashboardLayout() -- Large chart panel local chartPanel = createChild(middleContent, { - w = 680, - h = 300, + width = 680, + height = 300, positioning = Positioning.FLEX, flexDirection = FlexDirection.VERTICAL, justifyContent = JustifyContent.SPACE_BETWEEN, @@ -1308,7 +1308,7 @@ function TestComprehensiveFlex:testComplexDashboardLayout() -- Chart header with controls local chartHeader = createChild(chartPanel, { - h = 40, + height = 40, positioning = Positioning.FLEX, flexDirection = FlexDirection.HORIZONTAL, justifyContent = JustifyContent.SPACE_BETWEEN, @@ -1316,11 +1316,11 @@ function TestComprehensiveFlex:testComplexDashboardLayout() gap = 16, }) - createChild(chartHeader, { w = 200, h = 24 }) -- chart title + createChild(chartHeader, { width = 200, height = 24 }) -- chart title local chartControls = createChild(chartHeader, { - w = 200, - h = 32, + width = 200, + height = 32, positioning = Positioning.FLEX, flexDirection = FlexDirection.HORIZONTAL, flexWrap = FlexWrap.WRAP, @@ -1330,16 +1330,16 @@ function TestComprehensiveFlex:testComplexDashboardLayout() gap = 8, }) - createChild(chartControls, { w = 60, h = 24 }) -- time filter - createChild(chartControls, { w = 60, h = 24 }) -- chart type - createChild(chartControls, { w = 24, h = 24 }) -- options menu + createChild(chartControls, { width = 60, height = 24 }) -- time filter + createChild(chartControls, { width = 60, height = 24 }) -- chart type + createChild(chartControls, { width = 24, height = 24 }) -- options menu -- Chart area - createChild(chartPanel, { h = 200 }) -- main chart + createChild(chartPanel, { height = 200 }) -- main chart -- Chart legend local chartLegend = createChild(chartPanel, { - h = 28, + height = 28, positioning = Positioning.FLEX, flexDirection = FlexDirection.HORIZONTAL, flexWrap = FlexWrap.WRAP, @@ -1351,8 +1351,8 @@ function TestComprehensiveFlex:testComplexDashboardLayout() for i = 1, 5 do local legendItem = createChild(chartLegend, { - w = 80, - h = 16, + width = 80, + height = 16, positioning = Positioning.FLEX, flexDirection = FlexDirection.HORIZONTAL, justifyContent = JustifyContent.FLEX_START, @@ -1360,14 +1360,14 @@ function TestComprehensiveFlex:testComplexDashboardLayout() gap = 6, }) - createChild(legendItem, { w = 12, h = 12 }) -- color indicator - createChild(legendItem, { w = 50, h = 12 }) -- legend text + createChild(legendItem, { width = 12, height = 12 }) -- color indicator + createChild(legendItem, { width = 50, height = 12 }) -- legend text end -- Side stats panel local statsPanel = createChild(middleContent, { - w = 360, - h = 300, + width = 360, + height = 300, positioning = Positioning.FLEX, flexDirection = FlexDirection.VERTICAL, justifyContent = JustifyContent.FLEX_START, @@ -1376,11 +1376,11 @@ function TestComprehensiveFlex:testComplexDashboardLayout() padding = { top = 20, right = 20, bottom = 20, left = 20 }, }) - createChild(statsPanel, { h = 24 }) -- stats title + createChild(statsPanel, { height = 24 }) -- stats title -- Stats grid local statsGrid = createChild(statsPanel, { - h = 240, + height = 240, positioning = Positioning.FLEX, flexDirection = FlexDirection.HORIZONTAL, flexWrap = FlexWrap.WRAP, @@ -1393,8 +1393,8 @@ function TestComprehensiveFlex:testComplexDashboardLayout() -- Stats items in 2x4 grid for i = 1, 8 do local statItem = createChild(statsGrid, { - w = 150, - h = 50, + width = 150, + height = 50, positioning = Positioning.FLEX, flexDirection = FlexDirection.VERTICAL, justifyContent = JustifyContent.SPACE_BETWEEN, @@ -1403,13 +1403,13 @@ function TestComprehensiveFlex:testComplexDashboardLayout() padding = { top = 8, right = 8, bottom = 8, left = 8 }, }) - createChild(statItem, { w = 100, h = 16 }) -- stat label - createChild(statItem, { w = 80, h = 20 }) -- stat value + createChild(statItem, { width = 100, height = 16 }) -- stat label + createChild(statItem, { width = 80, height = 20 }) -- stat value end -- Bottom content row with tables and lists local bottomContent = createChild(dashMain, { - h = 260, + height = 260, positioning = Positioning.FLEX, flexDirection = FlexDirection.HORIZONTAL, justifyContent = JustifyContent.SPACE_BETWEEN, @@ -1419,8 +1419,8 @@ function TestComprehensiveFlex:testComplexDashboardLayout() -- Data table panel local tablePanel = createChild(bottomContent, { - w = 540, - h = 240, + width = 540, + height = 240, positioning = Positioning.FLEX, flexDirection = FlexDirection.VERTICAL, justifyContent = JustifyContent.FLEX_START, @@ -1431,7 +1431,7 @@ function TestComprehensiveFlex:testComplexDashboardLayout() -- Table header local tableHeader = createChild(tablePanel, { - h = 32, + height = 32, positioning = Positioning.FLEX, flexDirection = FlexDirection.HORIZONTAL, justifyContent = JustifyContent.SPACE_BETWEEN, @@ -1439,11 +1439,11 @@ function TestComprehensiveFlex:testComplexDashboardLayout() gap = 12, }) - createChild(tableHeader, { w = 150, h = 20 }) -- table title + createChild(tableHeader, { width = 150, height = 20 }) -- table title local tableControls = createChild(tableHeader, { - w = 120, - h = 24, + width = 120, + height = 24, positioning = Positioning.FLEX, flexDirection = FlexDirection.HORIZONTAL, justifyContent = JustifyContent.FLEX_END, @@ -1451,12 +1451,12 @@ function TestComprehensiveFlex:testComplexDashboardLayout() gap = 8, }) - createChild(tableControls, { w = 80, h = 20 }) -- search box - createChild(tableControls, { w = 20, h = 20 }) -- filter button + createChild(tableControls, { width = 80, height = 20 }) -- search box + createChild(tableControls, { width = 20, height = 20 }) -- filter button -- Table content local tableContent = createChild(tablePanel, { - h = 180, + height = 180, positioning = Positioning.FLEX, flexDirection = FlexDirection.VERTICAL, justifyContent = JustifyContent.FLEX_START, @@ -1466,7 +1466,7 @@ function TestComprehensiveFlex:testComplexDashboardLayout() -- Table header row local tableHeaderRow = createChild(tableContent, { - h = 24, + height = 24, positioning = Positioning.FLEX, flexDirection = FlexDirection.HORIZONTAL, justifyContent = JustifyContent.SPACE_BETWEEN, @@ -1475,13 +1475,13 @@ function TestComprehensiveFlex:testComplexDashboardLayout() }) for i = 1, 4 do - createChild(tableHeaderRow, { w = 100, h = 16 }) -- column header + createChild(tableHeaderRow, { width = 100, height = 16 }) -- column header end -- Table data rows for i = 1, 6 do local tableRow = createChild(tableContent, { - h = 24, + height = 24, positioning = Positioning.FLEX, flexDirection = FlexDirection.HORIZONTAL, justifyContent = JustifyContent.SPACE_BETWEEN, @@ -1490,14 +1490,14 @@ function TestComprehensiveFlex:testComplexDashboardLayout() }) for j = 1, 4 do - createChild(tableRow, { w = 100, h = 14 }) -- table cell + createChild(tableRow, { width = 100, height = 14 }) -- table cell end end -- Right panels (split) local rightPanels = createChild(bottomContent, { - w = 500, - h = 240, + width = 500, + height = 240, positioning = Positioning.FLEX, flexDirection = FlexDirection.HORIZONTAL, justifyContent = JustifyContent.SPACE_BETWEEN, @@ -1507,8 +1507,8 @@ function TestComprehensiveFlex:testComplexDashboardLayout() -- Alerts panel local alertsPanel = createChild(rightPanels, { - w = 240, - h = 240, + width = 240, + height = 240, positioning = Positioning.FLEX, flexDirection = FlexDirection.VERTICAL, justifyContent = JustifyContent.FLEX_START, @@ -1517,10 +1517,10 @@ function TestComprehensiveFlex:testComplexDashboardLayout() padding = { top = 16, right = 16, bottom = 16, left = 16 }, }) - createChild(alertsPanel, { h = 20 }) -- alerts title + createChild(alertsPanel, { height = 20 }) -- alerts title local alertsList = createChild(alertsPanel, { - h = 192, + height = 192, positioning = Positioning.FLEX, flexDirection = FlexDirection.VERTICAL, justifyContent = JustifyContent.FLEX_START, @@ -1530,7 +1530,7 @@ function TestComprehensiveFlex:testComplexDashboardLayout() for i = 1, 6 do local alertItem = createChild(alertsList, { - h = 28, + height = 28, positioning = Positioning.FLEX, flexDirection = FlexDirection.HORIZONTAL, justifyContent = JustifyContent.SPACE_BETWEEN, @@ -1540,8 +1540,8 @@ function TestComprehensiveFlex:testComplexDashboardLayout() }) local alertLeft = createChild(alertItem, { - w = 160, - h = 20, + width = 160, + height = 20, positioning = Positioning.FLEX, flexDirection = FlexDirection.HORIZONTAL, justifyContent = JustifyContent.FLEX_START, @@ -1549,16 +1549,16 @@ function TestComprehensiveFlex:testComplexDashboardLayout() gap = 6, }) - createChild(alertLeft, { w = 12, h = 12 }) -- alert icon - createChild(alertLeft, { w = 120, h = 12 }) -- alert text + createChild(alertLeft, { width = 12, height = 12 }) -- alert icon + createChild(alertLeft, { width = 120, height = 12 }) -- alert text - createChild(alertItem, { w = 16, h = 16 }) -- dismiss button + createChild(alertItem, { width = 16, height = 16 }) -- dismiss button end -- Progress panel local progressPanel = createChild(rightPanels, { - w = 240, - h = 240, + width = 240, + height = 240, positioning = Positioning.FLEX, flexDirection = FlexDirection.VERTICAL, justifyContent = JustifyContent.FLEX_START, @@ -1567,10 +1567,10 @@ function TestComprehensiveFlex:testComplexDashboardLayout() padding = { top = 16, right = 16, bottom = 16, left = 16 }, }) - createChild(progressPanel, { h = 20 }) -- progress title + createChild(progressPanel, { height = 20 }) -- progress title local progressList = createChild(progressPanel, { - h = 192, + height = 192, positioning = Positioning.FLEX, flexDirection = FlexDirection.VERTICAL, justifyContent = JustifyContent.FLEX_START, @@ -1580,7 +1580,7 @@ function TestComprehensiveFlex:testComplexDashboardLayout() for i = 1, 4 do local progressItem = createChild(progressList, { - h = 40, + height = 40, positioning = Positioning.FLEX, flexDirection = FlexDirection.VERTICAL, justifyContent = JustifyContent.SPACE_BETWEEN, @@ -1589,7 +1589,7 @@ function TestComprehensiveFlex:testComplexDashboardLayout() }) local progressHeader = createChild(progressItem, { - h = 16, + height = 16, positioning = Positioning.FLEX, flexDirection = FlexDirection.HORIZONTAL, justifyContent = JustifyContent.SPACE_BETWEEN, @@ -1597,10 +1597,10 @@ function TestComprehensiveFlex:testComplexDashboardLayout() gap = 8, }) - createChild(progressHeader, { w = 120, h = 12 }) -- progress label - createChild(progressHeader, { w = 40, h = 12 }) -- progress percentage + createChild(progressHeader, { width = 120, height = 12 }) -- progress label + createChild(progressHeader, { width = 40, height = 12 }) -- progress percentage - createChild(progressItem, { h = 8 }) -- progress bar + createChild(progressItem, { height = 8 }) -- progress bar end -- Layout and test positions diff --git a/testing/__tests__/09_layout_validation_tests.lua b/testing/__tests__/09_layout_validation_tests.lua index c85b9da..6f67b17 100644 --- a/testing/__tests__/09_layout_validation_tests.lua +++ b/testing/__tests__/09_layout_validation_tests.lua @@ -36,8 +36,8 @@ local function createTestContainer(props) local defaults = { x = 0, y = 0, - w = 200, - h = 150, + width = 200, + height = 150, positioning = Positioning.FLEX, flexDirection = FlexDirection.HORIZONTAL, justifyContent = JustifyContent.FLEX_START, @@ -91,8 +91,8 @@ function TestLayoutValidation:testInvalidEnumValuesGracefulDegradation() return Gui.new({ x = 0, y = 0, - w = 100, - h = 100, + width = 100, + height = 100, positioning = Positioning.FLEX, -- flexDirection = "invalid_direction", -- Skip invalid enum to avoid type error }) @@ -105,8 +105,8 @@ function TestLayoutValidation:testInvalidEnumValuesGracefulDegradation() return Gui.new({ x = 0, y = 0, - w = 100, - h = 100, + width = 100, + height = 100, positioning = Positioning.FLEX, -- justifyContent = "invalid_justify", -- Skip invalid enum to avoid type error }) @@ -147,8 +147,8 @@ function TestLayoutValidation:testInvalidPropertyCombinations() return Gui.new({ x = 10, y = 10, - w = 100, - h = 100, + width = 100, + height = 100, positioning = Positioning.ABSOLUTE, flexDirection = FlexDirection.VERTICAL, -- Should be ignored justifyContent = JustifyContent.CENTER, -- Should be ignored @@ -163,8 +163,8 @@ function TestLayoutValidation:testInvalidPropertyCombinations() return Gui.new({ x = 10, -- Should work with flex y = 10, -- Should work with flex - w = 100, - h = 100, + width = 100, + height = 100, positioning = Positioning.FLEX, flexDirection = FlexDirection.VERTICAL, }) @@ -181,8 +181,8 @@ function TestLayoutValidation:testNegativeDimensionsAndPositions() return Gui.new({ x = -10, y = -20, - w = -50, - h = -30, + width = -50, + height = -30, }) end) luaunit.assertTrue(success) -- Should not crash @@ -198,8 +198,8 @@ function TestLayoutValidation:testExtremelyLargeValues() return Gui.new({ x = 999999, y = 999999, - w = 999999, - h = 999999, + width = 999999, + height = 999999, }) end) luaunit.assertTrue(success) -- Should not crash @@ -218,8 +218,8 @@ function TestLayoutValidation:testInvalidChildParentRelationships() local child = Gui.new({ x = 10, y = 10, - w = 50, - h = 30, + width = 50, + height = 30, positioning = Positioning.FLEX, -- Child tries to be flex container }) child.parent = parent @@ -237,15 +237,15 @@ function TestLayoutValidation:testLayoutAfterPropertyChanges() local container = createTestContainer() local child1 = Gui.new({ - w = 50, - h = 30, + width = 50, + height = 30, }) child1.parent = container table.insert(container.children, child1) local child2 = Gui.new({ - w = 60, - h = 35, + width = 60, + height = 35, }) child2.parent = container table.insert(container.children, child2) @@ -288,14 +288,14 @@ function TestLayoutValidation:testComplexNestedValidation() local root = Gui.new({ x = 0, y = 0, - w = 200, - h = 150, + width = 200, + height = 150, positioning = Positioning.FLEX, }) local flex_child = Gui.new({ - w = 100, - h = 75, + width = 100, + height = 75, positioning = Positioning.FLEX, flexDirection = FlexDirection.VERTICAL, }) @@ -305,16 +305,16 @@ function TestLayoutValidation:testComplexNestedValidation() local absolute_grandchild = Gui.new({ x = 10, y = 10, - w = 30, - h = 20, + width = 30, + height = 20, positioning = Positioning.ABSOLUTE, }) absolute_grandchild.parent = flex_child table.insert(flex_child.children, absolute_grandchild) local flex_grandchild = Gui.new({ - w = 40, - h = 25, + width = 40, + height = 25, -- No positioning - should inherit behavior }) flex_grandchild.parent = flex_child @@ -350,8 +350,8 @@ function TestLayoutValidation:testComplexMultiLevelLayoutValidation() local app = Gui.new({ x = 0, y = 0, - w = 1200, - h = 800, + width = 1200, + height = 800, positioning = Positioning.FLEX, flexDirection = FlexDirection.VERTICAL, justifyContent = JustifyContent.FLEX_START, @@ -361,7 +361,7 @@ function TestLayoutValidation:testComplexMultiLevelLayoutValidation() -- Header with complex validation scenarios local header = Gui.new({ - h = 60, + height = 60, positioning = Positioning.FLEX, flexDirection = FlexDirection.HORIZONTAL, justifyContent = JustifyContent.SPACE_BETWEEN, @@ -374,8 +374,8 @@ function TestLayoutValidation:testComplexMultiLevelLayoutValidation() -- Header navigation with potential edge cases local nav = Gui.new({ - w = 400, - h = 40, + width = 400, + height = 40, positioning = Positioning.FLEX, flexDirection = FlexDirection.HORIZONTAL, justifyContent = JustifyContent.FLEX_START, @@ -388,8 +388,8 @@ function TestLayoutValidation:testComplexMultiLevelLayoutValidation() -- Create nav items with extreme values for i = 1, 5 do local navItem = Gui.new({ - w = i == 3 and 0 or 80, -- One item with zero width - h = i == 4 and -10 or 24, -- One item with negative height + width = i == 3 and 0 or 80, -- One item with zero width + height = i == 4 and -10 or 24, -- One item with negative height positioning = i == 5 and Positioning.ABSOLUTE or nil, -- Mixed positioning }) navItem.parent = nav @@ -398,8 +398,8 @@ function TestLayoutValidation:testComplexMultiLevelLayoutValidation() -- Header actions with validation edge cases local actions = Gui.new({ - w = 200, - h = 40, + width = 200, + height = 40, positioning = Positioning.FLEX, flexDirection = FlexDirection.HORIZONTAL, justifyContent = JustifyContent.FLEX_END, @@ -412,8 +412,8 @@ function TestLayoutValidation:testComplexMultiLevelLayoutValidation() -- Actions with extreme dimensions for i = 1, 3 do local action = Gui.new({ - w = i == 1 and 999999 or 32, -- Extremely large width - h = i == 2 and 0.1 or 32, -- Fractional height + width = i == 1 and 999999 or 32, -- Extremely large width + height = i == 2 and 0.1 or 32, -- Fractional height x = i == 3 and -1000 or nil, -- Extreme negative position y = i == 3 and -1000 or nil, }) @@ -423,7 +423,7 @@ function TestLayoutValidation:testComplexMultiLevelLayoutValidation() -- Main content with nested validation challenges local main = Gui.new({ - h = 740, + height = 740, positioning = Positioning.FLEX, flexDirection = FlexDirection.HORIZONTAL, justifyContent = JustifyContent.FLEX_START, @@ -435,8 +435,8 @@ function TestLayoutValidation:testComplexMultiLevelLayoutValidation() -- Sidebar with deep nesting and edge cases local sidebar = Gui.new({ - w = 250, - h = 740, + width = 250, + height = 740, positioning = Positioning.FLEX, flexDirection = FlexDirection.VERTICAL, justifyContent = JustifyContent.FLEX_START, @@ -450,7 +450,7 @@ function TestLayoutValidation:testComplexMultiLevelLayoutValidation() -- Sidebar sections with validation challenges for section = 1, 3 do local sideSection = Gui.new({ - h = section == 2 and -100 or 200, -- Negative height test + height = section == 2 and -100 or 200, -- Negative height test positioning = Positioning.FLEX, flexDirection = FlexDirection.VERTICAL, justifyContent = JustifyContent.FLEX_START, @@ -463,8 +463,8 @@ function TestLayoutValidation:testComplexMultiLevelLayoutValidation() -- Section items with extreme properties for item = 1, 4 do local sectionItem = Gui.new({ - h = 24, - w = item == 2 and 0 or nil, -- Zero width test + height = 24, + width = item == 2 and 0 or nil, -- Zero width test positioning = item == 4 and Positioning.ABSOLUTE or nil, x = item == 4 and 50 or nil, y = item == 4 and 50 or nil, @@ -477,8 +477,8 @@ function TestLayoutValidation:testComplexMultiLevelLayoutValidation() if item <= 2 then for nested = 1, 2 do local nestedItem = Gui.new({ - w = nested == 1 and 999999 or 20, -- Extreme width - h = 12, + width = nested == 1 and 999999 or 20, -- Extreme width + height = 12, positioning = Positioning.FLEX, flexDirection = FlexDirection.HORIZONTAL, justifyContent = JustifyContent.CENTER, @@ -493,8 +493,8 @@ function TestLayoutValidation:testComplexMultiLevelLayoutValidation() -- Content area with complex validation scenarios local content = Gui.new({ - w = 950, - h = 740, + width = 950, + height = 740, positioning = Positioning.FLEX, flexDirection = FlexDirection.VERTICAL, justifyContent = JustifyContent.FLEX_START, @@ -506,7 +506,7 @@ function TestLayoutValidation:testComplexMultiLevelLayoutValidation() -- Content grid with wrapping and validation challenges local contentGrid = Gui.new({ - h = 600, + height = 600, positioning = Positioning.FLEX, flexDirection = FlexDirection.HORIZONTAL, flexWrap = FlexWrap.WRAP, @@ -521,8 +521,8 @@ function TestLayoutValidation:testComplexMultiLevelLayoutValidation() -- Grid items with validation edge cases for i = 1, 12 do local gridItem = Gui.new({ - w = i % 4 == 0 and 0 or 200, -- Some zero width items - h = i % 3 == 0 and -50 or 150, -- Some negative height items + width = i % 4 == 0 and 0 or 200, -- Some zero width items + height = i % 3 == 0 and -50 or 150, -- Some negative height items positioning = Positioning.FLEX, flexDirection = FlexDirection.VERTICAL, justifyContent = JustifyContent.SPACE_BETWEEN, @@ -535,8 +535,8 @@ function TestLayoutValidation:testComplexMultiLevelLayoutValidation() -- Grid item content with extreme values for j = 1, 3 do local itemContent = Gui.new({ - h = j == 1 and 999999 or 40, -- Extreme height - w = j == 2 and -100 or nil, -- Negative width + height = j == 1 and 999999 or 40, -- Extreme height + width = j == 2 and -100 or nil, -- Negative width positioning = j == 3 and Positioning.ABSOLUTE or nil, x = j == 3 and -500 or nil, -- Extreme negative position y = j == 3 and 1000000 or nil, -- Extreme positive position @@ -548,7 +548,7 @@ function TestLayoutValidation:testComplexMultiLevelLayoutValidation() -- Footer with final validation tests local footer = Gui.new({ - h = 140, + height = 140, positioning = Positioning.FLEX, flexDirection = FlexDirection.HORIZONTAL, justifyContent = JustifyContent.SPACE_AROUND, @@ -562,8 +562,8 @@ function TestLayoutValidation:testComplexMultiLevelLayoutValidation() -- Footer sections with final edge cases for i = 1, 4 do local footerSection = Gui.new({ - w = i == 1 and 0 or 200, - h = i == 2 and -1000 or 100, + width = i == 1 and 0 or 200, + height = i == 2 and -1000 or 100, positioning = Positioning.FLEX, flexDirection = FlexDirection.VERTICAL, justifyContent = JustifyContent.CENTER, @@ -618,8 +618,8 @@ function TestLayoutValidation:testComplexDynamicPropertyValidation() local dashboard = Gui.new({ x = 0, y = 0, - w = 1000, - h = 600, + width = 1000, + height = 600, positioning = Positioning.FLEX, flexDirection = FlexDirection.VERTICAL, justifyContent = JustifyContent.FLEX_START, @@ -629,7 +629,7 @@ function TestLayoutValidation:testComplexDynamicPropertyValidation() -- Metrics row that will be modified local metricsRow = Gui.new({ - h = 120, + height = 120, positioning = Positioning.FLEX, flexDirection = FlexDirection.HORIZONTAL, flexWrap = FlexWrap.WRAP, @@ -645,8 +645,8 @@ function TestLayoutValidation:testComplexDynamicPropertyValidation() local metrics = {} for i = 1, 6 do local metric = Gui.new({ - w = 150, - h = 80, + width = 150, + height = 80, positioning = Positioning.FLEX, flexDirection = FlexDirection.VERTICAL, justifyContent = JustifyContent.SPACE_BETWEEN, @@ -660,8 +660,8 @@ function TestLayoutValidation:testComplexDynamicPropertyValidation() -- Metric content for j = 1, 3 do local content = Gui.new({ - w = 100, - h = 20, + width = 100, + height = 20, positioning = Positioning.FLEX, flexDirection = FlexDirection.HORIZONTAL, justifyContent = JustifyContent.CENTER, @@ -674,7 +674,7 @@ function TestLayoutValidation:testComplexDynamicPropertyValidation() -- Content area that will receive dynamic changes local contentArea = Gui.new({ - h = 480, + height = 480, positioning = Positioning.FLEX, flexDirection = FlexDirection.HORIZONTAL, justifyContent = JustifyContent.FLEX_START, @@ -687,8 +687,8 @@ function TestLayoutValidation:testComplexDynamicPropertyValidation() -- Left panel for modifications local leftPanel = Gui.new({ - w = 300, - h = 460, + width = 300, + height = 460, positioning = Positioning.FLEX, flexDirection = FlexDirection.VERTICAL, justifyContent = JustifyContent.FLEX_START, @@ -700,8 +700,8 @@ function TestLayoutValidation:testComplexDynamicPropertyValidation() -- Right panel with nested complexity local rightPanel = Gui.new({ - w = 640, - h = 460, + width = 640, + height = 460, positioning = Positioning.FLEX, flexDirection = FlexDirection.VERTICAL, justifyContent = JustifyContent.FLEX_START, @@ -714,7 +714,7 @@ function TestLayoutValidation:testComplexDynamicPropertyValidation() -- Create nested content for validation testing for i = 1, 3 do local section = Gui.new({ - h = 140, + height = 140, positioning = Positioning.FLEX, flexDirection = FlexDirection.HORIZONTAL, flexWrap = FlexWrap.WRAP, @@ -729,8 +729,8 @@ function TestLayoutValidation:testComplexDynamicPropertyValidation() -- Section items for modification testing for j = 1, 8 do local item = Gui.new({ - w = 80, - h = 60, + width = 80, + height = 60, positioning = Positioning.FLEX, flexDirection = FlexDirection.VERTICAL, justifyContent = JustifyContent.CENTER, @@ -796,8 +796,8 @@ function TestLayoutValidation:testComplexDynamicPropertyValidation() -- Test 9: Add/remove children dynamically local newMetric = Gui.new({ - w = 0, - h = -50, + width = 0, + height = -50, positioning = Positioning.ABSOLUTE, x = -1000, y = -1000, @@ -847,22 +847,22 @@ function TestLayoutValidation:testCircularReferenceValidation() local container1 = Gui.new({ x = 0, y = 0, - w = 200, - h = 200, + width = 200, + height = 200, positioning = Positioning.FLEX, flexDirection = FlexDirection.VERTICAL, }) local container2 = Gui.new({ - w = 180, - h = 180, + width = 180, + height = 180, positioning = Positioning.FLEX, flexDirection = FlexDirection.HORIZONTAL, }) local container3 = Gui.new({ - w = 160, - h = 160, + width = 160, + height = 160, positioning = Positioning.FLEX, flexDirection = FlexDirection.VERTICAL, }) @@ -899,15 +899,15 @@ function TestLayoutValidation:testCircularReferenceValidation() -- Test case 2: Complex nested structure with potential circular refs local container4 = Gui.new({ - w = 140, - h = 140, + width = 140, + height = 140, positioning = Positioning.FLEX, flexDirection = FlexDirection.HORIZONTAL, }) local container5 = Gui.new({ - w = 120, - h = 120, + width = 120, + height = 120, positioning = Positioning.FLEX, flexDirection = FlexDirection.VERTICAL, }) @@ -962,8 +962,8 @@ function TestLayoutValidation:testLargeStructureValidation() local root = Gui.new({ x = 0, y = 0, - w = 2000, - h = 1500, + width = 2000, + height = 1500, positioning = Positioning.FLEX, flexDirection = FlexDirection.VERTICAL, justifyContent = JustifyContent.FLEX_START, @@ -983,8 +983,8 @@ function TestLayoutValidation:testLargeStructureValidation() for i = 1, items do local container = Gui.new({ - w = depth == 1 and 400 or 100, - h = depth == 1 and 200 or 50, + width = depth == 1 and 400 or 100, + height = depth == 1 and 200 or 50, positioning = Positioning.FLEX, flexDirection = i % 2 == 0 and FlexDirection.HORIZONTAL or FlexDirection.VERTICAL, flexWrap = i % 3 == 0 and FlexWrap.WRAP or FlexWrap.NOWRAP, @@ -1000,8 +1000,8 @@ function TestLayoutValidation:testLargeStructureValidation() if depth >= 3 then for j = 1, 3 do local leaf = Gui.new({ - w = 20 + j * 5, - h = 15 + j * 3, + width = 20 + j * 5, + height = 15 + j * 3, positioning = j == 3 and Positioning.ABSOLUTE or nil, x = j == 3 and j * 10 or nil, y = j == 3 and j * 10 or nil, @@ -1128,8 +1128,8 @@ function TestLayoutValidation:testComplexFlexCombinationValidation() local mainContainer = Gui.new({ x = 0, y = 0, - w = 2400, - h = 1800, + width = 2400, + height = 1800, positioning = Positioning.FLEX, flexDirection = FlexDirection.HORIZONTAL, flexWrap = FlexWrap.WRAP, @@ -1149,8 +1149,8 @@ function TestLayoutValidation:testComplexFlexCombinationValidation() combinationCount = combinationCount + 1 local testContainer = Gui.new({ - w = 200, - h = 150, + width = 200, + height = 150, positioning = Positioning.FLEX, flexDirection = flexDir, justifyContent = justify, @@ -1165,8 +1165,8 @@ function TestLayoutValidation:testComplexFlexCombinationValidation() -- Add children with edge case properties for i = 1, 6 do local child = Gui.new({ - w = i == 1 and 0 or (i == 2 and -10 or (i == 6 and 999999 or 30)), - h = i == 3 and 0 or (i == 4 and -5 or (i == 5 and 1000000 or 20)), + width = i == 1 and 0 or (i == 2 and -10 or (i == 6 and 999999 or 30)), + height = i == 3 and 0 or (i == 4 and -5 or (i == 5 and 1000000 or 20)), positioning = i == 6 and Positioning.ABSOLUTE or nil, x = i == 6 and -100 or nil, y = i == 6 and 200 or nil, @@ -1177,8 +1177,8 @@ function TestLayoutValidation:testComplexFlexCombinationValidation() -- Add nested content to some children if i <= 3 then local nested = Gui.new({ - w = 15, - h = 10, + width = 15, + height = 10, positioning = Positioning.FLEX, flexDirection = FlexDirection.HORIZONTAL, justifyContent = JustifyContent.CENTER, diff --git a/testing/__tests__/10_performance_tests.lua b/testing/__tests__/10_performance_tests.lua index 110d7fb..6fb0f59 100644 --- a/testing/__tests__/10_performance_tests.lua +++ b/testing/__tests__/10_performance_tests.lua @@ -37,8 +37,8 @@ local function createTestContainer(props) local defaults = { x = 0, y = 0, - w = 800, - h = 600, + width = 800, + height = 600, positioning = Positioning.FLEX, flexDirection = FlexDirection.HORIZONTAL, justifyContent = JustifyContent.FLEX_START, @@ -61,8 +61,8 @@ local function createManyChildren(parent, count, child_props) for i = 1, count do local props = { - w = child_props.w or 50, - h = child_props.h or 30, + width = child_props.w or 50, + height = child_props.h or 30, } -- Add any additional properties @@ -152,8 +152,8 @@ end function TestPerformance:testComplexNestedLayoutPerformance() -- Create a deeply nested structure with multiple levels local root = createTestContainer({ - w = 1000, - h = 800, + width = 1000, + height = 800, flexDirection = FlexDirection.VERTICAL, }) @@ -161,8 +161,8 @@ function TestPerformance:testComplexNestedLayoutPerformance() -- Level 1: 5 sections for i = 1, 5 do local section = Gui.new({ - w = 950, - h = 150, + width = 950, + height = 150, positioning = Positioning.FLEX, flexDirection = FlexDirection.HORIZONTAL, justifyContent = JustifyContent.SPACE_BETWEEN, @@ -173,8 +173,8 @@ function TestPerformance:testComplexNestedLayoutPerformance() -- Level 2: 4 columns per section for j = 1, 4 do local column = Gui.new({ - w = 200, - h = 140, + width = 200, + height = 140, positioning = Positioning.FLEX, flexDirection = FlexDirection.VERTICAL, alignItems = AlignItems.CENTER, @@ -185,8 +185,8 @@ function TestPerformance:testComplexNestedLayoutPerformance() -- Level 3: 3 items per column for k = 1, 3 do local item = Gui.new({ - w = 180, - h = 40, + width = 180, + height = 40, }) item.parent = column table.insert(column.children, item) @@ -212,8 +212,8 @@ end -- Test 4: Flex Wrap Performance with Many Elements function TestPerformance:testFlexWrapPerformanceWithManyElements() local container = createTestContainer({ - w = 400, - h = 600, + width = 400, + height = 600, flexDirection = FlexDirection.HORIZONTAL, flexWrap = FlexWrap.WRAP, justifyContent = JustifyContent.SPACE_AROUND, @@ -222,8 +222,8 @@ function TestPerformance:testFlexWrapPerformanceWithManyElements() -- Create many children that will wrap local children = createManyChildren(container, 50, { - w = 80, - h = 50, + width = 80, + height = 50, }) local time, _ = measureTime(function() @@ -366,8 +366,8 @@ end -- Test 8: Stress Test with Maximum Elements function TestPerformance:testStressTestWithMaximumElements() local container = createTestContainer({ - w = 1200, - h = 900, + width = 1200, + height = 900, flexDirection = FlexDirection.HORIZONTAL, flexWrap = FlexWrap.WRAP, }) @@ -375,8 +375,8 @@ function TestPerformance:testStressTestWithMaximumElements() -- Create a large number of children for stress testing local stress_count = 300 local children = createManyChildren(container, stress_count, { - w = 30, - h = 20, + width = 30, + height = 20, }) local time, _ = measureTime(function() @@ -408,8 +408,8 @@ function TestPerformance:testComplexEnterpriseApplicationPerformance() -- Create enterprise-grade dashboard with deep nesting (5 levels) local dashboard = createTestContainer({ - w = 1920, - h = 1080, + width = 1920, + height = 1080, flexDirection = FlexDirection.VERTICAL, gap = 10, }) @@ -417,8 +417,8 @@ function TestPerformance:testComplexEnterpriseApplicationPerformance() local time, structure_info = measureTime(function() -- Level 1: Header, Main Content, Footer local header = Gui.new({ - w = 1900, - h = 80, + width = 1900, + height = 80, positioning = Positioning.FLEX, flexDirection = FlexDirection.HORIZONTAL, justifyContent = JustifyContent.SPACE_BETWEEN, @@ -429,8 +429,8 @@ function TestPerformance:testComplexEnterpriseApplicationPerformance() table.insert(dashboard.children, header) local main_content = Gui.new({ - w = 1900, - h = 980, + width = 1900, + height = 980, positioning = Positioning.FLEX, flexDirection = FlexDirection.HORIZONTAL, gap = 15, @@ -439,8 +439,8 @@ function TestPerformance:testComplexEnterpriseApplicationPerformance() table.insert(dashboard.children, main_content) local footer = Gui.new({ - w = 1900, - h = 60, + width = 1900, + height = 60, positioning = Positioning.FLEX, flexDirection = FlexDirection.HORIZONTAL, justifyContent = JustifyContent.CENTER, @@ -452,8 +452,8 @@ function TestPerformance:testComplexEnterpriseApplicationPerformance() local header_sections = { "logo", "navigation", "search", "notifications", "user_menu" } for i, section_name in ipairs(header_sections) do local section = Gui.new({ - w = section_name == "navigation" and 400 or 150, - h = 60, + width = section_name == "navigation" and 400 or 150, + height = 60, positioning = Positioning.FLEX, flexDirection = FlexDirection.HORIZONTAL, justifyContent = JustifyContent.CENTER, @@ -466,8 +466,8 @@ function TestPerformance:testComplexEnterpriseApplicationPerformance() local item_count = section_name == "navigation" and 6 or 3 for j = 1, item_count do local item = Gui.new({ - w = section_name == "navigation" and 60 or 45, - h = 40, + width = section_name == "navigation" and 60 or 45, + height = 40, }) item.parent = section table.insert(section.children, item) @@ -476,8 +476,8 @@ function TestPerformance:testComplexEnterpriseApplicationPerformance() -- Level 2: Main content areas (sidebar, dashboard grid) local sidebar = Gui.new({ - w = 280, - h = 960, + width = 280, + height = 960, positioning = Positioning.FLEX, flexDirection = FlexDirection.VERTICAL, gap = 10, @@ -486,8 +486,8 @@ function TestPerformance:testComplexEnterpriseApplicationPerformance() table.insert(main_content.children, sidebar) local dashboard_grid = Gui.new({ - w = 1600, - h = 960, + width = 1600, + height = 960, positioning = Positioning.FLEX, flexDirection = FlexDirection.VERTICAL, gap = 20, @@ -506,8 +506,8 @@ function TestPerformance:testComplexEnterpriseApplicationPerformance() for _, category in ipairs(menu_categories) do local category_container = Gui.new({ - w = 260, - h = 40 + (category.items * 35), + width = 260, + height = 40 + (category.items * 35), positioning = Positioning.FLEX, flexDirection = FlexDirection.VERTICAL, gap = 2, @@ -516,15 +516,15 @@ function TestPerformance:testComplexEnterpriseApplicationPerformance() table.insert(sidebar.children, category_container) -- Category header - local category_header = Gui.new({ w = 250, h = 35 }) + local category_header = Gui.new({ width = 250, height = 35 }) category_header.parent = category_container table.insert(category_container.children, category_header) -- Level 4: Menu items with sub-indicators for i = 1, category.items do local menu_item = Gui.new({ - w = 240, - h = 30, + width = 240, + height = 30, positioning = Positioning.FLEX, flexDirection = FlexDirection.HORIZONTAL, justifyContent = JustifyContent.SPACE_BETWEEN, @@ -534,15 +534,15 @@ function TestPerformance:testComplexEnterpriseApplicationPerformance() table.insert(category_container.children, menu_item) -- Level 5: Menu item components (text, icon, badge) - local item_icon = Gui.new({ w = 20, h = 20 }) + local item_icon = Gui.new({ width = 20, height = 20 }) item_icon.parent = menu_item table.insert(menu_item.children, item_icon) - local item_text = Gui.new({ w = 180, h = 25 }) + local item_text = Gui.new({ width = 180, height = 25 }) item_text.parent = menu_item table.insert(menu_item.children, item_text) - local item_badge = Gui.new({ w = 25, h = 18 }) + local item_badge = Gui.new({ width = 25, height = 18 }) item_badge.parent = menu_item table.insert(menu_item.children, item_badge) end @@ -551,8 +551,8 @@ function TestPerformance:testComplexEnterpriseApplicationPerformance() -- Level 3: Dashboard grid (4x3 widget grid with complex internals) for row = 1, 4 do local grid_row = Gui.new({ - w = 1580, - h = 220, + width = 1580, + height = 220, positioning = Positioning.FLEX, flexDirection = FlexDirection.HORIZONTAL, justifyContent = JustifyContent.SPACE_BETWEEN, @@ -563,8 +563,8 @@ function TestPerformance:testComplexEnterpriseApplicationPerformance() for col = 1, 3 do local widget = Gui.new({ - w = 500, - h = 200, + width = 500, + height = 200, positioning = Positioning.FLEX, flexDirection = FlexDirection.VERTICAL, gap = 8, @@ -574,8 +574,8 @@ function TestPerformance:testComplexEnterpriseApplicationPerformance() -- Level 4: Widget components (header, content, footer) local widget_header = Gui.new({ - w = 480, - h = 40, + width = 480, + height = 40, positioning = Positioning.FLEX, flexDirection = FlexDirection.HORIZONTAL, justifyContent = JustifyContent.SPACE_BETWEEN, @@ -585,8 +585,8 @@ function TestPerformance:testComplexEnterpriseApplicationPerformance() table.insert(widget.children, widget_header) local widget_content = Gui.new({ - w = 480, - h = 120, + width = 480, + height = 120, positioning = Positioning.FLEX, flexDirection = FlexDirection.HORIZONTAL, flexWrap = FlexWrap.WRAP, @@ -598,8 +598,8 @@ function TestPerformance:testComplexEnterpriseApplicationPerformance() table.insert(widget.children, widget_content) local widget_footer = Gui.new({ - w = 480, - h = 32, + width = 480, + height = 32, positioning = Positioning.FLEX, flexDirection = FlexDirection.HORIZONTAL, justifyContent = JustifyContent.FLEX_END, @@ -612,21 +612,21 @@ function TestPerformance:testComplexEnterpriseApplicationPerformance() local content_elements = (row * col) % 4 == 0 and 12 or 8 for i = 1, content_elements do local element = Gui.new({ - w = content_elements > 10 and 35 or 55, - h = content_elements > 10 and 25 or 35, + width = content_elements > 10 and 35 or 55, + height = content_elements > 10 and 25 or 35, }) element.parent = widget_content table.insert(widget_content.children, element) end -- Widget header components - local widget_title = Gui.new({ w = 200, h = 30 }) + local widget_title = Gui.new({ width = 200, height = 30 }) widget_title.parent = widget_header table.insert(widget_header.children, widget_title) local widget_actions = Gui.new({ - w = 120, - h = 30, + width = 120, + height = 30, positioning = Positioning.FLEX, flexDirection = FlexDirection.HORIZONTAL, gap = 5, @@ -635,13 +635,13 @@ function TestPerformance:testComplexEnterpriseApplicationPerformance() table.insert(widget_header.children, widget_actions) for j = 1, 3 do - local action_btn = Gui.new({ w = 30, h = 25 }) + local action_btn = Gui.new({ width = 30, height = 25 }) action_btn.parent = widget_actions table.insert(widget_actions.children, action_btn) end -- Widget footer components - local footer_info = Gui.new({ w = 100, h = 25 }) + local footer_info = Gui.new({ width = 100, height = 25 }) footer_info.parent = widget_footer table.insert(widget_footer.children, footer_info) end @@ -693,8 +693,8 @@ function TestPerformance:testHighFrequencyDynamicLayoutUpdates() print("\n=== Test 10: High-Frequency Dynamic Updates Performance ===") local container = createTestContainer({ - w = 1200, - h = 800, + width = 1200, + height = 800, flexDirection = FlexDirection.VERTICAL, gap = 10, }) @@ -703,8 +703,8 @@ function TestPerformance:testHighFrequencyDynamicLayoutUpdates() local sections = {} for i = 1, 8 do local section = Gui.new({ - w = 1180, - h = 90, + width = 1180, + height = 90, positioning = Positioning.FLEX, flexDirection = FlexDirection.HORIZONTAL, justifyContent = JustifyContent.SPACE_BETWEEN, @@ -718,8 +718,8 @@ function TestPerformance:testHighFrequencyDynamicLayoutUpdates() -- Create dynamic items in each section for j = 1, 10 do local item = Gui.new({ - w = 100, - h = 70, + width = 100, + height = 70, positioning = Positioning.FLEX, flexDirection = FlexDirection.VERTICAL, justifyContent = JustifyContent.CENTER, @@ -730,7 +730,7 @@ function TestPerformance:testHighFrequencyDynamicLayoutUpdates() -- Sub-items for more complex updates for k = 1, 3 do - local sub_item = Gui.new({ w = 80, h = 20 }) + local sub_item = Gui.new({ width = 80, height = 20 }) sub_item.parent = item table.insert(item.children, sub_item) end @@ -821,8 +821,8 @@ function TestPerformance:testComplexAnimationReadyLayoutPerformance() -- Create animation-heavy interface structure local animation_container = createTestContainer({ - w = 1400, - h = 900, + width = 1400, + height = 900, flexDirection = FlexDirection.VERTICAL, gap = 15, }) @@ -832,8 +832,8 @@ function TestPerformance:testComplexAnimationReadyLayoutPerformance() -- Create multiple animated sections with complex layouts for section_id = 1, 6 do local section = Gui.new({ - w = 1380, - h = 140, + width = 1380, + height = 140, positioning = Positioning.FLEX, flexDirection = FlexDirection.HORIZONTAL, justifyContent = JustifyContent.SPACE_AROUND, @@ -846,8 +846,8 @@ function TestPerformance:testComplexAnimationReadyLayoutPerformance() -- Create animated cards/panels for card_id = 1, 8 do local card = Gui.new({ - w = 160, - h = 120, + width = 160, + height = 120, positioning = Positioning.FLEX, flexDirection = FlexDirection.VERTICAL, justifyContent = JustifyContent.SPACE_BETWEEN, @@ -859,8 +859,8 @@ function TestPerformance:testComplexAnimationReadyLayoutPerformance() -- Card header with animated elements local card_header = Gui.new({ - w = 150, - h = 30, + width = 150, + height = 30, positioning = Positioning.FLEX, flexDirection = FlexDirection.HORIZONTAL, justifyContent = JustifyContent.SPACE_BETWEEN, @@ -870,18 +870,18 @@ function TestPerformance:testComplexAnimationReadyLayoutPerformance() table.insert(card.children, card_header) -- Animated header components - local title = Gui.new({ w = 100, h = 25 }) + local title = Gui.new({ width = 100, height = 25 }) title.parent = card_header table.insert(card_header.children, title) - local status_indicator = Gui.new({ w = 20, h = 20 }) + local status_indicator = Gui.new({ width = 20, height = 20 }) status_indicator.parent = card_header table.insert(card_header.children, status_indicator) -- Card content with animated metrics local card_content = Gui.new({ - w = 150, - h = 60, + width = 150, + height = 60, positioning = Positioning.FLEX, flexDirection = FlexDirection.HORIZONTAL, flexWrap = FlexWrap.WRAP, @@ -896,8 +896,8 @@ function TestPerformance:testComplexAnimationReadyLayoutPerformance() local metric_count = 4 + (section_id % 3) for i = 1, metric_count do local metric = Gui.new({ - w = 35, - h = 25, + width = 35, + height = 25, positioning = Positioning.FLEX, justifyContent = JustifyContent.CENTER, alignItems = AlignItems.CENTER, @@ -909,8 +909,8 @@ function TestPerformance:testComplexAnimationReadyLayoutPerformance() -- Card footer with action buttons local card_footer = Gui.new({ - w = 150, - h = 25, + width = 150, + height = 25, positioning = Positioning.FLEX, flexDirection = FlexDirection.HORIZONTAL, justifyContent = JustifyContent.FLEX_END, @@ -920,7 +920,7 @@ function TestPerformance:testComplexAnimationReadyLayoutPerformance() table.insert(card.children, card_footer) for i = 1, 2 do - local action_btn = Gui.new({ w = 25, h = 20 }) + local action_btn = Gui.new({ width = 25, height = 20 }) action_btn.parent = card_footer table.insert(card_footer.children, action_btn) table.insert(animation_elements, action_btn) @@ -1024,8 +1024,8 @@ function TestPerformance:testMemoryIntensiveLayoutPerformanceWithCleanup() -- Create intensive layout structure local cycle_start = os.clock() local root = createTestContainer({ - w = 1600, - h = 1000, + width = 1600, + height = 1000, flexDirection = FlexDirection.VERTICAL, gap = 8, }) @@ -1035,8 +1035,8 @@ function TestPerformance:testMemoryIntensiveLayoutPerformanceWithCleanup() -- Create memory-intensive nested structure for level1 = 1, 10 do local section = Gui.new({ - w = 1580, - h = 95, + width = 1580, + height = 95, positioning = Positioning.FLEX, flexDirection = FlexDirection.HORIZONTAL, flexWrap = FlexWrap.WRAP, @@ -1049,8 +1049,8 @@ function TestPerformance:testMemoryIntensiveLayoutPerformanceWithCleanup() for level2 = 1, 15 do local container = Gui.new({ - w = 100, - h = 85, + width = 100, + height = 85, positioning = Positioning.FLEX, flexDirection = FlexDirection.VERTICAL, justifyContent = JustifyContent.SPACE_BETWEEN, @@ -1062,8 +1062,8 @@ function TestPerformance:testMemoryIntensiveLayoutPerformanceWithCleanup() for level3 = 1, 3 do local item = Gui.new({ - w = 95, - h = 25, + width = 95, + height = 25, positioning = Positioning.FLEX, flexDirection = FlexDirection.HORIZONTAL, justifyContent = JustifyContent.CENTER, @@ -1075,7 +1075,7 @@ function TestPerformance:testMemoryIntensiveLayoutPerformanceWithCleanup() -- Add some leaf nodes for memory pressure for level4 = 1, 2 do - local leaf = Gui.new({ w = 40, h = 20 }) + local leaf = Gui.new({ width = 40, height = 20 }) leaf.parent = item table.insert(item.children, leaf) table.insert(all_elements, leaf) @@ -1172,8 +1172,8 @@ function TestPerformance:testExtremeScalePerformanceBenchmark() local test_time, test_metrics = measureTime(function() local root = createTestContainer({ - w = 2000, - h = 1500, + width = 2000, + height = 1500, flexDirection = FlexDirection.VERTICAL, flexWrap = FlexWrap.WRAP, gap = 5, @@ -1189,8 +1189,8 @@ function TestPerformance:testExtremeScalePerformanceBenchmark() for row = 1, rows do local row_container = Gui.new({ - w = 1980, - h = 25, + width = 1980, + height = 25, positioning = Positioning.FLEX, flexDirection = FlexDirection.HORIZONTAL, flexWrap = FlexWrap.WRAP, @@ -1202,7 +1202,7 @@ function TestPerformance:testExtremeScalePerformanceBenchmark() local items_in_this_row = math.min(items_per_row, test_config.elements - (row - 1) * items_per_row) for col = 1, items_in_this_row do - local item = Gui.new({ w = 35, h = 20 }) + local item = Gui.new({ width = 35, height = 20 }) item.parent = row_container table.insert(row_container.children, item) created_elements = created_elements + 1 @@ -1216,8 +1216,8 @@ function TestPerformance:testExtremeScalePerformanceBenchmark() for depth = 1, test_config.depth do local level_container = Gui.new({ - w = 1900 - (depth * 50), - h = 1400 - (depth * 100), + width = 1900 - (depth * 50), + height = 1400 - (depth * 100), positioning = Positioning.FLEX, flexDirection = (depth % 2 == 0) and FlexDirection.VERTICAL or FlexDirection.HORIZONTAL, flexWrap = FlexWrap.WRAP, @@ -1232,7 +1232,7 @@ function TestPerformance:testExtremeScalePerformanceBenchmark() else -- Final level - add many elements for i = 1, elements_per_level do - local leaf = Gui.new({ w = 30 + (i % 20), h = 25 + (i % 15) }) + local leaf = Gui.new({ width = 30 + (i % 20), height = 25 + (i % 15) }) leaf.parent = level_container table.insert(level_container.children, leaf) created_elements = created_elements + 1 @@ -1252,8 +1252,8 @@ function TestPerformance:testExtremeScalePerformanceBenchmark() for i = 1, children_count do local branch = Gui.new({ - w = 150 - (current_depth * 15), - h = 100 - (current_depth * 10), + width = 150 - (current_depth * 15), + height = 100 - (current_depth * 10), positioning = Positioning.FLEX, flexDirection = (i % 2 == 0) and FlexDirection.VERTICAL or FlexDirection.HORIZONTAL, justifyContent = JustifyContent.SPACE_AROUND, @@ -1285,8 +1285,8 @@ function TestPerformance:testExtremeScalePerformanceBenchmark() for section_id = 1, sections do local section = Gui.new({ - w = 1900, - h = 200, + width = 1900, + height = 200, positioning = Positioning.FLEX, flexDirection = FlexDirection.HORIZONTAL, flexWrap = FlexWrap.WRAP, @@ -1301,8 +1301,8 @@ function TestPerformance:testExtremeScalePerformanceBenchmark() local subsections = 5 + (section_id % 3) for sub_id = 1, subsections do local subsection = Gui.new({ - w = 300, - h = 180, + width = 300, + height = 180, positioning = Positioning.FLEX, flexDirection = FlexDirection.VERTICAL, justifyContent = JustifyContent.SPACE_AROUND, @@ -1318,8 +1318,8 @@ function TestPerformance:testExtremeScalePerformanceBenchmark() if elem_id % 3 == 0 then -- Complex element with children local complex_elem = Gui.new({ - w = 280, - h = 35, + width = 280, + height = 35, positioning = Positioning.FLEX, flexDirection = FlexDirection.HORIZONTAL, justifyContent = JustifyContent.SPACE_BETWEEN, @@ -1330,14 +1330,14 @@ function TestPerformance:testExtremeScalePerformanceBenchmark() created_elements = created_elements + 1 for child_id = 1, 4 do - local child = Gui.new({ w = 60, h = 30 }) + local child = Gui.new({ width = 60, height = 30 }) child.parent = complex_elem table.insert(complex_elem.children, child) created_elements = created_elements + 1 end else -- Simple element - local simple_elem = Gui.new({ w = 270, h = 25 }) + local simple_elem = Gui.new({ width = 270, height = 25 }) simple_elem.parent = subsection table.insert(subsection.children, simple_elem) created_elements = created_elements + 1 diff --git a/testing/__tests__/11_auxiliary_functions_tests.lua b/testing/__tests__/11_auxiliary_functions_tests.lua index 3270412..0da8865 100644 --- a/testing/__tests__/11_auxiliary_functions_tests.lua +++ b/testing/__tests__/11_auxiliary_functions_tests.lua @@ -144,14 +144,14 @@ function TestAuxiliaryFunctions:testCalculateAutoWidthWithChildren() local child1 = Gui.new({ parent = parent, - w = 50, - h = 30, + width = 50, + height = 30, }) local child2 = Gui.new({ parent = parent, - w = 40, - h = 25, + width = 40, + height = 25, }) local width = parent:calculateAutoWidth() @@ -176,14 +176,14 @@ function TestAuxiliaryFunctions:testCalculateAutoHeightWithChildren() local child1 = Gui.new({ parent = parent, - w = 50, - h = 30, + width = 50, + height = 30, }) local child2 = Gui.new({ parent = parent, - w = 40, - h = 25, + width = 40, + height = 25, }) local height = parent:calculateAutoHeight() @@ -198,8 +198,8 @@ function TestAuxiliaryFunctions:testGetBounds() local element = Gui.new({ x = 10, y = 20, - w = 100, - h = 80, + width = 100, + height = 80, }) local bounds = element:getBounds() @@ -212,8 +212,8 @@ end function TestAuxiliaryFunctions:testUpdateText() local element = Gui.new({ text = "Original Text", - w = 100, - h = 50, + width = 100, + height = 50, }) element:updateText("New Text") @@ -327,8 +327,8 @@ end function TestAuxiliaryFunctions:testAnimationApplyToElement() local element = Gui.new({ - w = 100, - h = 50, + width = 100, + height = 50, }) local fadeAnim = Gui.Animation.fade(1.0, 1.0, 0.0) @@ -339,8 +339,8 @@ end function TestAuxiliaryFunctions:testAnimationReplaceExisting() local element = Gui.new({ - w = 100, - h = 50, + width = 100, + height = 50, }) local fadeAnim1 = Gui.Animation.fade(1.0, 1.0, 0.0) @@ -366,15 +366,15 @@ function TestAuxiliaryFunctions:testGuiDestroyWithElements() local element1 = Gui.new({ x = 10, y = 10, - w = 100, - h = 50, + width = 100, + height = 50, }) local element2 = Gui.new({ x = 20, y = 20, - w = 80, - h = 40, + width = 80, + height = 40, }) luaunit.assertEquals(#Gui.topElements, 2) @@ -385,20 +385,20 @@ end function TestAuxiliaryFunctions:testGuiDestroyWithNestedElements() local parent = Gui.new({ - w = 200, - h = 100, + width = 200, + height = 100, }) local child1 = Gui.new({ parent = parent, - w = 50, - h = 30, + width = 50, + height = 30, }) local child2 = Gui.new({ parent = parent, - w = 40, - h = 25, + width = 40, + height = 25, }) luaunit.assertEquals(#Gui.topElements, 1) @@ -410,14 +410,14 @@ end function TestAuxiliaryFunctions:testElementDestroyRemovesFromParent() local parent = Gui.new({ - w = 200, - h = 100, + width = 200, + height = 100, }) local child = Gui.new({ parent = parent, - w = 50, - h = 30, + width = 50, + height = 30, }) luaunit.assertEquals(#parent.children, 1) @@ -432,8 +432,8 @@ function TestAuxiliaryFunctions:testElementDestroyRemovesFromTopElements() local element = Gui.new({ x = 10, y = 10, - w = 100, - h = 50, + width = 100, + height = 50, }) luaunit.assertEquals(#Gui.topElements, 1) @@ -445,20 +445,20 @@ end function TestAuxiliaryFunctions:testElementDestroyNestedChildren() local parent = Gui.new({ - w = 200, - h = 150, + width = 200, + height = 150, }) local child = Gui.new({ parent = parent, - w = 100, - h = 75, + width = 100, + height = 75, }) local grandchild = Gui.new({ parent = child, - w = 50, - h = 30, + width = 50, + height = 30, }) luaunit.assertEquals(#parent.children, 1) @@ -629,8 +629,8 @@ function TestAuxiliaryFunctions:testComplexColorManagementSystem() -- Test color application to complex UI structure local ui_container = Gui.new({ - w = 800, - h = 600, + width = 800, + height = 600, positioning = enums.Positioning.FLEX, flexDirection = enums.FlexDirection.VERTICAL, gap = 10, @@ -640,8 +640,8 @@ function TestAuxiliaryFunctions:testComplexColorManagementSystem() local component_types = { "header", "content", "sidebar", "footer", "modal" } for i, comp_type in ipairs(component_types) do local component = Gui.new({ - w = 780, - h = 100, + width = 780, + height = 100, positioning = enums.Positioning.FLEX, flexDirection = enums.FlexDirection.HORIZONTAL, justifyContent = enums.JustifyContent.SPACE_BETWEEN, @@ -659,8 +659,8 @@ function TestAuxiliaryFunctions:testComplexColorManagementSystem() -- Add sub-components with color variations for j = 1, 4 do local sub_component = Gui.new({ - w = 150, - h = 80, + width = 150, + height = 80, positioning = enums.Positioning.FLEX, justifyContent = enums.JustifyContent.CENTER, alignItems = enums.AlignItems.CENTER, @@ -748,8 +748,8 @@ function TestAuxiliaryFunctions:testAdvancedTextAndAutoSizingSystem() -- Create dynamic text containers with auto-sizing local main_container = Gui.new({ - w = 1000, - h = 800, + width = 1000, + height = 800, positioning = enums.Positioning.FLEX, flexDirection = enums.FlexDirection.VERTICAL, gap = 15, @@ -757,8 +757,8 @@ function TestAuxiliaryFunctions:testAdvancedTextAndAutoSizingSystem() for _, scenario in ipairs(text_scenarios) do local text_container = Gui.new({ - w = 900, - h = 100, + width = 900, + height = 100, positioning = enums.Positioning.FLEX, flexDirection = enums.FlexDirection.HORIZONTAL, justifyContent = enums.JustifyContent.SPACE_BETWEEN, @@ -772,8 +772,8 @@ function TestAuxiliaryFunctions:testAdvancedTextAndAutoSizingSystem() local text_element = Gui.new({ text = scenario.content, textSize = scenario.size, - w = 0, - h = 0, -- Start with zero size for auto-sizing + width = 0, + height = 0, -- Start with zero size for auto-sizing }) text_element.parent = text_container table.insert(text_container.children, text_element) @@ -820,8 +820,8 @@ function TestAuxiliaryFunctions:testAdvancedTextAndAutoSizingSystem() local fixed_element = Gui.new({ text = scenario.content, textSize = scenario.size, - w = 200, - h = 50, -- Fixed size + width = 200, + height = 50, -- Fixed size }) fixed_element.parent = text_container table.insert(text_container.children, fixed_element) @@ -830,8 +830,8 @@ function TestAuxiliaryFunctions:testAdvancedTextAndAutoSizingSystem() local adaptive_element = Gui.new({ text = scenario.content, textSize = scenario.size, - w = math.max(150, auto_width * 0.8), - h = math.max(30, auto_height * 1.2), + width = math.max(150, auto_width * 0.8), + height = math.max(30, auto_height * 1.2), }) adaptive_element.parent = text_container table.insert(text_container.children, adaptive_element) @@ -892,8 +892,8 @@ function TestAuxiliaryFunctions:testAdvancedTextAndAutoSizingSystem() -- Test complex auto-sizing with nested structures local nested_container = Gui.new({ - w = 800, - h = 200, + width = 800, + height = 200, positioning = enums.Positioning.FLEX, flexDirection = enums.FlexDirection.VERTICAL, gap = 10, @@ -904,8 +904,8 @@ function TestAuxiliaryFunctions:testAdvancedTextAndAutoSizingSystem() -- Create nested structure with auto-sizing children for level = 1, 3 do local level_container = Gui.new({ - w = 750 - (level * 50), - h = 60, + width = 750 - (level * 50), + height = 60, positioning = enums.Positioning.FLEX, flexDirection = enums.FlexDirection.HORIZONTAL, justifyContent = enums.JustifyContent.SPACE_AROUND, @@ -923,8 +923,8 @@ function TestAuxiliaryFunctions:testAdvancedTextAndAutoSizingSystem() local text_item = Gui.new({ text = item_text, textSize = 14 - level, - w = 0, - h = 0, + width = 0, + height = 0, }) text_item.parent = level_container table.insert(level_container.children, text_item) @@ -972,8 +972,8 @@ function TestAuxiliaryFunctions:testComprehensiveAnimationEngine() -- Create container for animated elements local animation_container = Gui.new({ - w = 1200, - h = 800, + width = 1200, + height = 800, positioning = enums.Positioning.FLEX, flexDirection = enums.FlexDirection.VERTICAL, gap = 20, @@ -1014,8 +1014,8 @@ function TestAuxiliaryFunctions:testComprehensiveAnimationEngine() -- Create and configure animations for each test case for case_idx, test_case in ipairs(animation_test_cases) do local case_container = Gui.new({ - w = 1180, - h = 200, + width = 1180, + height = 200, positioning = enums.Positioning.FLEX, flexDirection = enums.FlexDirection.HORIZONTAL, flexWrap = enums.FlexWrap.WRAP, @@ -1029,8 +1029,8 @@ function TestAuxiliaryFunctions:testComprehensiveAnimationEngine() for elem_idx = 1, test_case.elements do local element = Gui.new({ - w = test_case.properties.width and test_case.properties.width.from or 120, - h = test_case.properties.height and test_case.properties.height.from or 60, + width = test_case.properties.width and test_case.properties.width.from or 120, + height = test_case.properties.height and test_case.properties.height.from or 60, opacity = test_case.properties.opacity and test_case.properties.opacity.from or 1.0, }) element.parent = case_container @@ -1216,7 +1216,7 @@ function TestAuxiliaryFunctions:testComprehensiveAnimationEngine() ) -- Test animation chaining and sequencing - local chain_element = Gui.new({ w = 100, h = 50, opacity = 1.0 }) + local chain_element = Gui.new({ width = 100, height = 50, opacity = 1.0 }) chain_element.parent = animation_container table.insert(animation_container.children, chain_element) @@ -1402,8 +1402,8 @@ function TestAuxiliaryFunctions:testAdvancedGUIManagementAndCleanup() for _, item in ipairs(structure) do local element = Gui.new({ - w = math.max(100, 300 - level * 20), - h = math.max(30, 80 - level * 5), + width = math.max(100, 300 - level * 20), + height = math.max(30, 80 - level * 5), positioning = enums.Positioning.FLEX, flexDirection = level % 2 == 0 and enums.FlexDirection.HORIZONTAL or enums.FlexDirection.VERTICAL, justifyContent = enums.JustifyContent.FLEX_START, @@ -1574,8 +1574,8 @@ function TestAuxiliaryFunctions:testAdvancedGUIManagementAndCleanup() -- Test complex element retrieval and manipulation local final_container = Gui.new({ - w = 400, - h = 300, + width = 400, + height = 300, positioning = enums.Positioning.FLEX, flexDirection = enums.FlexDirection.VERTICAL, }) @@ -1584,8 +1584,8 @@ function TestAuxiliaryFunctions:testAdvancedGUIManagementAndCleanup() local managed_elements = {} for i = 1, 10 do local element = Gui.new({ - w = 350, - h = 25, + width = 350, + height = 25, text = "Managed Element " .. i, textSize = 12, }) @@ -1729,8 +1729,8 @@ function TestAuxiliaryFunctions:testExtremeEdgeCasesAndErrorResilience() local element = Gui.new({ text = test.text, textSize = 14, - w = 0, - h = 0, + width = 0, + height = 0, }) local text_width = element:calculateTextWidth() @@ -1794,14 +1794,14 @@ function TestAuxiliaryFunctions:testExtremeEdgeCasesAndErrorResilience() -- Extreme hierarchy testing local max_depth = 20 - local extreme_hierarchy_element = Gui.new({ w = 1000, h = 800 }) + local extreme_hierarchy_element = Gui.new({ width = 1000, height = 800 }) local current_parent = extreme_hierarchy_element -- Create extremely deep hierarchy for depth = 1, max_depth do local child = Gui.new({ - w = math.max(50, 1000 - depth * 45), - h = math.max(30, 800 - depth * 35), + width = math.max(50, 1000 - depth * 45), + height = math.max(30, 800 - depth * 35), positioning = enums.Positioning.FLEX, flexDirection = depth % 2 == 0 and enums.FlexDirection.HORIZONTAL or enums.FlexDirection.VERTICAL, }) @@ -1828,8 +1828,8 @@ function TestAuxiliaryFunctions:testExtremeEdgeCasesAndErrorResilience() -- Test extreme width hierarchy (many siblings) local wide_container = Gui.new({ - w = 2000, - h = 200, + width = 2000, + height = 200, positioning = enums.Positioning.FLEX, flexDirection = enums.FlexDirection.HORIZONTAL, flexWrap = enums.FlexWrap.WRAP, @@ -1838,7 +1838,7 @@ function TestAuxiliaryFunctions:testExtremeEdgeCasesAndErrorResilience() local max_siblings = 500 for i = 1, max_siblings do - local sibling = Gui.new({ w = 30, h = 25 }) + local sibling = Gui.new({ width = 30, height = 25 }) sibling.parent = wide_container table.insert(wide_container.children, sibling) end @@ -1861,7 +1861,7 @@ function TestAuxiliaryFunctions:testExtremeEdgeCasesAndErrorResilience() -- Test massive cleanup operations local cleanup_elements = {} for i = 1, 1000 do - local element = Gui.new({ w = 50, h = 30 }) + local element = Gui.new({ width = 50, height = 30 }) table.insert(cleanup_elements, element) end @@ -1882,7 +1882,7 @@ function TestAuxiliaryFunctions:testExtremeEdgeCasesAndErrorResilience() luaunit.assertEquals(#Gui.topElements, 0, "All elements should be cleaned up") -- Test opacity boundary resilience - local opacity_element = Gui.new({ w = 100, h = 50, opacity = 0.5 }) + local opacity_element = Gui.new({ width = 100, height = 50, opacity = 0.5 }) local extreme_opacities = { -999, -1, 0, 0.5, 1, 2, 999, math.huge, -math.huge } for _, opacity in ipairs(extreme_opacities) do diff --git a/testing/__tests__/12_units_system_tests.lua b/testing/__tests__/12_units_system_tests.lua index f5b6ad3..aa283a2 100644 --- a/testing/__tests__/12_units_system_tests.lua +++ b/testing/__tests__/12_units_system_tests.lua @@ -15,7 +15,9 @@ function TestUnitsSystem:setUp() -- Clear any existing GUI elements and reset viewport Gui.destroy() -- Set a consistent viewport size for testing - love.graphics.getDimensions = function() return 1200, 800 end + love.graphics.getDimensions = function() + return 1200, 800 + end end function TestUnitsSystem:tearDown() @@ -30,12 +32,12 @@ function TestUnitsSystem:testUnitsParsePx() -- Test pixel unit parsing local container = Gui.new({ id = "container", - w = "100px", - h = "200px", + width = "100px", + height = "200px", x = "50px", y = "75px", }) - + luaunit.assertEquals(container.width, 100) luaunit.assertEquals(container.height, 200) luaunit.assertEquals(container.x, 50) @@ -50,19 +52,19 @@ function TestUnitsSystem:testUnitsParsePercentage() -- Test percentage unit parsing local parent = Gui.new({ id = "parent", - w = 400, - h = 300, + width = 400, + height = 300, }) - + local child = Gui.new({ id = "child", - w = "50%", - h = "25%", + width = "50%", + height = "25%", parent = parent, }) - + luaunit.assertEquals(child.width, 200) -- 50% of 400 - luaunit.assertEquals(child.height, 75) -- 25% of 300 + luaunit.assertEquals(child.height, 75) -- 25% of 300 luaunit.assertEquals(child.units.width.unit, "%") luaunit.assertEquals(child.units.height.unit, "%") luaunit.assertEquals(child.units.width.value, 50) @@ -73,10 +75,10 @@ function TestUnitsSystem:testUnitsParseViewportWidth() -- Test viewport width units (1200px viewport) local container = Gui.new({ id = "container", - w = "50vw", - h = "100px", + width = "50vw", + height = "100px", }) - + luaunit.assertEquals(container.width, 600) -- 50% of 1200 luaunit.assertEquals(container.units.width.unit, "vw") luaunit.assertEquals(container.units.width.value, 50) @@ -86,10 +88,10 @@ function TestUnitsSystem:testUnitsParseViewportHeight() -- Test viewport height units (800px viewport) local container = Gui.new({ id = "container", - w = "100px", - h = "25vh", + width = "100px", + height = "25vh", }) - + luaunit.assertEquals(container.height, 200) -- 25% of 800 luaunit.assertEquals(container.units.height.unit, "vh") luaunit.assertEquals(container.units.height.value, 25) @@ -102,7 +104,7 @@ function TestUnitsSystem:testUnitsAutoSizing() positioning = Positioning.FLEX, flexDirection = FlexDirection.VERTICAL, }) - + luaunit.assertEquals(autoContainer.units.width.unit, "auto") luaunit.assertEquals(autoContainer.units.height.unit, "auto") luaunit.assertTrue(autoContainer.autosizing.width) @@ -113,19 +115,19 @@ function TestUnitsSystem:testMixedUnits() -- Test elements with different unit types local container = Gui.new({ id = "container", - w = "80vw", -- viewport width - h = "400px", -- pixels - x = "10%", -- percentage of viewport - y = "5vh", -- viewport height - gap = "2vw", -- viewport width for gap - textSize = "16px" -- pixel font size + width = "80vw", -- viewport width + height = "400px", -- pixels + x = "10%", -- percentage of viewport + y = "5vh", -- viewport height + gap = "2vw", -- viewport width for gap + textSize = "16px", -- pixel font size }) - - luaunit.assertEquals(container.width, 960) -- 80% of 1200 - luaunit.assertEquals(container.height, 400) -- 400px - luaunit.assertEquals(container.x, 120) -- 10% of 1200 - luaunit.assertEquals(container.y, 40) -- 5% of 800 - luaunit.assertEquals(container.gap, 24) -- 2% of 1200 + + luaunit.assertEquals(container.width, 960) -- 80% of 1200 + luaunit.assertEquals(container.height, 400) -- 400px + luaunit.assertEquals(container.x, 120) -- 10% of 1200 + luaunit.assertEquals(container.y, 40) -- 5% of 800 + luaunit.assertEquals(container.gap, 24) -- 2% of 1200 luaunit.assertEquals(container.textSize, 16) -- 16px end @@ -137,18 +139,20 @@ function TestUnitsSystem:testResizeViewportUnits() -- Test that viewport units recalculate on resize local container = Gui.new({ id = "container", - w = "50vw", - h = "25vh", + width = "50vw", + height = "25vh", }) - - luaunit.assertEquals(container.width, 600) -- 50% of 1200 + + luaunit.assertEquals(container.width, 600) -- 50% of 1200 luaunit.assertEquals(container.height, 200) -- 25% of 800 - + -- Simulate viewport resize - love.graphics.getDimensions = function() return 1600, 1000 end + love.graphics.getDimensions = function() + return 1600, 1000 + end container:resize(1600, 1000) - - luaunit.assertEquals(container.width, 800) -- 50% of 1600 + + luaunit.assertEquals(container.width, 800) -- 50% of 1600 luaunit.assertEquals(container.height, 250) -- 25% of 1000 end @@ -156,43 +160,43 @@ function TestUnitsSystem:testResizePercentageUnits() -- Test percentage units during parent resize local parent = Gui.new({ id = "parent", - w = 400, - h = 300, + width = 400, + height = 300, }) - + local child = Gui.new({ id = "child", - w = "75%", - h = "50%", + width = "75%", + height = "50%", parent = parent, }) - - luaunit.assertEquals(child.width, 300) -- 75% of 400 - luaunit.assertEquals(child.height, 150) -- 50% of 300 - + + luaunit.assertEquals(child.width, 300) -- 75% of 400 + luaunit.assertEquals(child.height, 150) -- 50% of 300 + -- Resize parent parent.width = 600 parent.height = 500 child:resize(1200, 800) - - luaunit.assertEquals(child.width, 450) -- 75% of 600 - luaunit.assertEquals(child.height, 250) -- 50% of 500 + + luaunit.assertEquals(child.width, 450) -- 75% of 600 + luaunit.assertEquals(child.height, 250) -- 50% of 500 end function TestUnitsSystem:testResizePixelUnitsNoChange() -- Test that pixel units don't change during resize local container = Gui.new({ id = "container", - w = "300px", - h = "200px", + width = "300px", + height = "200px", }) - + luaunit.assertEquals(container.width, 300) luaunit.assertEquals(container.height, 200) - + -- Resize viewport - pixel values should stay the same container:resize(1600, 1000) - + luaunit.assertEquals(container.width, 300) luaunit.assertEquals(container.height, 200) end @@ -205,21 +209,21 @@ function TestUnitsSystem:testPaddingUnits() -- Test different unit types for padding local container = Gui.new({ id = "container", - w = 400, - h = 300, + width = 400, + height = 300, padding = { top = "10px", right = "5%", - bottom = "2vh", - left = "1vw" - } + bottom = "2vh", + left = "1vw", + }, }) - - luaunit.assertEquals(container.padding.top, 10) -- 10px - luaunit.assertEquals(container.padding.right, 20) -- 5% of 400 + + luaunit.assertEquals(container.padding.top, 10) -- 10px + luaunit.assertEquals(container.padding.right, 20) -- 5% of 400 luaunit.assertEquals(container.padding.bottom, 16) -- 2% of 800 - luaunit.assertEquals(container.padding.left, 12) -- 1% of 1200 - + luaunit.assertEquals(container.padding.left, 12) -- 1% of 1200 + luaunit.assertEquals(container.units.padding.top.unit, "px") luaunit.assertEquals(container.units.padding.right.unit, "%") luaunit.assertEquals(container.units.padding.bottom.unit, "vh") @@ -230,21 +234,21 @@ function TestUnitsSystem:testMarginUnits() -- Test different unit types for margin local container = Gui.new({ id = "container", - w = 400, - h = 300, + width = 400, + height = 300, margin = { top = "8px", right = "3%", bottom = "1vh", - left = "2vw" - } + left = "2vw", + }, }) - - luaunit.assertEquals(container.margin.top, 8) -- 8px - luaunit.assertEquals(container.margin.right, 12) -- 3% of 400 - luaunit.assertEquals(container.margin.bottom, 8) -- 1% of 800 - luaunit.assertEquals(container.margin.left, 24) -- 2% of 1200 - + + luaunit.assertEquals(container.margin.top, 8) -- 8px + luaunit.assertEquals(container.margin.right, 12) -- 3% of 400 + luaunit.assertEquals(container.margin.bottom, 8) -- 1% of 800 + luaunit.assertEquals(container.margin.left, 24) -- 2% of 1200 + luaunit.assertEquals(container.units.margin.top.unit, "px") luaunit.assertEquals(container.units.margin.right.unit, "%") luaunit.assertEquals(container.units.margin.bottom.unit, "vh") @@ -261,25 +265,25 @@ function TestUnitsSystem:testGapUnits() id = "flexContainer", positioning = Positioning.FLEX, flexDirection = FlexDirection.HORIZONTAL, - w = 600, - h = 400, + width = 600, + height = 400, gap = "2%", -- 2% of container width }) - + luaunit.assertEquals(flexContainer.gap, 12) -- 2% of 600 luaunit.assertEquals(flexContainer.units.gap.unit, "%") luaunit.assertEquals(flexContainer.units.gap.value, 2) - + -- Test with viewport units local viewportGapContainer = Gui.new({ - id = "viewportGapContainer", + id = "viewportGapContainer", positioning = Positioning.FLEX, flexDirection = FlexDirection.VERTICAL, - w = 400, - h = 300, + width = 400, + height = 300, gap = "1vw", }) - + luaunit.assertEquals(viewportGapContainer.gap, 12) -- 1% of 1200 viewport width luaunit.assertEquals(viewportGapContainer.units.gap.unit, "vw") end @@ -288,23 +292,23 @@ function TestUnitsSystem:testTextSizeUnits() -- Test textSize with different units local textElement = Gui.new({ id = "textElement", - w = 200, - h = 100, - textSize = "16px" + width = 200, + height = 100, + textSize = "16px", }) - + luaunit.assertEquals(textElement.textSize, 16) luaunit.assertEquals(textElement.units.textSize.unit, "px") luaunit.assertEquals(textElement.units.textSize.value, 16) - + -- Test with viewport units local viewportTextElement = Gui.new({ id = "viewportTextElement", - w = 200, - h = 100, - textSize = "2vw" + width = 200, + height = 100, + textSize = "2vw", }) - + luaunit.assertEquals(viewportTextElement.textSize, 24) -- 2% of 1200 luaunit.assertEquals(viewportTextElement.units.textSize.unit, "vw") end @@ -317,10 +321,10 @@ function TestUnitsSystem:testInvalidUnits() -- Test handling of invalid unit specifications (should default to pixels) local container = Gui.new({ id = "container", - w = "100invalid", -- Should be treated as 100px - h = "50badunit" -- Should be treated as 50px + width = "100invalid", -- Should be treated as 100px + height = "50badunit", -- Should be treated as 50px }) - + -- Should fallback to pixel values luaunit.assertEquals(container.width, 100) luaunit.assertEquals(container.height, 50) @@ -332,12 +336,12 @@ function TestUnitsSystem:testZeroAndNegativeValues() -- Test zero and negative values with units local container = Gui.new({ id = "container", - w = "0px", - h = "0vh", + width = "0px", + height = "0vh", x = "-10px", - y = "-5%" + y = "-5%", }) - + luaunit.assertEquals(container.width, 0) luaunit.assertEquals(container.height, 0) luaunit.assertEquals(container.x, -10) @@ -348,13 +352,13 @@ function TestUnitsSystem:testVeryLargeValues() -- Test very large percentage values local container = Gui.new({ id = "container", - w = "200%", -- 200% of viewport - h = "150vh" -- 150% of viewport height + width = "200%", -- 200% of viewport + height = "150vh", -- 150% of viewport height }) - + luaunit.assertEquals(container.width, 2400) -- 200% of 1200 luaunit.assertEquals(container.height, 1200) -- 150% of 800 end -- Run the tests -os.exit(luaunit.LuaUnit.run()) \ No newline at end of file +luaunit.LuaUnit.run() diff --git a/testing/__tests__/13_relative_positioning_tests.lua b/testing/__tests__/13_relative_positioning_tests.lua index 01ec8b1..849617c 100644 --- a/testing/__tests__/13_relative_positioning_tests.lua +++ b/testing/__tests__/13_relative_positioning_tests.lua @@ -15,8 +15,8 @@ function TestRelativePositioning.testBasicRelativePositioning() local parent = Gui.new({ x = 100, y = 50, - w = 200, - h = 150, + width = 200, + height = 150, positioning = "relative", background = Color.new(0.2, 0.2, 0.2, 1.0), }) @@ -25,16 +25,16 @@ function TestRelativePositioning.testBasicRelativePositioning() parent = parent, x = 20, y = 30, - w = 50, - h = 40, + width = 50, + height = 40, positioning = "relative", - background = Color.new(0.8, 0.2, 0.2, 1.0) + background = Color.new(0.8, 0.2, 0.2, 1.0), }) -- Child should be positioned relative to parent luaunit.assertEquals(child.positioning, Positioning.RELATIVE) luaunit.assertEquals(child.x, 120) -- parent.x (100) + offset (20) - luaunit.assertEquals(child.y, 80) -- parent.y (50) + offset (30) + luaunit.assertEquals(child.y, 80) -- parent.y (50) + offset (30) end -- Test 2: Relative positioning with percentage values @@ -42,8 +42,8 @@ function TestRelativePositioning.testRelativePositioningPercentages() local parent = Gui.new({ x = 50, y = 100, - w = 200, - h = 100, + width = 200, + height = 100, positioning = "relative", background = Color.new(0.2, 0.2, 0.2, 1.0), }) @@ -52,10 +52,10 @@ function TestRelativePositioning.testRelativePositioningPercentages() parent = parent, x = "10%", -- 10% of parent width = 20px y = "20%", -- 20% of parent height = 20px - w = 30, - h = 20, + width = 30, + height = 20, positioning = "relative", - background = Color.new(0.8, 0.2, 0.2, 1.0) + background = Color.new(0.8, 0.2, 0.2, 1.0), }) -- Child should be positioned relative to parent with percentage offsets @@ -69,23 +69,23 @@ function TestRelativePositioning.testRelativePositioningNoOffset() local parent = Gui.new({ x = 75, y = 125, - w = 150, - h = 200, + width = 150, + height = 200, positioning = "relative", background = Color.new(0.2, 0.2, 0.2, 1.0), }) local child = Gui.new({ parent = parent, - w = 40, - h = 30, + width = 40, + height = 30, positioning = "relative", - background = Color.new(0.2, 0.8, 0.2, 1.0) + background = Color.new(0.2, 0.8, 0.2, 1.0), }) -- Child should be positioned at parent's position with no offset luaunit.assertEquals(child.positioning, Positioning.RELATIVE) - luaunit.assertEquals(child.x, 75) -- same as parent.x + luaunit.assertEquals(child.x, 75) -- same as parent.x luaunit.assertEquals(child.y, 125) -- same as parent.y end @@ -94,8 +94,8 @@ function TestRelativePositioning.testMultipleRelativeChildren() local parent = Gui.new({ x = 200, y = 300, - w = 100, - h = 100, + width = 100, + height = 100, positioning = "relative", background = Color.new(0.2, 0.2, 0.2, 1.0), }) @@ -104,20 +104,20 @@ function TestRelativePositioning.testMultipleRelativeChildren() parent = parent, x = 10, y = 15, - w = 20, - h = 20, + width = 20, + height = 20, positioning = "relative", - background = Color.new(0.8, 0.2, 0.2, 1.0) + background = Color.new(0.8, 0.2, 0.2, 1.0), }) local child2 = Gui.new({ parent = parent, x = 30, y = 45, - w = 25, - h = 25, + width = 25, + height = 25, positioning = "relative", - background = Color.new(0.2, 0.8, 0.2, 1.0) + background = Color.new(0.2, 0.8, 0.2, 1.0), }) -- Both children should be positioned relative to parent @@ -133,8 +133,8 @@ function TestRelativePositioning.testNestedRelativePositioning() local grandparent = Gui.new({ x = 50, y = 60, - w = 300, - h = 250, + width = 300, + height = 250, positioning = "relative", background = Color.new(0.1, 0.1, 0.1, 1.0), }) @@ -143,8 +143,8 @@ function TestRelativePositioning.testNestedRelativePositioning() parent = grandparent, x = 25, y = 35, - w = 200, - h = 150, + width = 200, + height = 150, positioning = "relative", background = Color.new(0.3, 0.3, 0.3, 1.0), }) @@ -153,18 +153,18 @@ function TestRelativePositioning.testNestedRelativePositioning() parent = parent, x = 15, y = 20, - w = 50, - h = 40, + width = 50, + height = 40, positioning = "relative", - background = Color.new(0.8, 0.8, 0.8, 1.0) + background = Color.new(0.8, 0.8, 0.8, 1.0), }) -- Each level should be positioned relative to its parent - luaunit.assertEquals(parent.x, 75) -- grandparent.x (50) + offset (25) - luaunit.assertEquals(parent.y, 95) -- grandparent.y (60) + offset (35) + luaunit.assertEquals(parent.x, 75) -- grandparent.x (50) + offset (25) + luaunit.assertEquals(parent.y, 95) -- grandparent.y (60) + offset (35) - luaunit.assertEquals(child.x, 90) -- parent.x (75) + offset (15) - luaunit.assertEquals(child.y, 115) -- parent.y (95) + offset (20) + luaunit.assertEquals(child.x, 90) -- parent.x (75) + offset (15) + luaunit.assertEquals(child.y, 115) -- parent.y (95) + offset (20) end -- Test 6: Mixed positioning types (relative child in absolute parent) @@ -172,8 +172,8 @@ function TestRelativePositioning.testMixedPositioning() local parent = Gui.new({ x = 100, y = 200, - w = 180, - h = 120, + width = 180, + height = 120, positioning = "absolute", background = Color.new(0.2, 0.2, 0.2, 1.0), }) @@ -182,10 +182,10 @@ function TestRelativePositioning.testMixedPositioning() parent = parent, x = 40, y = 25, - w = 60, - h = 35, + width = 60, + height = 35, positioning = "relative", - background = Color.new(0.8, 0.8, 0.2, 1.0) + background = Color.new(0.8, 0.8, 0.2, 1.0), }) -- Relative child should still be positioned relative to absolute parent @@ -196,4 +196,4 @@ function TestRelativePositioning.testMixedPositioning() end -- Run all tests -os.exit(luaunit.LuaUnit.run()) \ No newline at end of file +luaunit.LuaUnit.run() diff --git a/testing/__tests__/14_text_scaling_basic_tests.lua b/testing/__tests__/14_text_scaling_basic_tests.lua index eefeb33..dc69127 100644 --- a/testing/__tests__/14_text_scaling_basic_tests.lua +++ b/testing/__tests__/14_text_scaling_basic_tests.lua @@ -1,124 +1,473 @@ --- Test file for basic text scaling functionality --- This tests simple cases where elements scale text appropriately during resize +-- Test file for comprehensive text scaling functionality +-- This tests all text scaling scenarios including edge cases and multiple resize events -package.path = './testing/?.lua;./?.lua;' .. package.path -local luaunit = require("luaunit") +package.path = package.path .. ";?.lua" --- Mock love module for testing -love = { - graphics = { - getDimensions = function() return 800, 600 end, - newFont = function(size) return { getWidth = function(text) return size * #text end, getHeight = function() return size end } end, - getFont = function() return { getWidth = function(text) return 12 * #text end, getHeight = function() return 12 end } end, - }, - window = { - getMode = function() return 800, 600 end - } -} - --- Import the FlexLove library +local luaunit = require("testing/luaunit") +require("testing/loveStub") -- Required to mock LOVE functions local FlexLove = require("FlexLove") local Gui = FlexLove.GUI --- Test suite for basic text scaling -local BasicTextScalingTests = {} +-- Test suite for comprehensive text scaling +TestTextScaling = {} -function BasicTextScalingTests.testFixedTextSize() +-- Basic functionality tests +function TestTextScaling.testFixedTextSize() -- Create an element with fixed textSize in pixels local element = Gui.new({ id = "testElement", - w = 100, - h = 50, + width = 100, + height = 50, textSize = 16, -- Fixed size in pixels - text = "Hello World" + text = "Hello World", }) -- Check initial state luaunit.assertEquals(element.textSize, 16) - - -- Simulate a resize with larger viewport - local newWidth, newHeight = 800, 600 - element:resize(newWidth, newHeight) - - -- Fixed textSize should remain unchanged - luaunit.assertEquals(element.textSize, 16) + luaunit.assertEquals(element.units.textSize.unit, "px") + + -- Simulate multiple resizes + element:resize(1600, 1200) + luaunit.assertEquals(element.textSize, 16) -- Should remain unchanged + + element:resize(400, 300) + luaunit.assertEquals(element.textSize, 16) -- Should remain unchanged end -function BasicTextScalingTests.testPercentageTextSize() - -- Create an element with percentage textSize +function TestTextScaling.testPercentageTextSize() + -- Create an element with percentage textSize (relative to viewport height) local element = Gui.new({ id = "testElement", - w = 100, - h = 50, + width = 100, + height = 50, textSize = "5%", -- Percentage of viewport height - text = "Hello World" + text = "Hello World", }) - -- Check initial state + -- Check initial state (5% of 600px = 30px) luaunit.assertEquals(element.units.textSize.unit, "%") - - -- Simulate a resize with larger viewport - local newWidth, newHeight = 800, 600 - element:resize(newWidth, newHeight) - - -- Percentage textSize should be recalculated - luaunit.assertEquals(element.textSize, 30) -- 5% of 600 height = 30 + luaunit.assertEquals(element.units.textSize.value, 5) + luaunit.assertEquals(element.textSize, 30.0) + + -- Simulate resize to larger viewport (5% of 1200px = 60px) + element:resize(1600, 1200) + luaunit.assertEquals(element.textSize, 60.0) + + -- Simulate resize to smaller viewport (5% of 300px = 15px) + element:resize(400, 300) + luaunit.assertEquals(element.textSize, 15.0) end -function BasicTextScalingTests.testVwTextSize() +function TestTextScaling.testVwTextSize() -- Create an element with vw textSize local element = Gui.new({ id = "testElement", - w = 100, - h = 50, + width = 100, + height = 50, textSize = "2vw", -- 2% of viewport width - text = "Hello World" + text = "Hello World", }) - -- Check initial state + -- Check initial state (2% of 800px = 16px) luaunit.assertEquals(element.units.textSize.unit, "vw") - - -- Simulate a resize with larger viewport - local newWidth, newHeight = 800, 600 - element:resize(newWidth, newHeight) - - -- vw textSize should be recalculated - luaunit.assertEquals(element.textSize, 16) -- 2% of 800 width = 16 + luaunit.assertEquals(element.units.textSize.value, 2) + luaunit.assertEquals(element.textSize, 16.0) + + -- Simulate resize to larger viewport (2% of 1600px = 32px) + element:resize(1600, 1200) + luaunit.assertEquals(element.textSize, 32.0) + + -- Simulate resize to smaller viewport (2% of 400px = 8px) + element:resize(400, 300) + luaunit.assertEquals(element.textSize, 8.0) end -function BasicTextScalingTests.testVhTextSize() +function TestTextScaling.testVhTextSize() -- Create an element with vh textSize local element = Gui.new({ id = "testElement", - w = 100, - h = 50, + width = 100, + height = 50, textSize = "3vh", -- 3% of viewport height - text = "Hello World" + text = "Hello World", }) - -- Check initial state + -- Check initial state (3% of 600px = 18px) luaunit.assertEquals(element.units.textSize.unit, "vh") - - -- Simulate a resize with larger viewport - local newWidth, newHeight = 800, 600 - element:resize(newWidth, newHeight) - - -- vh textSize should be recalculated - luaunit.assertEquals(element.textSize, 18) -- 3% of 600 height = 18 + luaunit.assertEquals(element.units.textSize.value, 3) + luaunit.assertEquals(element.textSize, 18.0) + + -- Simulate resize to larger viewport (3% of 1200px = 36px) + element:resize(1600, 1200) + luaunit.assertEquals(element.textSize, 36.0) + + -- Simulate resize to smaller viewport (3% of 300px = 9px) + element:resize(400, 300) + luaunit.assertEquals(element.textSize, 9.0) end -function BasicTextScalingTests.testNoTextSize() +function TestTextScaling.testNoTextSize() -- Create an element without textSize specified local element = Gui.new({ id = "testElement", - w = 100, - h = 50, - text = "Hello World" + width = 100, + height = 50, + text = "Hello World", }) -- Check initial state - should default to some value luaunit.assertEquals(element.units.textSize.value, nil) luaunit.assertEquals(element.textSize, 12) -- Default fallback + + -- Resize should not affect default textSize + element:resize(1600, 1200) + luaunit.assertEquals(element.textSize, 12) end -return BasicTextScalingTests \ No newline at end of file +-- Edge case tests +function TestTextScaling.testZeroPercentageTextSize() + -- Create an element with 0% textSize + local element = Gui.new({ + id = "testElement", + width = 100, + height = 50, + textSize = "0%", + text = "Hello World", + }) + + luaunit.assertEquals(element.textSize, 0.0) + + -- Should remain 0 after resize + element:resize(1600, 1200) + luaunit.assertEquals(element.textSize, 0.0) +end + +function TestTextScaling.testVerySmallTextSize() + -- Create an element with very small textSize + local element = Gui.new({ + id = "testElement", + width = 100, + height = 50, + textSize = "0.1vh", + text = "Hello World", + }) + + -- Check initial state (0.1% of 600px = 0.6px) + luaunit.assertEquals(element.textSize, 0.6) + + -- Should scale proportionally + element:resize(1600, 1200) + luaunit.assertEquals(element.textSize, 1.2) -- 0.1% of 1200px = 1.2px +end + +function TestTextScaling.testVeryLargeTextSize() + -- Create an element with very large textSize + local element = Gui.new({ + id = "testElement", + width = 100, + height = 50, + textSize = "50vh", + text = "Hello World", + }) + + -- Check initial state (50% of 600px = 300px) + luaunit.assertEquals(element.textSize, 300.0) + + -- Should scale proportionally + element:resize(1600, 1200) + luaunit.assertEquals(element.textSize, 600.0) -- 50% of 1200px = 600px +end + +function TestTextScaling.testDecimalUnits() + -- Create an element with decimal units + local element = Gui.new({ + id = "testElement", + width = 100, + height = 50, + textSize = "2.5vw", + text = "Hello World", + }) + + -- Check initial state (2.5% of 800px = 20px) + luaunit.assertEquals(element.textSize, 20.0) + + -- Should handle decimal precision + element:resize(1000, 800) + luaunit.assertEquals(element.textSize, 25.0) -- 2.5% of 1000px = 25px +end + +-- Multiple resize tests +function TestTextScaling.testMultipleResizes() + -- Create an element and perform multiple resize operations + local element = Gui.new({ + id = "testElement", + width = 100, + height = 50, + textSize = "4vh", + text = "Hello World", + }) + + -- Initial: 4% of 600px = 24px + luaunit.assertEquals(element.textSize, 24.0) + + -- First resize: 4% of 800px = 32px + element:resize(1000, 800) + luaunit.assertEquals(element.textSize, 32.0) + + -- Second resize: 4% of 400px = 16px + element:resize(500, 400) + luaunit.assertEquals(element.textSize, 16.0) + + -- Third resize: 4% of 1000px = 40px + element:resize(1200, 1000) + luaunit.assertEquals(element.textSize, 40.0) + + -- Return to original: 4% of 600px = 24px + element:resize(800, 600) + luaunit.assertEquals(element.textSize, 24.0) +end + +-- Mixed unit tests +function TestTextScaling.testMixedUnitsInDifferentElements() + -- Create multiple elements with different unit types + local elements = { + Gui.new({ id = "px", textSize = 20, text = "Fixed" }), + Gui.new({ id = "percent", textSize = "5%", text = "Percent" }), + Gui.new({ id = "vw", textSize = "3vw", text = "ViewWidth" }), + Gui.new({ id = "vh", textSize = "4vh", text = "ViewHeight" }), + } + + -- Check initial states + luaunit.assertEquals(elements[1].textSize, 20) -- Fixed + luaunit.assertEquals(elements[2].textSize, 30.0) -- 5% of 600px + luaunit.assertEquals(elements[3].textSize, 24.0) -- 3% of 800px + luaunit.assertEquals(elements[4].textSize, 24.0) -- 4% of 600px + + -- Resize all elements + for _, element in ipairs(elements) do + element:resize(1200, 900) + end + + -- Check after resize + luaunit.assertEquals(elements[1].textSize, 20) -- Fixed (unchanged) + luaunit.assertEquals(elements[2].textSize, 45.0) -- 5% of 900px + luaunit.assertEquals(elements[3].textSize, 36.0) -- 3% of 1200px + luaunit.assertEquals(elements[4].textSize, 36.0) -- 4% of 900px +end + +-- Test invalid units handling +function TestTextScaling.testInvalidUnits() + -- Test that invalid units are handled gracefully + local success, err = pcall(function() + local element = Gui.new({ + id = "testElement", + width = 100, + height = 50, + textSize = "5invalidunit", + text = "Hello World", + }) + end) + + -- Should handle invalid units gracefully (might error or default) + -- The exact behavior depends on implementation, but shouldn't crash + luaunit.assertTrue(success or string.find(tostring(err), "Unknown unit")) +end + +-- Performance test for many resizes +function TestTextScaling.testPerformanceWithManyResizes() + local element = Gui.new({ + id = "testElement", + width = 100, + height = 50, + textSize = "2vh", + text = "Hello World", + }) + + -- Perform many resize operations + local startTime = os.clock() + for i = 1, 100 do + local width = 800 + (i * 2) + local height = 600 + (i * 2) + element:resize(width, height) + + -- Verify the calculation is still correct + local expected = (2 / 100) * height + luaunit.assertEquals(element.textSize, expected) + end + local endTime = os.clock() + + -- Should complete in reasonable time (less than 1 second for 100 resizes) + local duration = endTime - startTime + luaunit.assertTrue(duration < 1.0, "Performance test took too long: " .. duration .. " seconds") +end + +-- Element-relative unit tests +function TestTextScaling.testElementWidthUnits() + -- Create an element with textSize relative to element width + local element = Gui.new({ + id = "testElement", + width = 200, + height = 100, + textSize = "10ew", -- 10% of element width + text = "Hello World", + }) + + -- Check initial state (10% of 200px = 20px) + luaunit.assertEquals(element.units.textSize.unit, "ew") + luaunit.assertEquals(element.units.textSize.value, 10) + luaunit.assertEquals(element.textSize, 20.0) + luaunit.assertEquals(element.width, 200) + + -- Change element width and recalculate + element.width = 300 + element:resize(800, 600) + luaunit.assertEquals(element.textSize, 30.0) -- 10% of 300px = 30px +end + +function TestTextScaling.testElementHeightUnits() + -- Create an element with textSize relative to element height + local element = Gui.new({ + id = "testElement", + width = 200, + height = 100, + textSize = "15eh", -- 15% of element height + text = "Hello World", + }) + + -- Check initial state (15% of 100px = 15px) + luaunit.assertEquals(element.units.textSize.unit, "eh") + luaunit.assertEquals(element.units.textSize.value, 15) + luaunit.assertEquals(element.textSize, 15.0) + luaunit.assertEquals(element.height, 100) + + -- Change element height and recalculate + element.height = 200 + element:resize(800, 600) + luaunit.assertEquals(element.textSize, 30.0) -- 15% of 200px = 30px +end + +function TestTextScaling.testElementRelativeWithViewportUnits() + -- Create an element with viewport-based size and element-relative textSize + local element = Gui.new({ + id = "testElement", + width = "25%", -- 25% of viewport width = 200px (800px * 0.25) + height = "20%", -- 20% of viewport height = 120px (600px * 0.20) + textSize = "8ew", -- 8% of element width + text = "Hello World", + }) + + -- Check initial state + luaunit.assertEquals(element.width, 200.0) -- 25% of 800px + luaunit.assertEquals(element.height, 120.0) -- 20% of 600px + luaunit.assertEquals(element.textSize, 16.0) -- 8% of 200px + + -- Resize viewport + element:resize(1600, 1200) + + -- Element size should update with viewport, textSize should update with element size + luaunit.assertEquals(element.width, 400.0) -- 25% of 1600px + luaunit.assertEquals(element.height, 240.0) -- 20% of 1200px + luaunit.assertEquals(element.textSize, 32.0) -- 8% of 400px +end + +-- Min/Max constraint tests +function TestTextScaling.testMinTextSizeConstraint() + -- Create element with textSize that would be smaller than minimum + local element = Gui.new({ + id = "testElement", + width = 200, + height = 100, + textSize = "2vh", -- 2% of 600px = 12px + minTextSize = 16, -- Minimum 16px + text = "Hello World", + }) + + -- Should be clamped to minimum + luaunit.assertEquals(element.textSize, 16) + + -- Test with very small viewport + element:resize(400, 300) -- 2% of 300px = 6px, should stay at 16px + luaunit.assertEquals(element.textSize, 16) +end + +function TestTextScaling.testMaxTextSizeConstraint() + -- Create element with textSize that would be larger than maximum + local element = Gui.new({ + id = "testElement", + width = 200, + height = 100, + textSize = "4vh", -- 4% of 600px = 24px + maxTextSize = 20, -- Maximum 20px + text = "Hello World", + }) + + -- Should be clamped to maximum + luaunit.assertEquals(element.textSize, 20) + + -- Test with very large viewport + element:resize(1600, 1200) -- 4% of 1200px = 48px, should stay at 20px + luaunit.assertEquals(element.textSize, 20) +end + +function TestTextScaling.testBothMinMaxConstraints() + -- Create element with both min and max constraints + local element = Gui.new({ + id = "testElement", + width = 200, + height = 100, + textSize = "3vh", -- 3% of 600px = 18px (within bounds) + minTextSize = 12, + maxTextSize = 24, + text = "Hello World", + }) + + -- Should be within bounds + luaunit.assertEquals(element.textSize, 18.0) + + -- Test small viewport (should hit min) + element:resize(400, 300) -- 3% of 300px = 9px, should be clamped to 12px + luaunit.assertEquals(element.textSize, 12) + + -- Test large viewport (should hit max) + element:resize(1600, 1200) -- 3% of 1200px = 36px, should be clamped to 24px + luaunit.assertEquals(element.textSize, 24) +end + +function TestTextScaling.testConstraintsWithElementUnits() + -- Test constraints with element-relative units + local element = Gui.new({ + id = "testElement", + width = 100, + height = 50, + textSize = "20ew", -- 20% of 100px = 20px + minTextSize = 8, + maxTextSize = 15, + text = "Hello World", + }) + + -- Should be clamped to maximum + luaunit.assertEquals(element.textSize, 15) + + -- Change width to trigger minimum + element.width = 30 -- 20% of 30px = 6px, should be clamped to 8px + element:resize(800, 600) + luaunit.assertEquals(element.textSize, 8) +end + +function TestTextScaling.testConstraintsWithFixedTextSize() + -- Test that constraints work with fixed pixel textSize too + local element = Gui.new({ + id = "testElement", + width = 200, + height = 100, + textSize = 25, -- Fixed 25px + minTextSize = 12, + maxTextSize = 20, + text = "Hello World", + }) + + -- Should be clamped to maximum even for fixed sizes + luaunit.assertEquals(element.textSize, 20) +end + +luaunit.LuaUnit.run() diff --git a/testing/__tests__/outline_example.lua b/testing/__tests__/outline_example.lua deleted file mode 100644 index b2fd6f0..0000000 --- a/testing/__tests__/outline_example.lua +++ /dev/null @@ -1,22 +0,0 @@ -package.path = package.path .. ";?.lua" - -local luaunit = require("testing/luaunit") -require("testing/loveStub") -- Required to mock LOVE functions -local FlexLove = require("FlexLove") -local Gui, enums = FlexLove.GUI, FlexLove.enums - -local FlexDirection = enums.FlexDirection -local Positioning = enums.Positioning -local JustifyContent = enums.JustifyContent -local AlignItems = enums.AlignItems - --- Create test cases -TestFlexDirection = {} - -function TestFlexDirection:testHorizontalFlexBasic() - local elem = Gui.new({ ... }) -- fill with props -end - -function TestFlexDirection:testHorizontalFlexWithJustifyContentFlexStart() end - -luaunit.LuaUnit.run() diff --git a/testing/runAll.lua b/testing/runAll.lua index 22a9855..0aa97af 100644 --- a/testing/runAll.lua +++ b/testing/runAll.lua @@ -15,6 +15,9 @@ local testFiles = { "testing/__tests__/09_layout_validation_tests.lua", "testing/__tests__/10_performance_tests.lua", "testing/__tests__/11_auxiliary_functions_tests.lua", + "testing/__tests__/12_units_system_tests.lua", + "testing/__tests__/13_relative_positioning_tests.lua", + "testing/__tests__/14_text_scaling_basic_tests.lua", } -- testingun all tests, but don't exit on error