Skip to content

Commit c6afb2d

Browse files
committed
Fixed smaller issues and some tests.
1 parent 4db45e7 commit c6afb2d

13 files changed

+85
-41
lines changed

src/blocks/simple/blocks.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ Blockly.Blocks['simple_text_write'] = {
4141
/**
4242
* Write line.
4343
*/
44-
Blockly.Blocks['simple_text_writeLine'] = {
44+
Blockly.Blocks['simple_text_write_line'] = {
4545
init: function() {
4646
this.setHelpUrl('');
4747
this.setColour(290);
@@ -52,10 +52,11 @@ Blockly.Blocks['simple_text_writeLine'] = {
5252
.appendField(')');
5353
this.setPreviousStatement(true, ['Number', 'String']);
5454
this.setNextStatement(true, ['Number', 'String']);
55-
this.setTooltip(i18t('Writes the text on its own line the screen.'));
55+
this.setTooltip(i18t('Writes the text on its own line on the screen.'));
5656
},
5757
};
5858

59+
5960
/**
6061
* Draw circle.
6162
*/

src/blocks/simple/javascript.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,17 +30,19 @@ Blockly.JavaScript['simple_text_write'] = function(block) {
3030
return 'command.write(' + text + ');\n';
3131
};
3232

33+
3334
/**
3435
* Write line.
3536
* @param {!Blockly.block} block
3637
* @return {string}
3738
*/
38-
Blockly.JavaScript['simple_text_writeLine'] = function(block) {
39+
Blockly.JavaScript['simple_text_write_line'] = function(block) {
3940
let text = Blockly.JavaScript.valueToCode(block, 'text',
4041
Blockly.JavaScript.ORDER_ATOMIC);
4142
return 'command.writeLine(' + text + ');\n';
4243
};
4344

45+
4446
/**
4547
* Draw circle.
4648
* @param {!Blockly.block} block

src/blocks/simple/toolbox.soy

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
<block type="text"><field name="TEXT"></field></block>
3333
</value>
3434
</block>
35-
<block type="simple_text_writeLine">
35+
<block type="simple_text_write_line">
3636
<value name="text">
3737
<block type="text"><field name="TEXT"></field></block>
3838
</value>

test/.eslintrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
'describe': true,
88
'expect': true,
99
'getTestBlockCode': true,
10+
'getTestBlockWorkspace': true,
1011
'getTestBuffer': true,
1112
'it': true,
1213
'loadExampleFile': true,

test/block_tests/general_block_test.js

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,7 @@
2020

2121

2222
describe('General Blocks', function() {
23-
document.body.insertAdjacentHTML('afterbegin',
24-
'<div id="test-workspace"></div>');
25-
window['i18t'] = function(msg) {
26-
return msg;
27-
};
28-
23+
getTestBlockWorkspace();
2924
let blockPrefix = 'general_';
3025
let blocks = [];
3126
for (let block in Blockly.Blocks) {

test/block_tests/ev3_block_test.js renamed to test/block_tests/lego_ev3_block_test.js

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,7 @@
2020

2121

2222
describe('EV3 Blocks', function() {
23-
document.body.insertAdjacentHTML('afterbegin',
24-
'<div id="test-workspace"></div>');
25-
window['i18t'] = function(msg) {
26-
return msg;
27-
};
28-
23+
getTestBlockWorkspace();
2924
let blockPrefix = 'ev3_';
3025
let blocks = [];
3126
for (let block in Blockly.Blocks) {

test/block_tests/mbot_block_test.js renamed to test/block_tests/makeblock_mbot_block_test.js

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,7 @@
2020

2121

2222
describe('mBot Blocks', function() {
23-
document.body.insertAdjacentHTML('afterbegin',
24-
'<div id="test-workspace"></div>');
25-
window['i18t'] = function(msg) {
26-
return msg;
27-
};
28-
23+
getTestBlockWorkspace();
2924
let blockPrefix = 'mbot_';
3025
let blocks = [];
3126
for (let block in Blockly.Blocks) {

test/block_tests/phaser_block_test.js

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,7 @@
2020

2121

2222
describe('Phaser Blocks', function() {
23-
document.body.insertAdjacentHTML('afterbegin',
24-
'<div id="test-workspace"></div>');
25-
window['i18t'] = function(msg) {
26-
return msg;
27-
};
28-
23+
getTestBlockWorkspace();
2924
let blockPrefix = 'phaser_';
3025
let blocks = [];
3126
for (let block in Blockly.Blocks) {

test/block_tests/simple_block_test.js

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,7 @@
2020

2121

2222
describe('Simple Blocks', function() {
23-
document.body.insertAdjacentHTML('afterbegin',
24-
'<div id="test-workspace"></div>');
25-
window['i18t'] = function(msg) {
26-
return msg;
27-
};
28-
23+
getTestBlockWorkspace();
2924
let blockPrefix = 'simple_';
3025
let blocks = [];
3126
for (let block in Blockly.Blocks) {

test/block_tests/sphero_block_test.js

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,7 @@
2020

2121

2222
describe('Sphero Blocks', function() {
23-
document.body.insertAdjacentHTML('afterbegin',
24-
'<div id="test-workspace"></div>');
25-
window['i18t'] = function(msg) {
26-
return msg;
27-
};
28-
23+
getTestBlockWorkspace();
2924
let blockPrefix = 'sphero_';
3025
let blocks = [];
3126
for (let block in Blockly.Blocks) {

0 commit comments

Comments
 (0)