@@ -70,6 +70,38 @@ describe("TestImport", function()
7070 isEquipped (4 , " Fulgent Bliss, Small Cluster Jewel" )
7171 end )
7272
73+ it (" imports modifier flags from the 3.29 item API" , function ()
74+ build .importTab :ImportItem ({
75+ id = " test-item-mod-flags" ,
76+ frameType = 2 ,
77+ name = " Test Grip" ,
78+ typeLine = " Rawhide Gloves" ,
79+ inventoryId = " Gloves" ,
80+ ilvl = 10 ,
81+ properties = { },
82+ implicitMods = {
83+ { description = " +20 to maximum Life" },
84+ },
85+ explicitMods = {
86+ { description = " +10 to maximum Life" , flags = { crafted = true } },
87+ { description = " +11 to maximum Mana" , flags = { fractured = true } },
88+ { description = " +12 to Strength" , flags = { mutated = true } },
89+ },
90+ })
91+
92+ local itemId = build .itemsTab .slots .Gloves .selItemId
93+ local item = build .itemsTab .items [itemId ]
94+ local explicitMods = { }
95+ for _ , modLine in ipairs (item .explicitModLines ) do
96+ explicitMods [modLine .line ] = modLine
97+ end
98+
99+ assert .are .equal (" +20 to maximum Life" , item .implicitModLines [1 ].line )
100+ assert .is_true (explicitMods [" +10 to maximum Life" ].crafted )
101+ assert .is_true (explicitMods [" +11 to maximum Mana" ].fractured )
102+ assert .is_true (explicitMods [" +12 to Strength" ].mutated )
103+ end )
104+
73105 function importAndReimportWithOldJewel (shouldDelete )
74106 local oldJewel = new (" Item" , [[ Rarity: RARE
75107TEST JEWEL
@@ -124,4 +156,4 @@ Implicits: 0]])
124156 end
125157 assert .truthy (found )
126158 end )
127- end )
159+ end )
0 commit comments