Tested and fixed inventory computation

This commit is contained in:
Stefan Zermatten
2021-09-23 12:41:03 +02:00
parent e63dd2560a
commit 734df59fd1
6 changed files with 110 additions and 6 deletions

View File

@@ -5,7 +5,7 @@ import clean from '../../utility/cleanProp.testFn.js';
export default function(){
const computation = buildComputationFromProps(testProperties);
const hasLink = computation.dependencyGraph.hasLink;
assert.isTrue(
!!hasLink('weightEquipment', 'equippedAttunedItemId'),
'weight of equipment depends on equipped items'
@@ -46,6 +46,14 @@ export default function(){
!!hasLink('valueCarried', 'childContainerId'),
'valueCarried does not depend on nested containers'
);
assert.isTrue(
!!hasLink('containerId', 'childContainerId'),
'containers depend on their child containers'
);
assert.isTrue(
!!hasLink('childContainerId', 'grandchildItemId'),
'containers depend on their child items'
);
}
var testProperties = [