diff --git a/tests/jsunit/block_test.js b/tests/jsunit/block_test.js deleted file mode 100644 index de4f36ffd..000000000 --- a/tests/jsunit/block_test.js +++ /dev/null @@ -1,35 +0,0 @@ -/** - * @license - * Blockly Tests - * - * Copyright 2015 Google Inc. - * https://developers.google.com/blockly/ - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -'use strict'; - -function test_getBlockById() { - var workspace = new Blockly.Workspace(); - var blockA = workspace.newBlock(''); - var blockB = workspace.newBlock(''); - assertEquals('Find blockA.', blockA, Blockly.Block.getById(blockA.id)); - assertEquals('Find blockB.', blockB, Blockly.Block.getById(blockB.id)); - assertEquals('No block found.', null, - Blockly.Block.getById('I do not exist.')); - blockA.dispose(); - assertEquals('Can\'t find blockA.', null, Blockly.Block.getById(blockA.id)); - assertEquals('BlockB exists.', blockB, Blockly.Block.getById(blockB.id)); - workspace.clear(); - assertEquals('Can\'t find blockB.', null, Blockly.Block.getById(blockB.id)); -} diff --git a/tests/jsunit/index.html b/tests/jsunit/index.html index 48f134e89..a60459169 100644 --- a/tests/jsunit/index.html +++ b/tests/jsunit/index.html @@ -8,7 +8,6 @@ - diff --git a/tests/jsunit/workspace_test.js b/tests/jsunit/workspace_test.js index 2033b9ae0..87ff3bb98 100644 --- a/tests/jsunit/workspace_test.js +++ b/tests/jsunit/workspace_test.js @@ -82,3 +82,18 @@ function test_getWorkspaceById() { assertEquals('WorkspaceB exists.', workspaceB, Blockly.Workspace.getById(workspaceB.id)); } + +function test_getBlockById() { + var workspace = new Blockly.Workspace(); + var blockA = workspace.newBlock(''); + var blockB = workspace.newBlock(''); + assertEquals('Find blockA.', blockA, workspace.getBlockById(blockA.id)); + assertEquals('Find blockB.', blockB, workspace.getBlockById(blockB.id)); + assertEquals('No block found.', null, + workspace.getBlockById('I do not exist.')); + blockA.dispose(); + assertEquals('Can\'t find blockA.', null, workspace.getBlockById(blockA.id)); + assertEquals('BlockB exists.', blockB, workspace.getBlockById(blockB.id)); + workspace.clear(); + assertEquals('Can\'t find blockB.', null, workspace.getBlockById(blockB.id)); +} diff --git a/tests/playground.html b/tests/playground.html index c41c12db2..3e5863deb 100644 --- a/tests/playground.html +++ b/tests/playground.html @@ -87,8 +87,7 @@ function start() { startScale: 1.0, maxScale: 4, minScale: .25, - scaleSpeed: 1.1 - }, + scaleSpeed: 1.1} }); // Restore previously displayed text. if (sessionStorage) {