forked from PathOfBuildingCommunity/PathOfBuilding-PoE2
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTestBirthedReservation_spec.lua
More file actions
58 lines (50 loc) · 2.16 KB
/
Copy pathTestBirthedReservation_spec.lua
File metadata and controls
58 lines (50 loc) · 2.16 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
describe("TestBirthedReservation", function()
before_each(function()
newBuild()
build.configTab.input.customMods = "+1000 to Spirit"
build.configTab:BuildModList()
end)
local function grantAmulet(baseName, skillLine)
build.itemsTab:CreateDisplayItemFromRaw("New Item\n"..baseName.."\nImplicits: 1\nGrants Skill: "..skillLine.."\n")
build.itemsTab:AddDisplayItem()
end
it("Absent Amulet grants a reservation-free skill", function()
grantAmulet("Absent Amulet", "Level 20 Archmage")
runCallback("OnFrame")
assert.are.equals(0, build.calcsTab.mainOutput.SpiritReserved)
end)
it("other Birthed amulets also grant reservation-free skills", function()
grantAmulet("Lament Amulet", "Level 20 Arctic Armour")
runCallback("OnFrame")
assert.are.equals(0, build.calcsTab.mainOutput.SpiritReserved)
newBuild()
build.configTab.input.customMods = "+1000 to Spirit"
build.configTab:BuildModList()
grantAmulet("Portent Amulet", "Level 20 Wolf Pack")
runCallback("OnFrame")
assert.are.equals(0, build.calcsTab.mainOutput.SpiritReserved)
end)
it("support gems added to a birthed-granted skill still reserve", function()
grantAmulet("Absent Amulet", "Level 20 Archmage")
build.skillsTab:PasteSocketGroup("Slot: Amulet\nClarity I 1/0 1\n")
runCallback("OnFrame")
assert.are.equals(10, build.calcsTab.mainOutput.SpiritReserved)
end)
it("support reservation conversions still apply", function()
grantAmulet("Absent Amulet", "Level 20 Archmage")
build.skillsTab:PasteSocketGroup("Slot: Amulet\nClarity I 1/0 1\nAtziri's Communion 1/0 1\n")
runCallback("OnFrame")
assert.is_true(build.calcsTab.mainOutput.LifeReservedPercent > 0)
assert.are.equals(0, build.calcsTab.mainOutput.SpiritReserved)
end)
it("a non-birthed item granting the same skill still reserves normally", function()
grantAmulet("Lapis Amulet", "Level 20 Archmage")
runCallback("OnFrame")
assert.are.equals(100, build.calcsTab.mainOutput.SpiritReserved)
end)
it("a socketed copy of the skill still reserves normally", function()
build.skillsTab:PasteSocketGroup("Archmage 20/0 1\n")
runCallback("OnFrame")
assert.are.equals(100, build.calcsTab.mainOutput.SpiritReserved)
end)
end)