Added shadow unplug tests.

This commit is contained in:
Beka Westberg
2019-08-02 10:14:42 -07:00
parent b28788fad6
commit 995a2658fe

View File

@@ -104,21 +104,21 @@ suite('Blocks', function() {
blocks.B.unplug(true);
assertUnpluggedNoheal(blocks);
});
test('Parent has multiple inputs', function() {
test('A has multiple inputs', function() {
var blocks = this.blocks;
// Add extra input to parent
blocks.A.appendValueInput("INPUT").setCheck(null);
blocks.B.unplug(true);
assertUnpluggedHealed(blocks);
});
test('Middle block has multiple inputs', function() {
test('B has multiple inputs', function() {
var blocks = this.blocks;
// Add extra input to middle block
blocks.B.appendValueInput("INPUT").setCheck(null);
blocks.B.unplug(true);
assertUnpluggedHealed(blocks);
});
test('Child block has multiple inputs', function() {
test('C has multiple inputs', function() {
var blocks = this.blocks;
// Add extra input to child block
blocks.C.appendValueInput("INPUT").setCheck(null);
@@ -126,6 +126,14 @@ suite('Blocks', function() {
blocks.B.unplug(true);
assertUnpluggedHealed(blocks);
});
test('C is Shadow', function() {
var blocks = this.blocks;
blocks.C.setShadow(true);
blocks.B.unplug(true);
// Even though we're asking to heal, it will appear as if it has not
// healed because shadows always stay with the parent.
assertUnpluggedNoheal(blocks);
});
});
suite('Stack', function() {
setup(function() {
@@ -177,6 +185,14 @@ suite('Blocks', function() {
// C is the top of its stack.
assertNull(blocks.C.getParent());
});
test('C is Shadow', function() {
var blocks = this.blocks;
blocks.C.setShadow(true);
blocks.B.unplug(true);
// Even though we're asking to heal, it will appear as if it has not
// healed because shadows always stay with the parent.
assertUnpluggedNoheal(blocks);
});
});
});
});