Ticket #4385: aiinfluence_guiinterface_tests_v2.patch

File aiinfluence_guiinterface_tests_v2.patch, 1.4 KB (added by elexis, 7 years ago)
  • binaries/data/mods/public/simulation/components/tests/test_GuiInterface.js

    Resources = {  
    4040        "food": "Food",
    4141        "metal": "Metal",
    4242        "stone": "Stone",
    4343        "wood": "Wood"
    4444    }),
    45     "GetResource": () => ({}),
     45    "GetResource": resource => ({
     46        "aiAnalysisInfluenceGroup":
     47            resource == "food" ? "ignore" :
     48            resource == "wood" ? "abundant" : "sparse"
     49    }),
    4650};
    4751
    4852var cmp = ConstructComponent(SYSTEM_ENTITY, "GuiInterface");
    4953
    5054
    TS_ASSERT_UNEVAL_EQUALS(cmp.GetSimulatio  
    355359            "metal": "Metal",
    356360            "stone": "Stone",
    357361            "wood": "Wood",
    358362        },
    359363        "aiInfluenceGroups": {
    360             "food": 0,
    361             "metal": 0,
    362             "stone": 0,
    363             "wood": 0,
     364            "food": "ignore",
     365            "metal": "sparse",
     366            "stone": "sparse",
     367            "wood": "abundant",
    364368        }
    365369    },
    366370});
    367371
    368372TS_ASSERT_UNEVAL_EQUALS(cmp.GetExtendedSimulationState(), {
    TS_ASSERT_UNEVAL_EQUALS(cmp.GetExtendedS  
    493497            "metal": "Metal",
    494498            "stone": "Stone",
    495499            "wood": "Wood",
    496500        },
    497501        "aiInfluenceGroups": {
    498             "food": 0,
    499             "metal": 0,
    500             "stone": 0,
    501             "wood": 0,
     502            "food": "ignore",
     503            "metal": "sparse",
     504            "stone": "sparse",
     505            "wood": "abundant",
    502506        }
    503507    },
    504508});
    505509
    506510