@@ -585,4 +585,74 @@ describe("TetsItemMods", function()
585585 assert .are_not .equals (baseColdAvg , round (build .calcsTab .mainOutput .ColdStoredCombinedAvg ))
586586 assert .equals (0 , round (build .calcsTab .mainOutput .FireStoredCombinedAvg ))
587587 end )
588+
589+ it (" Timeless jewels grant conquered attribute passive bonuses" , function ()
590+ local calcs = build .calcsTab .calcs
591+ local jewelSocketNodeId = 999
592+ local attributeNode = {
593+ id = 1 ,
594+ type = " Normal" ,
595+ isAttribute = true ,
596+ allocMode = 0 ,
597+ modList = new (" ModList" ),
598+ }
599+ local smallNode = {
600+ id = 2 ,
601+ type = " Normal" ,
602+ allocMode = 0 ,
603+ modList = new (" ModList" ),
604+ }
605+ local envMode = " SPEC_TIMELESS_ATTRIBUTE"
606+ GlobalCache .cachedData [envMode ] = { }
607+ local env = {
608+ mode = envMode ,
609+ radiusJewelList = { },
610+ allocNodes = { },
611+ build = {
612+ itemsTab = {
613+ activeItemSet = {
614+ useSecondWeaponSet = false ,
615+ },
616+ },
617+ spec = {
618+ nodes = {
619+ [jewelSocketNodeId ] = {
620+ allocMode = 0 ,
621+ },
622+ },
623+ },
624+ },
625+ }
626+ table.insert (env .radiusJewelList , {
627+ type = " Other" ,
628+ nodes = {
629+ [attributeNode .id ] = { type = " Normal" },
630+ [smallNode .id ] = { type = " Normal" },
631+ },
632+ item = {
633+ baseName = " Timeless Jewel" ,
634+ },
635+ nodeId = jewelSocketNodeId ,
636+ jewelHash = " undying-hate-spec" ,
637+ data = {
638+ modSource = " Tree:" .. jewelSocketNodeId ,
639+ },
640+ func = function (node , out , data )
641+ if node and node .type == " Normal" and node .isAttribute then
642+ out :NewMod (" Str" , " BASE" , 7 , data .modSource )
643+ elseif node and node .type == " Normal" and not node .isAttribute then
644+ out :NewMod (" Dex" , " BASE" , 11 , data .modSource )
645+ end
646+ end ,
647+ })
648+
649+ local attributeModList = calcs .buildModListForNode (env , attributeNode , 0 , false )
650+ local smallModList = calcs .buildModListForNode (env , smallNode , 0 , false )
651+ GlobalCache .cachedData [envMode ] = nil
652+
653+ assert .are .equals (7 , attributeModList :Sum (" BASE" , nil , " Str" ))
654+ assert .are .equals (0 , attributeModList :Sum (" BASE" , nil , " Dex" ))
655+ assert .are .equals (0 , smallModList :Sum (" BASE" , nil , " Str" ))
656+ assert .are .equals (11 , smallModList :Sum (" BASE" , nil , " Dex" ))
657+ end )
588658end )
0 commit comments