Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 38 additions & 0 deletions spec/System/TestPowerReport_spec.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
describe("PowerReportListControl", function()
local PowerReportListControl

before_each(function()
LoadModule("Classes/PowerReportListControl")
PowerReportListControl = common.classes.PowerReportListControl
end)

local function relist(originalList, showClusters, allocated)
local control = {
originalList = originalList,
showClusters = showClusters or false,
allocated = allocated or false,
}
PowerReportListControl.ReList(control)
return control.list
end

it("Show Unallocated excludes allocated nodes", function()
local list = relist({
{ name = "allocated", power = 10, pathDist = 1, allocated = true },
{ name = "unallocated", power = 5, pathDist = 1, allocated = false },
}, false, false)

assert.are.equal(1, #list)
assert.are.equal("unallocated", list[1].name)
end)

it("Show Allocated includes allocated nodes", function()
local list = relist({
{ name = "allocated", power = 10, pathDist = 1, allocated = true },
{ name = "unallocated", power = 5, pathDist = 1, allocated = false },
}, false, true)

assert.are.equal(1, #list)
assert.are.equal("allocated", list[1].name)
end)
end)
Loading
Loading