diff --git a/spec/System/TestItemsTab_spec.lua b/spec/System/TestItemsTab_spec.lua index fda210ce6e..9426e6aa6c 100644 --- a/spec/System/TestItemsTab_spec.lua +++ b/spec/System/TestItemsTab_spec.lua @@ -650,6 +650,33 @@ describe("TestItemsTab", function() assert.is_true(foundMaximumRage) end) + it("refreshes affix controls when an augment changes affix limits", function () + build.itemsTab:CreateDisplayItemFromRaw([[ + Rarity: RARE + New + Stocky Mitts + Crafted: true + Sockets: S + ]], true) + + local runeControl = build.itemsTab.controls.displayItemRune1 + local serlesIndex + for index, rune in ipairs(runeControl.list) do + if rune.name == "Serle's Triumph" then + serlesIndex = index + break + end + end + assert.is_not_nil(serlesIndex) + runeControl:SetSel(serlesIndex) + + local affixControl = build.itemsTab.controls.displayItemAffix7 + assert.are.equals(7, build.itemsTab.displayItem.affixLimit) + assert.are.equals("suffixes", affixControl.outputTable) + assert.are.equals("None", affixControl.list[1]) + affixControl.tooltipFunc({ Clear = function() end }, "BODY", affixControl.selIndex, affixControl.list[affixControl.selIndex]) + end) + it("keeps Darkness Enthroned's socket editor available at zero sockets", function () build.itemsTab:CreateDisplayItemFromRaw([[ Item Class: Belts diff --git a/src/Classes/ItemsTab.lua b/src/Classes/ItemsTab.lua index 797acf629c..fa94549480 100644 --- a/src/Classes/ItemsTab.lua +++ b/src/Classes/ItemsTab.lua @@ -700,6 +700,9 @@ holding Shift will put it in the second.]]) self.displayItem.runes[i] = value.name self.displayItem:UpdateRunes() self.displayItem:BuildAndParseRaw() + if self.displayItem.crafted then + self:UpdateAffixControls() + end self:UpdateDisplayItemTooltip() end) drop.y = function() @@ -808,7 +811,7 @@ holding Shift will put it in the second.]]) return i == 1 and 0 or 24 + (prev.slider:IsShown() and 18 or 0) end drop.tooltipFunc = function(tooltip, mode, index, value) - local modList = value.modList + local modList = value and value.modList if not modList or main.popups[1] or mode == "OUT" or (self.selControl and self.selControl ~= drop) then tooltip:Clear() elseif tooltip:CheckForUpdate(modList) then