Fixed more failing tests to match nested sets
This commit is contained in:
@@ -13,7 +13,8 @@ var testProperties = [
|
||||
clean({
|
||||
_id: 'slotId',
|
||||
type: 'propertySlot',
|
||||
ancestors: [{ id: 'charId' }],
|
||||
left: 1,
|
||||
right: 8,
|
||||
}),
|
||||
// Children
|
||||
clean({
|
||||
@@ -21,16 +22,22 @@ var testProperties = [
|
||||
type: 'folder',
|
||||
slotQuantityFilled: 3,
|
||||
slotFillerType: 'item',
|
||||
ancestors: [{ id: 'charId' }, { id: 'slotId' }],
|
||||
parentId: 'slotId',
|
||||
left: 2,
|
||||
right: 3,
|
||||
}),
|
||||
clean({
|
||||
_id: 'slotChildId',
|
||||
type: 'item',
|
||||
ancestors: [{ id: 'charId' }, { id: 'slotId' }],
|
||||
parentId: 'slotId',
|
||||
left: 4,
|
||||
right: 7,
|
||||
}),
|
||||
clean({
|
||||
_id: 'slotGrandchildId',
|
||||
type: 'effect',
|
||||
ancestors: [{ id: 'charId' }, { id: 'slotId' }, { id: 'slotChildId' }],
|
||||
parentId: 'slotChildId',
|
||||
left: 5,
|
||||
right: 6,
|
||||
}),
|
||||
];
|
||||
|
||||
@@ -2,7 +2,7 @@ import { buildComputationFromProps } from '/imports/api/engine/computation/build
|
||||
import { assert } from 'chai';
|
||||
import clean from '../../utility/cleanProp.testFn.js';
|
||||
|
||||
export default function(){
|
||||
export default function () {
|
||||
const computation = buildComputationFromProps(testProperties);
|
||||
const hasLink = computation.dependencyGraph.hasLink;
|
||||
const prop = (id) => computation.propsById[id];
|
||||
@@ -32,7 +32,8 @@ var testProperties = [
|
||||
clean({
|
||||
_id: 'spellListId',
|
||||
type: 'spellList',
|
||||
ancestors: [{id: 'charId'}],
|
||||
left: 1,
|
||||
right: 6,
|
||||
}),
|
||||
clean({
|
||||
_id: 'childId',
|
||||
@@ -40,7 +41,9 @@ var testProperties = [
|
||||
description: {
|
||||
text: 'DC {#spellList.dc} save or suck'
|
||||
},
|
||||
ancestors: [{id: 'charId'}, {id: 'spellListId'}],
|
||||
parentId: 'spellListId',
|
||||
left: 2,
|
||||
right: 5,
|
||||
}),
|
||||
clean({
|
||||
_id: 'grandchildId',
|
||||
@@ -48,7 +51,9 @@ var testProperties = [
|
||||
dc: {
|
||||
calculation: '#spellList.dc + strength + wisdom.modifier'
|
||||
},
|
||||
ancestors: [{id: 'charId'}, {id: 'spellListId'}, {id: 'childId'}],
|
||||
parentId: 'childId',
|
||||
left: 3,
|
||||
right: 4,
|
||||
}),
|
||||
clean({
|
||||
_id: 'strengthId',
|
||||
@@ -57,6 +62,7 @@ var testProperties = [
|
||||
baseValue: {
|
||||
calculation: '15 + ',
|
||||
},
|
||||
ancestors: [{id: 'charId'}],
|
||||
left: 7,
|
||||
right: 8,
|
||||
}),
|
||||
];
|
||||
|
||||
@@ -1,8 +1,9 @@
|
||||
import { buildComputationFromProps } from '/imports/api/engine/computation/buildCreatureComputation.js';
|
||||
import { assert } from 'chai';
|
||||
import clean from '../../utility/cleanProp.testFn.js';
|
||||
import { applyNestedSetProperties } from '/imports/api/parenting/parentingFunctions';
|
||||
|
||||
export default function(){
|
||||
export default function () {
|
||||
const computation = buildComputationFromProps(testProperties);
|
||||
const hasLink = computation.dependencyGraph.hasLink;
|
||||
|
||||
@@ -62,28 +63,28 @@ var testProperties = [
|
||||
type: 'item',
|
||||
equipped: true,
|
||||
attuned: true,
|
||||
ancestors: [{id: 'charId'}],
|
||||
}),
|
||||
clean({
|
||||
_id: 'containerId',
|
||||
type: 'container',
|
||||
carried: true,
|
||||
ancestors: [{id: 'charId'}],
|
||||
}),
|
||||
clean({
|
||||
_id: 'childContainerId',
|
||||
type: 'container',
|
||||
carried: true,
|
||||
ancestors: [{id: 'charId'}, {id: 'containerId'}],
|
||||
}),
|
||||
clean({
|
||||
_id: 'childItemId',
|
||||
type: 'item',
|
||||
ancestors: [{id: 'charId'}, {id: 'containerId'}],
|
||||
parentId: 'containerId',
|
||||
}),
|
||||
clean({
|
||||
_id: 'grandchildItemId',
|
||||
type: 'item',
|
||||
ancestors: [{id: 'charId'}, {id: 'containerId'}, {id: 'childContainerId'}],
|
||||
parentId: 'childContainerId',
|
||||
}),
|
||||
clean({
|
||||
_id: 'childItemId',
|
||||
type: 'item',
|
||||
parentId: 'containerId',
|
||||
}),
|
||||
];
|
||||
|
||||
applyNestedSetProperties(testProperties);
|
||||
|
||||
Reference in New Issue
Block a user