mirror of
https://github.com/google/blockly.git
synced 2026-01-09 01:50:11 +01:00
Add missing whitespace to test files (#5031)
* Add missing spaces * undo incorrect replaces in utils tests
This commit is contained in:
@@ -1289,8 +1289,8 @@ suite('Blocks', function() {
|
||||
});
|
||||
suite('Connecting and Disconnecting', function() {
|
||||
test('Connect Block to Next', function() {
|
||||
var blockA = createRenderedBlock(this.workspace,'stack_block');
|
||||
var blockB = createRenderedBlock(this.workspace,'stack_block');
|
||||
var blockA = createRenderedBlock(this.workspace, 'stack_block');
|
||||
var blockB = createRenderedBlock(this.workspace, 'stack_block');
|
||||
|
||||
blockA.setCollapsed(true);
|
||||
assertCollapsed(blockA);
|
||||
@@ -1298,8 +1298,8 @@ suite('Blocks', function() {
|
||||
assertNotCollapsed(blockB);
|
||||
});
|
||||
test('Connect Block to Value Input', function() {
|
||||
var blockA = createRenderedBlock(this.workspace,'row_block');
|
||||
var blockB = createRenderedBlock(this.workspace,'row_block');
|
||||
var blockA = createRenderedBlock(this.workspace, 'row_block');
|
||||
var blockB = createRenderedBlock(this.workspace, 'row_block');
|
||||
|
||||
blockA.setCollapsed(true);
|
||||
assertCollapsed(blockA);
|
||||
@@ -1310,8 +1310,8 @@ suite('Blocks', function() {
|
||||
chai.assert.isFalse(isBlockHidden(blockB));
|
||||
});
|
||||
test('Connect Block to Statement Input', function() {
|
||||
var blockA = createRenderedBlock(this.workspace,'statement_block');
|
||||
var blockB = createRenderedBlock(this.workspace,'stack_block');
|
||||
var blockA = createRenderedBlock(this.workspace, 'statement_block');
|
||||
var blockB = createRenderedBlock(this.workspace, 'stack_block');
|
||||
|
||||
blockA.setCollapsed(true);
|
||||
assertCollapsed(blockA);
|
||||
@@ -1323,9 +1323,9 @@ suite('Blocks', function() {
|
||||
chai.assert.isFalse(isBlockHidden(blockB));
|
||||
});
|
||||
test('Connect Block to Child of Collapsed - Input', function() {
|
||||
var blockA = createRenderedBlock(this.workspace,'row_block');
|
||||
var blockB = createRenderedBlock(this.workspace,'row_block');
|
||||
var blockC = createRenderedBlock(this.workspace,'row_block');
|
||||
var blockA = createRenderedBlock(this.workspace, 'row_block');
|
||||
var blockB = createRenderedBlock(this.workspace, 'row_block');
|
||||
var blockC = createRenderedBlock(this.workspace, 'row_block');
|
||||
|
||||
blockA.getInput('INPUT').connection.connect(blockB.outputConnection);
|
||||
blockA.setCollapsed(true);
|
||||
@@ -1340,9 +1340,9 @@ suite('Blocks', function() {
|
||||
chai.assert.isFalse(isBlockHidden(blockC));
|
||||
});
|
||||
test('Connect Block to Child of Collapsed - Next', function() {
|
||||
var blockA = createRenderedBlock(this.workspace,'statement_block');
|
||||
var blockB = createRenderedBlock(this.workspace,'stack_block');
|
||||
var blockC = createRenderedBlock(this.workspace,'stack_block');
|
||||
var blockA = createRenderedBlock(this.workspace, 'statement_block');
|
||||
var blockB = createRenderedBlock(this.workspace, 'stack_block');
|
||||
var blockC = createRenderedBlock(this.workspace, 'stack_block');
|
||||
|
||||
blockA.getInput('STATEMENT').connection
|
||||
.connect(blockB.previousConnection);
|
||||
@@ -1358,9 +1358,9 @@ suite('Blocks', function() {
|
||||
chai.assert.isFalse(isBlockHidden(blockC));
|
||||
});
|
||||
test('Connect Block to Value Input Already Taken', function() {
|
||||
var blockA = createRenderedBlock(this.workspace,'row_block');
|
||||
var blockB = createRenderedBlock(this.workspace,'row_block');
|
||||
var blockC = createRenderedBlock(this.workspace,'row_block');
|
||||
var blockA = createRenderedBlock(this.workspace, 'row_block');
|
||||
var blockB = createRenderedBlock(this.workspace, 'row_block');
|
||||
var blockC = createRenderedBlock(this.workspace, 'row_block');
|
||||
|
||||
blockA.getInput('INPUT').connection.connect(blockB.outputConnection);
|
||||
blockA.setCollapsed(true);
|
||||
@@ -1377,9 +1377,9 @@ suite('Blocks', function() {
|
||||
chai.assert.isFalse(isBlockHidden(blockC));
|
||||
});
|
||||
test('Connect Block to Statement Input Already Taken', function() {
|
||||
var blockA = createRenderedBlock(this.workspace,'statement_block');
|
||||
var blockB = createRenderedBlock(this.workspace,'stack_block');
|
||||
var blockC = createRenderedBlock(this.workspace,'stack_block');
|
||||
var blockA = createRenderedBlock(this.workspace, 'statement_block');
|
||||
var blockB = createRenderedBlock(this.workspace, 'stack_block');
|
||||
var blockC = createRenderedBlock(this.workspace, 'stack_block');
|
||||
|
||||
blockA.getInput('STATEMENT').connection
|
||||
.connect(blockB.previousConnection);
|
||||
@@ -1398,9 +1398,9 @@ suite('Blocks', function() {
|
||||
chai.assert.isFalse(isBlockHidden(blockC));
|
||||
});
|
||||
test('Connect Block with Child - Input', function() {
|
||||
var blockA = createRenderedBlock(this.workspace,'row_block');
|
||||
var blockB = createRenderedBlock(this.workspace,'row_block');
|
||||
var blockC = createRenderedBlock(this.workspace,'row_block');
|
||||
var blockA = createRenderedBlock(this.workspace, 'row_block');
|
||||
var blockB = createRenderedBlock(this.workspace, 'row_block');
|
||||
var blockC = createRenderedBlock(this.workspace, 'row_block');
|
||||
|
||||
blockB.getInput('INPUT').connection.connect(blockC.outputConnection);
|
||||
blockA.setCollapsed(true);
|
||||
@@ -1415,9 +1415,9 @@ suite('Blocks', function() {
|
||||
chai.assert.isFalse(isBlockHidden(blockC));
|
||||
});
|
||||
test('Connect Block with Child - Statement', function() {
|
||||
var blockA = createRenderedBlock(this.workspace,'statement_block');
|
||||
var blockB = createRenderedBlock(this.workspace,'stack_block');
|
||||
var blockC = createRenderedBlock(this.workspace,'stack_block');
|
||||
var blockA = createRenderedBlock(this.workspace, 'statement_block');
|
||||
var blockB = createRenderedBlock(this.workspace, 'stack_block');
|
||||
var blockC = createRenderedBlock(this.workspace, 'stack_block');
|
||||
|
||||
blockB.nextConnection.connect(blockC.previousConnection);
|
||||
blockA.setCollapsed(true);
|
||||
@@ -1433,8 +1433,8 @@ suite('Blocks', function() {
|
||||
chai.assert.isFalse(isBlockHidden(blockC));
|
||||
});
|
||||
test('Disconnect Block from Value Input', function() {
|
||||
var blockA = createRenderedBlock(this.workspace,'row_block');
|
||||
var blockB = createRenderedBlock(this.workspace,'row_block');
|
||||
var blockA = createRenderedBlock(this.workspace, 'row_block');
|
||||
var blockB = createRenderedBlock(this.workspace, 'row_block');
|
||||
|
||||
blockA.getInput('INPUT').connection.connect(blockB.outputConnection);
|
||||
blockA.setCollapsed(true);
|
||||
@@ -1444,8 +1444,8 @@ suite('Blocks', function() {
|
||||
chai.assert.isFalse(isBlockHidden(blockB));
|
||||
});
|
||||
test('Disconnect Block from Statement Input', function() {
|
||||
var blockA = createRenderedBlock(this.workspace,'statement_block');
|
||||
var blockB = createRenderedBlock(this.workspace,'stack_block');
|
||||
var blockA = createRenderedBlock(this.workspace, 'statement_block');
|
||||
var blockB = createRenderedBlock(this.workspace, 'stack_block');
|
||||
|
||||
blockA.getInput('STATEMENT').connection
|
||||
.connect(blockB.previousConnection);
|
||||
@@ -1456,9 +1456,9 @@ suite('Blocks', function() {
|
||||
chai.assert.isFalse(isBlockHidden(blockB));
|
||||
});
|
||||
test('Disconnect Block from Child of Collapsed - Input', function() {
|
||||
var blockA = createRenderedBlock(this.workspace,'row_block');
|
||||
var blockB = createRenderedBlock(this.workspace,'row_block');
|
||||
var blockC = createRenderedBlock(this.workspace,'row_block');
|
||||
var blockA = createRenderedBlock(this.workspace, 'row_block');
|
||||
var blockB = createRenderedBlock(this.workspace, 'row_block');
|
||||
var blockC = createRenderedBlock(this.workspace, 'row_block');
|
||||
|
||||
blockA.getInput('INPUT').connection.connect(blockB.outputConnection);
|
||||
blockB.getInput('INPUT').connection.connect(blockC.outputConnection);
|
||||
@@ -1471,9 +1471,9 @@ suite('Blocks', function() {
|
||||
chai.assert.isFalse(isBlockHidden(blockC));
|
||||
});
|
||||
test('Disconnect Block from Child of Collapsed - Next', function() {
|
||||
var blockA = createRenderedBlock(this.workspace,'statement_block');
|
||||
var blockB = createRenderedBlock(this.workspace,'stack_block');
|
||||
var blockC = createRenderedBlock(this.workspace,'stack_block');
|
||||
var blockA = createRenderedBlock(this.workspace, 'statement_block');
|
||||
var blockB = createRenderedBlock(this.workspace, 'stack_block');
|
||||
var blockC = createRenderedBlock(this.workspace, 'stack_block');
|
||||
|
||||
blockA.getInput('STATEMENT').connection
|
||||
.connect(blockB.previousConnection);
|
||||
@@ -1487,9 +1487,9 @@ suite('Blocks', function() {
|
||||
chai.assert.isFalse(isBlockHidden(blockC));
|
||||
});
|
||||
test('Disconnect Block with Child - Input', function() {
|
||||
var blockA = createRenderedBlock(this.workspace,'row_block');
|
||||
var blockB = createRenderedBlock(this.workspace,'row_block');
|
||||
var blockC = createRenderedBlock(this.workspace,'row_block');
|
||||
var blockA = createRenderedBlock(this.workspace, 'row_block');
|
||||
var blockB = createRenderedBlock(this.workspace, 'row_block');
|
||||
var blockC = createRenderedBlock(this.workspace, 'row_block');
|
||||
|
||||
blockB.getInput('INPUT').connection.connect(blockC.outputConnection);
|
||||
blockA.getInput('INPUT').connection.connect(blockB.outputConnection);
|
||||
@@ -1503,9 +1503,9 @@ suite('Blocks', function() {
|
||||
chai.assert.isFalse(isBlockHidden(blockC));
|
||||
});
|
||||
test('Disconnect Block with Child - Statement', function() {
|
||||
var blockA = createRenderedBlock(this.workspace,'statement_block');
|
||||
var blockB = createRenderedBlock(this.workspace,'stack_block');
|
||||
var blockC = createRenderedBlock(this.workspace,'stack_block');
|
||||
var blockA = createRenderedBlock(this.workspace, 'statement_block');
|
||||
var blockB = createRenderedBlock(this.workspace, 'stack_block');
|
||||
var blockC = createRenderedBlock(this.workspace, 'stack_block');
|
||||
|
||||
blockB.nextConnection.connect(blockC.previousConnection);
|
||||
blockA.getInput('STATEMENT').connection
|
||||
@@ -1522,7 +1522,7 @@ suite('Blocks', function() {
|
||||
});
|
||||
suite('Adding and Removing Block Parts', function() {
|
||||
test('Add Previous Connection', function() {
|
||||
var blockA = createRenderedBlock(this.workspace,'empty_block');
|
||||
var blockA = createRenderedBlock(this.workspace, 'empty_block');
|
||||
blockA.setCollapsed(true);
|
||||
assertCollapsed(blockA);
|
||||
blockA.setPreviousStatement(true);
|
||||
@@ -1530,7 +1530,7 @@ suite('Blocks', function() {
|
||||
chai.assert.isNotNull(blockA.previousConnection);
|
||||
});
|
||||
test('Add Next Connection', function() {
|
||||
var blockA = createRenderedBlock(this.workspace,'empty_block');
|
||||
var blockA = createRenderedBlock(this.workspace, 'empty_block');
|
||||
blockA.setCollapsed(true);
|
||||
assertCollapsed(blockA);
|
||||
blockA.setNextStatement(true);
|
||||
@@ -1538,7 +1538,7 @@ suite('Blocks', function() {
|
||||
chai.assert.isNotNull(blockA.nextConnection);
|
||||
});
|
||||
test('Add Input', function() {
|
||||
var blockA = createRenderedBlock(this.workspace,'empty_block');
|
||||
var blockA = createRenderedBlock(this.workspace, 'empty_block');
|
||||
blockA.setCollapsed(true);
|
||||
assertCollapsed(blockA);
|
||||
blockA.appendDummyInput('NAME');
|
||||
@@ -1546,7 +1546,7 @@ suite('Blocks', function() {
|
||||
chai.assert.isNotNull(blockA.getInput('NAME'));
|
||||
});
|
||||
test('Add Field', function() {
|
||||
var blockA = createRenderedBlock(this.workspace,'empty_block');
|
||||
var blockA = createRenderedBlock(this.workspace, 'empty_block');
|
||||
var input = blockA.appendDummyInput('NAME');
|
||||
blockA.setCollapsed(true);
|
||||
assertCollapsed(blockA);
|
||||
@@ -1557,14 +1557,14 @@ suite('Blocks', function() {
|
||||
chai.assert.equal(field.getText(), 'test');
|
||||
});
|
||||
test('Add Icon', function() {
|
||||
var blockA = createRenderedBlock(this.workspace,'empty_block');
|
||||
var blockA = createRenderedBlock(this.workspace, 'empty_block');
|
||||
blockA.setCollapsed(true);
|
||||
assertCollapsed(blockA);
|
||||
blockA.setCommentText('test');
|
||||
assertCollapsed(blockA);
|
||||
});
|
||||
test('Remove Previous Connection', function() {
|
||||
var blockA = createRenderedBlock(this.workspace,'empty_block');
|
||||
var blockA = createRenderedBlock(this.workspace, 'empty_block');
|
||||
blockA.setPreviousStatement(true);
|
||||
blockA.setCollapsed(true);
|
||||
assertCollapsed(blockA);
|
||||
@@ -1573,7 +1573,7 @@ suite('Blocks', function() {
|
||||
chai.assert.isNull(blockA.previousConnection);
|
||||
});
|
||||
test('Remove Next Connection', function() {
|
||||
var blockA = createRenderedBlock(this.workspace,'empty_block');
|
||||
var blockA = createRenderedBlock(this.workspace, 'empty_block');
|
||||
blockA.setNextStatement(true);
|
||||
blockA.setCollapsed(true);
|
||||
assertCollapsed(blockA);
|
||||
@@ -1582,7 +1582,7 @@ suite('Blocks', function() {
|
||||
chai.assert.isNull(blockA.nextConnection);
|
||||
});
|
||||
test('Remove Input', function() {
|
||||
var blockA = createRenderedBlock(this.workspace,'empty_block');
|
||||
var blockA = createRenderedBlock(this.workspace, 'empty_block');
|
||||
blockA.appendDummyInput('NAME');
|
||||
blockA.setCollapsed(true);
|
||||
assertCollapsed(blockA);
|
||||
@@ -1591,7 +1591,7 @@ suite('Blocks', function() {
|
||||
chai.assert.isNull(blockA.getInput('NAME'));
|
||||
});
|
||||
test('Remove Field', function() {
|
||||
var blockA = createRenderedBlock(this.workspace,'empty_block');
|
||||
var blockA = createRenderedBlock(this.workspace, 'empty_block');
|
||||
var input = blockA.appendDummyInput('NAME');
|
||||
input.appendField(new Blockly.FieldLabel('test'), 'FIELD');
|
||||
blockA.setCollapsed(true);
|
||||
@@ -1602,7 +1602,7 @@ suite('Blocks', function() {
|
||||
chai.assert.isNull(field);
|
||||
});
|
||||
test('Remove Icon', function() {
|
||||
var blockA = createRenderedBlock(this.workspace,'empty_block');
|
||||
var blockA = createRenderedBlock(this.workspace, 'empty_block');
|
||||
blockA.setCommentText('test');
|
||||
blockA.setCollapsed(true);
|
||||
assertCollapsed(blockA);
|
||||
@@ -1612,7 +1612,7 @@ suite('Blocks', function() {
|
||||
});
|
||||
suite('Renaming Vars', function() {
|
||||
test('Simple Rename', function() {
|
||||
var blockA = createRenderedBlock(this.workspace,'variable_block');
|
||||
var blockA = createRenderedBlock(this.workspace, 'variable_block');
|
||||
|
||||
blockA.setCollapsed(true);
|
||||
assertCollapsed(blockA, 'x');
|
||||
@@ -1622,7 +1622,7 @@ suite('Blocks', function() {
|
||||
assertCollapsed(blockA, 'y');
|
||||
});
|
||||
test('Coalesce, Different Case', function() {
|
||||
var blockA = createRenderedBlock(this.workspace,'variable_block');
|
||||
var blockA = createRenderedBlock(this.workspace, 'variable_block');
|
||||
|
||||
blockA.setCollapsed(true);
|
||||
assertCollapsed(blockA, 'x');
|
||||
@@ -1634,8 +1634,8 @@ suite('Blocks', function() {
|
||||
});
|
||||
suite('Disabled Blocks', function() {
|
||||
test('Children of Collapsed Blocks Should Enable Properly', function() {
|
||||
var blockA = createRenderedBlock(this.workspace,'statement_block');
|
||||
var blockB = createRenderedBlock(this.workspace,'stack_block');
|
||||
var blockA = createRenderedBlock(this.workspace, 'statement_block');
|
||||
var blockB = createRenderedBlock(this.workspace, 'stack_block');
|
||||
blockA.getInput('STATEMENT').connection
|
||||
.connect(blockB.previousConnection);
|
||||
// Disable the block and collapse it.
|
||||
@@ -1651,8 +1651,8 @@ suite('Blocks', function() {
|
||||
chai.assert.isFalse(blockB.getSvgRoot().classList.contains('blocklyDisabled'));
|
||||
});
|
||||
test('Children of Collapsed Block Should Not Update', function() {
|
||||
var blockA = createRenderedBlock(this.workspace,'statement_block');
|
||||
var blockB = createRenderedBlock(this.workspace,'stack_block');
|
||||
var blockA = createRenderedBlock(this.workspace, 'statement_block');
|
||||
var blockB = createRenderedBlock(this.workspace, 'stack_block');
|
||||
blockA.getInput('STATEMENT').connection
|
||||
.connect(blockB.previousConnection);
|
||||
|
||||
@@ -1670,8 +1670,8 @@ suite('Blocks', function() {
|
||||
sinon.assert.notCalled(blockUpdateDisabled);
|
||||
});
|
||||
test('Disabled Children of Collapsed Blocks Should Stay Disabled', function() {
|
||||
var blockA = createRenderedBlock(this.workspace,'statement_block');
|
||||
var blockB = createRenderedBlock(this.workspace,'stack_block');
|
||||
var blockA = createRenderedBlock(this.workspace, 'statement_block');
|
||||
var blockB = createRenderedBlock(this.workspace, 'stack_block');
|
||||
blockA.getInput('STATEMENT').connection
|
||||
.connect(blockB.previousConnection);
|
||||
|
||||
|
||||
@@ -934,7 +934,7 @@ suite('Events', function() {
|
||||
new Blockly.Events.Click(block1),
|
||||
new Blockly.Events.BubbleOpen(block2, true, 'mutator'),
|
||||
new Blockly.Events.Click(block2),
|
||||
new Blockly.Events.BubbleOpen(block3, true,'warning'),
|
||||
new Blockly.Events.BubbleOpen(block3, true, 'warning'),
|
||||
new Blockly.Events.Click(block3)
|
||||
];
|
||||
var filteredEvents = Blockly.Events.filter(events, true);
|
||||
|
||||
@@ -71,7 +71,7 @@ suite('Angle Fields', function() {
|
||||
validTestCaseAssertField, assertFieldDefault);
|
||||
|
||||
testHelpers.runFromJsonSuiteTests(
|
||||
Blockly.FieldAngle, validValueTestCases,invalidValueTestCases,
|
||||
Blockly.FieldAngle, validValueTestCases, invalidValueTestCases,
|
||||
validTestCaseAssertField, assertFieldDefault);
|
||||
|
||||
suite('setValue', function() {
|
||||
|
||||
@@ -74,7 +74,7 @@ suite('Checkbox Fields', function() {
|
||||
validTestCaseAssertField, assertFieldDefault);
|
||||
|
||||
testHelpers.runFromJsonSuiteTests(
|
||||
Blockly.FieldCheckbox, validValueTestCases,invalidValueTestCases,
|
||||
Blockly.FieldCheckbox, validValueTestCases, invalidValueTestCases,
|
||||
validTestCaseAssertField, assertFieldDefault);
|
||||
|
||||
suite('setValue', function() {
|
||||
|
||||
@@ -99,7 +99,7 @@ suite('Colour Fields', function() {
|
||||
validTestCaseAssertField, assertFieldDefault);
|
||||
|
||||
testHelpers.runFromJsonSuiteTests(
|
||||
Blockly.FieldColour, validValueTestCases,invalidValueTestCases,
|
||||
Blockly.FieldColour, validValueTestCases, invalidValueTestCases,
|
||||
validTestCaseAssertField, assertFieldDefault);
|
||||
|
||||
suite('setValue', function() {
|
||||
|
||||
@@ -114,8 +114,8 @@ suite('Dropdown Fields', function() {
|
||||
suite('Validators', function() {
|
||||
setup(function() {
|
||||
this.dropdownField = new Blockly.FieldDropdown([
|
||||
["1a","1A"], ["1b","1B"], ["1c","1C"],
|
||||
["2a","2A"], ["2b","2B"], ["2c","2C"]]);
|
||||
["1a", "1A"], ["1b", "1B"], ["1c", "1C"],
|
||||
["2a", "2A"], ["2b", "2B"], ["2c", "2C"]]);
|
||||
});
|
||||
teardown(function() {
|
||||
this.dropdownField.setValidator(null);
|
||||
|
||||
@@ -59,7 +59,7 @@ suite('Image Fields', function() {
|
||||
validTestCaseAssertField);
|
||||
|
||||
testHelpers.runFromJsonSuiteTests(
|
||||
Blockly.FieldImage, validValueCreationTestCases,invalidValueTestCases,
|
||||
Blockly.FieldImage, validValueCreationTestCases, invalidValueTestCases,
|
||||
validTestCaseAssertField);
|
||||
|
||||
/**
|
||||
|
||||
@@ -64,7 +64,7 @@ suite('Label Serializable Fields', function() {
|
||||
invalidValueTestCases, validTestCaseAssertField, assertFieldDefault);
|
||||
|
||||
testHelpers.runFromJsonSuiteTests(
|
||||
Blockly.FieldLabelSerializable, validValueTestCases,invalidValueTestCases,
|
||||
Blockly.FieldLabelSerializable, validValueTestCases, invalidValueTestCases,
|
||||
validTestCaseAssertField, assertFieldDefault);
|
||||
|
||||
suite('setValue', function() {
|
||||
|
||||
@@ -64,7 +64,7 @@ suite('Label Fields', function() {
|
||||
validTestCaseAssertField, assertFieldDefault);
|
||||
|
||||
testHelpers.runFromJsonSuiteTests(
|
||||
Blockly.FieldLabel, validValueTestCases,invalidValueTestCases,
|
||||
Blockly.FieldLabel, validValueTestCases, invalidValueTestCases,
|
||||
validTestCaseAssertField, assertFieldDefault);
|
||||
|
||||
suite('setValue', function() {
|
||||
|
||||
@@ -66,7 +66,7 @@ suite('Multiline Input Fields', function() {
|
||||
validTestCaseAssertField, assertFieldDefault);
|
||||
|
||||
testHelpers.runFromJsonSuiteTests(
|
||||
Blockly.FieldMultilineInput, validValueTestCases,invalidValueTestCases,
|
||||
Blockly.FieldMultilineInput, validValueTestCases, invalidValueTestCases,
|
||||
validTestCaseAssertField, assertFieldDefault);
|
||||
|
||||
suite('setValue', function() {
|
||||
|
||||
@@ -88,7 +88,7 @@ suite('Number Fields', function() {
|
||||
validTestCaseAssertField, assertFieldDefault);
|
||||
|
||||
testHelpers.runFromJsonSuiteTests(
|
||||
Blockly.FieldNumber, validValueTestCases,invalidValueTestCases,
|
||||
Blockly.FieldNumber, validValueTestCases, invalidValueTestCases,
|
||||
validTestCaseAssertField, assertFieldDefault);
|
||||
|
||||
suite('setValue', function() {
|
||||
|
||||
@@ -64,7 +64,7 @@ suite('Text Input Fields', function() {
|
||||
validTestCaseAssertField, assertFieldDefault);
|
||||
|
||||
testHelpers.runFromJsonSuiteTests(
|
||||
Blockly.FieldTextInput, validValueTestCases,invalidValueTestCases,
|
||||
Blockly.FieldTextInput, validValueTestCases, invalidValueTestCases,
|
||||
validTestCaseAssertField, assertFieldDefault);
|
||||
|
||||
suite('setValue', function() {
|
||||
|
||||
@@ -90,7 +90,7 @@ suite('Flyout', function() {
|
||||
this.flyout.targetWorkspace.toolboxPosition =
|
||||
Blockly.utils.toolbox.Position.RIGHT;
|
||||
this.flyout.toolboxPosition_ = Blockly.utils.toolbox.Position.RIGHT;
|
||||
chai.assert.equal(this.flyout.getX(), 90,'x + width should be aligned with toolbox');
|
||||
chai.assert.equal(this.flyout.getX(), 90, 'x + width should be aligned with toolbox');
|
||||
});
|
||||
});
|
||||
// These tests simulate a trashcan flyout, i.e. the flyout under test is on the
|
||||
@@ -260,7 +260,7 @@ suite('Flyout', function() {
|
||||
{type: "button"},
|
||||
{type: "button"}
|
||||
];
|
||||
var expectedGaps = [20,24,24];
|
||||
var expectedGaps = [20, 24, 24];
|
||||
var flyoutInfo = flyoutSpy.returnValues[0];
|
||||
var contents = flyoutInfo.contents;
|
||||
var gaps = flyoutInfo.gaps;
|
||||
|
||||
@@ -20,8 +20,8 @@ suite('Names', function() {
|
||||
|
||||
test('Safe name', function() {
|
||||
var varDB = new Blockly.Names('window,door');
|
||||
chai.assert.equal(varDB.safeName_(''), 'unnamed','SafeName empty.');
|
||||
chai.assert.equal(varDB.safeName_('foobar'), 'foobar','SafeName ok.');
|
||||
chai.assert.equal(varDB.safeName_(''), 'unnamed', 'SafeName empty.');
|
||||
chai.assert.equal(varDB.safeName_('foobar'), 'foobar', 'SafeName ok.');
|
||||
chai.assert.equal(varDB.safeName_('9lives'), 'my_9lives', 'SafeName number start.');
|
||||
chai.assert.equal(varDB.safeName_('lives9'), 'lives9', 'SafeName number end.');
|
||||
chai.assert.equal(varDB.safeName_('!@#$'), '____', 'SafeName special chars.');
|
||||
|
||||
@@ -765,7 +765,7 @@ suite('Procedures', function() {
|
||||
'Callers are enabled when their definition is enabled (call ' +
|
||||
i + ')');
|
||||
}
|
||||
chai.assert.equal(firedEvents.length,3,
|
||||
chai.assert.equal(firedEvents.length, 3,
|
||||
'An event was fired for the definition and each caller');
|
||||
for (var i = 0; i < 3; i++) {
|
||||
chai.assert.equal(firedEvents[i].group, 'g2',
|
||||
@@ -801,7 +801,7 @@ suite('Procedures', function() {
|
||||
'Caller remains in disabled state when the definition is enabled');
|
||||
chai.assert.isTrue(this.barCalls[1].isEnabled(),
|
||||
'Caller returns to previous enabled state when the definition is enabled');
|
||||
chai.assert.equal(firedEvents.length,2,
|
||||
chai.assert.equal(firedEvents.length, 2,
|
||||
'An event was fired for the definition and the enabled caller');
|
||||
for (var i = 0; i < 2; i++) {
|
||||
chai.assert.equal(firedEvents[i].group, 'g2',
|
||||
|
||||
@@ -414,7 +414,7 @@ suite('Toolbox', function() {
|
||||
});
|
||||
test('Select collapsible item -> Should close flyout', function() {
|
||||
var newItem = getCollapsibleItem(this.toolbox);
|
||||
testHideFlyout(this.toolbox,null, newItem);
|
||||
testHideFlyout(this.toolbox, null, newItem);
|
||||
});
|
||||
test('Select selectable item -> Should open flyout', function() {
|
||||
var showFlyoutstub = sinon.stub(this.toolbox.flyout_, 'show');
|
||||
|
||||
@@ -14,7 +14,7 @@ suite('Utils', function() {
|
||||
|
||||
test('genUid', function() {
|
||||
var uuids = {};
|
||||
chai.assert.equal([1,2,3].indexOf(4), -1);
|
||||
chai.assert.equal([1, 2, 3].indexOf(4), -1);
|
||||
for (var i = 0; i < 1000; i++) {
|
||||
var uuid = Blockly.utils.genUid();
|
||||
chai.assert.isFalse(uuid in uuids, 'UUID different: ' + uuid);
|
||||
|
||||
@@ -150,7 +150,7 @@ suite('Workspace comment', function() {
|
||||
test('Initial position', function() {
|
||||
var xy = this.comment.getXY();
|
||||
chai.assert.equal(xy.x, 0, 'Initial X position');
|
||||
chai.assert.equal(xy.y, 0,'Initial Y position');
|
||||
chai.assert.equal(xy.y, 0, 'Initial Y position');
|
||||
});
|
||||
|
||||
test('moveBy', function() {
|
||||
@@ -177,7 +177,7 @@ suite('Workspace comment', function() {
|
||||
chai.assert.equal(
|
||||
this.comment.getContent(), 'comment text');
|
||||
chai.assert.equal(
|
||||
this.workspace.undoStack_.length, 1,'Workspace undo stack');
|
||||
this.workspace.undoStack_.length, 1, 'Workspace undo stack');
|
||||
});
|
||||
|
||||
test('Set to same value', function() {
|
||||
|
||||
@@ -72,7 +72,7 @@ suite('WorkspaceSvg', function() {
|
||||
|
||||
Blockly.Xml.appendDomToWorkspace(dom, this.workspace);
|
||||
var blocks = this.workspace.getAllBlocks(false);
|
||||
chai.assert.equal(blocks.length, 2,'Block count');
|
||||
chai.assert.equal(blocks.length, 2, 'Block count');
|
||||
var shadowBlock = blocks[1];
|
||||
chai.assert.exists(shadowBlock.getSvgRoot());
|
||||
|
||||
@@ -185,7 +185,7 @@ suite('WorkspaceSvg', function() {
|
||||
assertSpyFiredViewportEvent(
|
||||
eventsFireStub, workspace, expectedProperties);
|
||||
assertSpyFiredViewportEvent(
|
||||
changeListenerSpy, workspace,expectedProperties);
|
||||
changeListenerSpy, workspace, expectedProperties);
|
||||
sinon.assert.callCount(changeListenerSpy, expectedEventCount);
|
||||
sinon.assert.callCount(eventsFireStub, expectedEventCount);
|
||||
}
|
||||
|
||||
@@ -455,13 +455,13 @@ function testAWorkspace() {
|
||||
test('Over instance limit', function() {
|
||||
this.workspace.options.maxInstances['get_var_block'] = 1;
|
||||
chai.assert.equal(this.workspace.remainingCapacityOfType('get_var_block'),
|
||||
-1,'With maxInstances limit 1');
|
||||
-1, 'With maxInstances limit 1');
|
||||
});
|
||||
|
||||
test('Over instance limit of 0', function() {
|
||||
this.workspace.options.maxInstances['get_var_block'] = 0;
|
||||
chai.assert.equal(this.workspace.remainingCapacityOfType('get_var_block'),
|
||||
-2,'With maxInstances limit 0');
|
||||
-2, 'With maxInstances limit 0');
|
||||
});
|
||||
|
||||
test('Over instance limit with multiple block types', function() {
|
||||
@@ -470,7 +470,7 @@ function testAWorkspace() {
|
||||
this.workspace.newBlock('');
|
||||
this.workspace.options.maxInstances['get_var_block'] = 1;
|
||||
chai.assert.equal(this.workspace.remainingCapacityOfType('get_var_block'),
|
||||
-1,'With maxInstances limit 1');
|
||||
-1, 'With maxInstances limit 1');
|
||||
});
|
||||
|
||||
test('Over instance limit of 0 with multiple block types', function() {
|
||||
@@ -479,7 +479,7 @@ function testAWorkspace() {
|
||||
this.workspace.newBlock('');
|
||||
this.workspace.options.maxInstances['get_var_block'] = 0;
|
||||
chai.assert.equal(this.workspace.remainingCapacityOfType('get_var_block'),
|
||||
-2,'With maxInstances limit 0');
|
||||
-2, 'With maxInstances limit 0');
|
||||
});
|
||||
});
|
||||
|
||||
@@ -611,7 +611,7 @@ function testAWorkspace() {
|
||||
|
||||
test('Trivial', function() {
|
||||
chai.assert.equal(
|
||||
this.workspace.getBlockById(this.blockA.id),this.blockA);
|
||||
this.workspace.getBlockById(this.blockA.id), this.blockA);
|
||||
chai.assert.equal(
|
||||
this.workspace.getBlockById(this.blockB.id), this.blockB);
|
||||
});
|
||||
@@ -1294,7 +1294,7 @@ function testAWorkspace() {
|
||||
|
||||
this.workspace.undo(true);
|
||||
// Expect that variable 'id2' is recreated
|
||||
assertBlockVarModelName(this.workspace,0, 'name2');
|
||||
assertBlockVarModelName(this.workspace, 0, 'name2');
|
||||
chai.assert.isNull(this.workspace.getVariableById('id1'));
|
||||
assertVariableValues(this.workspace, 'name2', 'type2', 'id2');
|
||||
});
|
||||
|
||||
@@ -713,7 +713,7 @@ suite('XML', function() {
|
||||
});
|
||||
suite('appendDomToWorkspace', function() {
|
||||
setup(function() {
|
||||
addBlockTypeToCleanup(this.sharedCleanup,'test_block');
|
||||
addBlockTypeToCleanup(this.sharedCleanup, 'test_block');
|
||||
Blockly.Blocks['test_block'] = {
|
||||
init: function() {
|
||||
this.jsonInit({
|
||||
|
||||
Reference in New Issue
Block a user