element refactor - will return to this

This commit is contained in:
Michael Freno
2025-11-19 16:14:35 -05:00
parent e778815c5e
commit 21a4a29cf1
3 changed files with 244 additions and 233 deletions

View File

@@ -1238,12 +1238,15 @@ function TestElementUnhappyPaths:tearDown()
end
-- Test: Element with missing deps parameter
function TestElementUnhappyPaths:test_element_without_deps()
function TestElementUnhappyPaths:test_element_with_init()
-- Test that Element.new() works after FlexLove.init() is called
-- Element now uses module-level dependencies initialized via Element.init()
FlexLove.init() -- Ensure FlexLove is initialized
local Element = require("modules.Element")
local success = pcall(function()
Element.new({}, nil)
Element.new({})
end)
luaunit.assertFalse(success) -- Should error without deps
luaunit.assertTrue(success) -- Should work after Element.init() is called by FlexLove
end
-- Test: Element with negative dimensions