mirror of
https://github.com/Insality/druid
synced 2025-06-27 02:17:52 +02:00
Late scripts require in tests
This commit is contained in:
parent
3219b280e7
commit
2d8d3cffbb
@ -3,8 +3,8 @@ local deftest = require("deftest.deftest")
|
||||
local tests = {
|
||||
-- Test list
|
||||
require("test.tests.test_button"),
|
||||
--require("test.tests.test_hover"),
|
||||
--require("test.tests.test_drag"),
|
||||
require("test.tests.test_hover"),
|
||||
require("test.tests.test_drag"),
|
||||
require("test.tests.test_back_handler"),
|
||||
require("test.tests.test_blocker"),
|
||||
--require("test.tests.test_static_grid"),
|
||||
|
@ -7,6 +7,7 @@ return function()
|
||||
|
||||
local druid = nil
|
||||
local context = nil
|
||||
|
||||
describe("Back Handler component", function()
|
||||
before(function()
|
||||
mock_gui = require("deftest.mock.gui")
|
||||
@ -18,6 +19,7 @@ return function()
|
||||
mock_gui.mock()
|
||||
mock_time.mock()
|
||||
mock_time.set(60)
|
||||
|
||||
context = test_helper.get_context()
|
||||
druid = druid_system.new(context)
|
||||
end)
|
||||
|
@ -7,6 +7,7 @@ return function()
|
||||
|
||||
local druid = nil
|
||||
local context = nil
|
||||
|
||||
describe("Blocker component", function()
|
||||
before(function()
|
||||
mock_gui = require("deftest.mock.gui")
|
||||
@ -18,6 +19,7 @@ return function()
|
||||
mock_gui.mock()
|
||||
mock_time.mock()
|
||||
mock_time.set(60)
|
||||
|
||||
context = test_helper.get_context()
|
||||
druid = druid_system.new(context)
|
||||
end)
|
||||
|
@ -7,6 +7,7 @@ return function()
|
||||
|
||||
local druid = nil
|
||||
local context = nil
|
||||
|
||||
describe("Button Component", function()
|
||||
before(function()
|
||||
mock_gui = require("deftest.mock.gui")
|
||||
@ -18,6 +19,7 @@ return function()
|
||||
mock_gui.mock()
|
||||
mock_time.mock()
|
||||
mock_time.set(60)
|
||||
|
||||
context = test_helper.get_context()
|
||||
druid = druid_system.new(context)
|
||||
end)
|
||||
|
@ -1,12 +1,12 @@
|
||||
return function()
|
||||
local mock_gui = require "deftest.mock.gui"
|
||||
local mock_time = require("deftest.mock.time")
|
||||
local mock_input = require("test.helper.mock_input")
|
||||
local test_helper = require("test.helper.test_helper")
|
||||
local druid_system = require("druid.druid")
|
||||
local mock_gui = nil
|
||||
local mock_time = nil
|
||||
local mock_input = nil
|
||||
local test_helper = nil
|
||||
local druid_system = nil
|
||||
|
||||
local druid = nil
|
||||
local context = test_helper.get_context()
|
||||
local context = nil
|
||||
|
||||
local function create_drag_instance(on_drag)
|
||||
local button = mock_gui.add_box("button", 0, 0, 20, 20)
|
||||
@ -18,9 +18,17 @@ return function()
|
||||
|
||||
describe("Drag component", function()
|
||||
before(function()
|
||||
mock_gui = require("deftest.mock.gui")
|
||||
mock_time = require("deftest.mock.time")
|
||||
mock_input = require("test.helper.mock_input")
|
||||
test_helper = require("test.helper.test_helper")
|
||||
druid_system = require("druid.druid")
|
||||
|
||||
mock_gui.mock()
|
||||
mock_time.mock()
|
||||
mock_time.set(60)
|
||||
|
||||
context = test_helper.get_context()
|
||||
druid = druid_system.new(context)
|
||||
end)
|
||||
|
||||
|
@ -1,17 +1,26 @@
|
||||
return function()
|
||||
local mock_gui = require "deftest.mock.gui"
|
||||
local mock_time = require("deftest.mock.time")
|
||||
local mock_input = require("test.helper.mock_input")
|
||||
local test_helper = require("test.helper.test_helper")
|
||||
local druid_system = require("druid.druid")
|
||||
local mock_gui = nil
|
||||
local mock_time = nil
|
||||
local mock_input = nil
|
||||
local test_helper = nil
|
||||
local druid_system = nil
|
||||
|
||||
local druid = nil
|
||||
local context = test_helper.get_context()
|
||||
local context = nil
|
||||
|
||||
describe("Hover component", function()
|
||||
before(function()
|
||||
mock_gui = require("deftest.mock.gui")
|
||||
mock_time = require("deftest.mock.time")
|
||||
mock_input = require("test.helper.mock_input")
|
||||
test_helper = require("test.helper.test_helper")
|
||||
druid_system = require("druid.druid")
|
||||
|
||||
mock_gui.mock()
|
||||
mock_time.mock()
|
||||
mock_time.set(60)
|
||||
|
||||
context = test_helper.get_context()
|
||||
druid = druid_system.new(context)
|
||||
end)
|
||||
|
||||
|
@ -1,12 +1,13 @@
|
||||
return function()
|
||||
local mock_gui = require "deftest.mock.gui"
|
||||
local mock_time = require("deftest.mock.time")
|
||||
local mock_input = require("test.helper.mock_input")
|
||||
local test_helper = require("test.helper.test_helper")
|
||||
local druid_system = require("druid.druid")
|
||||
local mock_gui = nil
|
||||
local mock_time = nil
|
||||
local mock_input = nil
|
||||
local test_helper = nil
|
||||
local druid_system = nil
|
||||
|
||||
local druid = nil
|
||||
local context = test_helper.get_context()
|
||||
local context = nil
|
||||
|
||||
describe("Static Grid component", function()
|
||||
local parent = nil
|
||||
---@type druid.static_grid
|
||||
@ -14,9 +15,17 @@ return function()
|
||||
local prefab = nil
|
||||
|
||||
before(function()
|
||||
mock_gui = require("deftest.mock.gui")
|
||||
mock_time = require("deftest.mock.time")
|
||||
mock_input = require("test.helper.mock_input")
|
||||
test_helper = require("test.helper.test_helper")
|
||||
druid_system = require("druid.druid")
|
||||
|
||||
mock_gui.mock()
|
||||
mock_time.mock()
|
||||
mock_time.set(60)
|
||||
|
||||
context = test_helper.get_context()
|
||||
druid = druid_system.new(context)
|
||||
|
||||
parent = mock_gui.add_box("parent", 0, 0, 50, 50)
|
||||
|
@ -1,17 +1,26 @@
|
||||
return function()
|
||||
local mock_gui = require "deftest.mock.gui"
|
||||
local mock_time = require("deftest.mock.time")
|
||||
local mock_input = require("test.helper.mock_input")
|
||||
local test_helper = require("test.helper.test_helper")
|
||||
local druid_system = require("druid.druid")
|
||||
local mock_gui = nil
|
||||
local mock_time = nil
|
||||
local mock_input = nil
|
||||
local test_helper = nil
|
||||
local druid_system = nil
|
||||
|
||||
local druid = nil
|
||||
local context = test_helper.get_context()
|
||||
local context = nil
|
||||
|
||||
describe("Template component", function()
|
||||
before(function()
|
||||
mock_gui = require("deftest.mock.gui")
|
||||
mock_time = require("deftest.mock.time")
|
||||
mock_input = require("test.helper.mock_input")
|
||||
test_helper = require("test.helper.test_helper")
|
||||
druid_system = require("druid.druid")
|
||||
|
||||
mock_gui.mock()
|
||||
mock_time.mock()
|
||||
mock_time.set(60)
|
||||
|
||||
context = test_helper.get_context()
|
||||
druid = druid_system.new(context)
|
||||
end)
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user