Skip to content
Open
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
16 changes: 16 additions & 0 deletions spec/System/TestCompareTab_spec.lua
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,20 @@ describe("CompareTab", function()
assert.is_false(control:IsShown())
end
end)
it("reproduces matching-socket gem quality when comparing a build with itself", function()
newBuild()
build.itemsTab:CreateDisplayItemFromRaw(
"Rarity: RARE\nTest Subject\nSage's Robe\nQuality: 0\nSockets: B-B-B\nImplicits: 0\n")
build.itemsTab:AddDisplayItem()
build.skillsTab:PasteSocketGroup("Slot: Body Armour\nFireball 20/0 1\n")
runCallback("OnFrame")
assert.are.equals(10, build.calcsTab.mainOutput.GemQuality)

-- doesn't actually save to a file, just encodes as xml
local entry = new("CompareEntry"):CompareEntry(build:SaveDB("code"), "Self")

assert.is_true(entry.skillsTab.socketGroupList[1].gemList[1].matchesSocket)
assert.are.equals(build.calcsTab.mainOutput.GemQuality, entry.calcsTab.mainOutput.GemQuality)
assert.are.equals(build.calcsTab.mainOutput.CombinedDPS, entry.calcsTab.mainOutput.CombinedDPS)
end)
end)
3 changes: 3 additions & 0 deletions src/Classes/CompareEntry.lua
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,8 @@ function CompareEntryClass:LoadFromXML(xmlText)
end

self:SyncCalcsSkillSelection()
-- reprocess socket groups as they might depend on items which don't necessarily load first.
self.skillsTab:UpdateSocketGroups()
wipeGlobalCache()
self.calcsTab:BuildOutput()
self.buildFlag = false
Expand Down Expand Up @@ -248,6 +250,7 @@ end
function CompareEntryClass:Rebuild()
wipeGlobalCache()
self.outputRevision = self.outputRevision + 1
self.skillsTab:UpdateSocketGroups()
self.calcsTab:BuildOutput()
self.buildFlag = false
end
Expand Down
Loading