mirror of
https://github.com/google/blockly.git
synced 2026-01-10 02:17:09 +01:00
Adding test and updating TODO. (#3102)
* Adding test and updating TODO. * changing bug number referenced in TODO
This commit is contained in:
committed by
Sam El-Husseini
parent
40e0d55187
commit
f4136fdc2a
@@ -281,19 +281,6 @@ function test_appendDomToWorkspace() {
|
||||
}
|
||||
}
|
||||
|
||||
function test_blockToDom_fieldToDom_trivial() {
|
||||
xmlTest_setUpWithMockBlocks();
|
||||
// TODO (#1199): make a similar test where the variable is given a non-empty
|
||||
// type.f
|
||||
workspace.createVariable('name1', '', 'id1');
|
||||
var block = new Blockly.Block(workspace, 'field_variable_test_block');
|
||||
block.inputList[0].fieldRow[0].setValue('id1');
|
||||
var resultFieldDom = Blockly.Xml.blockToDom(block).childNodes[0];
|
||||
xmlTest_checkVariableFieldDomValues(resultFieldDom, 'VAR', null, 'id1',
|
||||
'name1');
|
||||
xmlTest_tearDownWithMockBlocks();
|
||||
}
|
||||
|
||||
function test_blockToDom_fieldToDom_defaultCase() {
|
||||
xmlTest_setUpWithMockBlocks();
|
||||
mockControl_ = setUpMockMethod(Blockly.utils, 'genUid', null, ['1', '1']);
|
||||
|
||||
@@ -276,6 +276,14 @@ suite('XML', function() {
|
||||
var resultFieldDom = Blockly.Xml.blockToDom(block).childNodes[0];
|
||||
assertVariableField(resultFieldDom, 'VAR', null, 'id1', 'name1');
|
||||
});
|
||||
test('Variable Typed', function() {
|
||||
this.workspace.createVariable('name1', 'string', 'id1');
|
||||
var block = new Blockly.Block(this.workspace,
|
||||
'field_variable_test_block');
|
||||
block.inputList[0].fieldRow[0].setValue('id1');
|
||||
var resultFieldDom = Blockly.Xml.blockToDom(block).childNodes[0];
|
||||
assertVariableField(resultFieldDom, 'VAR', 'string', 'id1', 'name1');
|
||||
});
|
||||
test('Variable Default Case', function() {
|
||||
var cacheGenUid = Blockly.utils.genUid;
|
||||
Blockly.utils.genUid = function() {
|
||||
|
||||
Reference in New Issue
Block a user