mirror of
https://github.com/google/blockly.git
synced 2026-01-09 01:50:11 +01:00
All tests pass
This commit is contained in:
@@ -8,7 +8,7 @@
|
||||
</head>
|
||||
<body>
|
||||
<script src="test_utilities.js"></script>
|
||||
<!-- <script src="connection_db_test.js"></script>
|
||||
<script src="connection_db_test.js"></script>
|
||||
<script src="connection_test.js"></script>
|
||||
<script src="event_test.js"></script>
|
||||
<script src="extensions_test.js"></script>
|
||||
@@ -27,7 +27,7 @@
|
||||
<script src="variable_model_test.js"></script>
|
||||
<script src="workspace_test.js"></script>
|
||||
<script src="workspace_undo_redo_test.js"></script>
|
||||
<script src="widget_div_test.js"></script> -->
|
||||
<script src="widget_div_test.js"></script>
|
||||
<script src="xml_test.js"></script>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
@@ -345,14 +345,14 @@ function test_variablesToDom_oneVariable() {
|
||||
function test_variablesToDom_twoVariables_oneBlock() {
|
||||
xmlTest_setUpWithMockBlocks();
|
||||
|
||||
workspace.createVariable('name1', 'type1', 'id1');
|
||||
workspace.createVariable('name1', '', 'id1');
|
||||
workspace.createVariable('name2', 'type2', 'id2');
|
||||
var block = new Blockly.Block(workspace, 'field_variable_test_block');
|
||||
block.inputList[0].fieldRow[0].setValue('name1');
|
||||
block.inputList[0].fieldRow[0].setValue('id1');
|
||||
|
||||
var resultDom = Blockly.Xml.variablesToDom(workspace.getAllVariables());
|
||||
assertEquals(2, resultDom.children.length);
|
||||
xmlTest_checkVariableDomValues(resultDom.children[0], 'type1', 'id1',
|
||||
xmlTest_checkVariableDomValues(resultDom.children[0], '', 'id1',
|
||||
'name1');
|
||||
xmlTest_checkVariableDomValues(resultDom.children[1], 'type2', 'id2',
|
||||
'name2');
|
||||
@@ -380,14 +380,12 @@ function test_variableFieldXml_caseSensitive() {
|
||||
}
|
||||
};
|
||||
|
||||
var generatedXml = Blockly.Variables.generateVariableFieldXml_(mockVariableModel);
|
||||
// The field contains this XML tag as a result of how we're generating this
|
||||
// XML. This is not desirable, but the goal of this test is to make sure
|
||||
// we're preserving case-sensitivity.
|
||||
var xmlns = 'xmlns="http://www.w3.org/1999/xhtml"';
|
||||
var generatedXml =
|
||||
Blockly.Variables.generateVariableFieldXml_(mockVariableModel);
|
||||
var goldenXml =
|
||||
'<field ' + xmlns + ' name="VAR"' +
|
||||
'<field name="VAR"' +
|
||||
' id="' + id + '"' +
|
||||
' variabletype="' + type + '"' +
|
||||
' id="' + id + '">' + name + '</field>';
|
||||
'>' + name + '</field>';
|
||||
assertEquals(goldenXml, generatedXml);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user