Changeset View
Changeset View
Standalone View
Standalone View
binaries/data/mods/public/globalscripts/tests/test_statusEffects.js
Show All 10 Lines | let statusEffects = { | ||||
} | } | ||||
}; | }; | ||||
Engine.ListDirectoryFiles = () => Object.keys(statusEffects); | Engine.ListDirectoryFiles = () => Object.keys(statusEffects); | ||||
Engine.ReadJSONFile = (file) => statusEffects[file]; | Engine.ReadJSONFile = (file) => statusEffects[file]; | ||||
let sem = new StatusEffectsMetadata(); | let sem = new StatusEffectsMetadata(); | ||||
// Template data takes precedence over generic data. | TS_ASSERT_UNEVAL_EQUALS(sem.getData("test_a"), { | ||||
TS_ASSERT_UNEVAL_EQUALS(sem.augment("test_a"), { | |||||
"code": "test_a", "StatusName": "A", "StatusTooltip": "TTA" | "code": "test_a", "StatusName": "A", "StatusTooltip": "TTA" | ||||
}); | }); | ||||
TS_ASSERT_UNEVAL_EQUALS(sem.augment("test_b"), { | TS_ASSERT_UNEVAL_EQUALS(sem.getData("test_b"), { | ||||
"code": "test_b", "StatusName": "B", "StatusTooltip": "TTB" | "code": "test_b", "StatusName": "B", "StatusTooltip": "TTB" | ||||
}); | }); | ||||
TS_ASSERT_UNEVAL_EQUALS(sem.augment("test_a", { "StatusName": "test" }), { | |||||
"code": "test_a", "StatusName": "test", "StatusTooltip": "TTA" | |||||
}); | |||||
TS_ASSERT_UNEVAL_EQUALS(sem.augment("test_c", { "StatusName": "test" }), { | |||||
"StatusName": "test" | |||||
}); |
Wildfire Games · Phabricator