mirror of
https://github.com/google/blockly.git
synced 2026-01-08 01:20:12 +01:00
Added shadow unplug tests.
This commit is contained in:
@@ -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);
|
||||
});
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user