Files
blockly/tests/mocha/index.html
Beka Westberg 486123e4ff fix: insertion markers and change events to work with JSO hooks (#5378)
* fix: add tests for fixing change events

* fix: change events and insertion markers

* fix: build:

* fix: remove duplicate code

* fix: requires
2021-09-20 13:08:35 -07:00

166 lines
6.6 KiB
HTML

<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Mocha Tests for Blockly</title>
<link href="../../node_modules/mocha/mocha.css" rel="stylesheet" />
<script src="../../blockly_uncompressed.js"></script>
<script src="../deps.mocha.js"></script>
<script src="../../generators/dart.js"></script>
<script src="../../generators/javascript.js"></script>
<script src="../../generators/lua.js"></script>
<script src="../../generators/php.js"></script>
<script src="../../generators/python.js"></script>
<script src="../../generators/dart/text.js"></script>
<script src="../../generators/javascript/text.js"></script>
<script src="../../generators/lua/text.js"></script>
<script src="../../generators/php/text.js"></script>
<script src="../../generators/python/text.js"></script>
<script src="../../msg/messages.js"></script>
<script src="../../blocks/loops.js"></script>
<script src="../../blocks/lists.js"></script>
<script src="../../blocks/logic.js"></script>
<script src="../../blocks/math.js"></script>
<script src="../../blocks/procedures.js"></script>
<script src="../../blocks/text.js"></script>
<script src="../../blocks/variables.js"></script>
<script src="../../blocks/variables_dynamic.js"></script>
</head>
<style>
#blocklyDiv {
height: 1000px;
position: fixed;
visibility: hidden;
width: 1000px;
}
</style>
<body>
<div id="mocha"></div>
<div id="failureCount" style="display:none" tests_failed="unset"></div>
<script src="../../node_modules/chai/chai.js"></script>
<script src="../../node_modules/mocha/mocha.js"></script>
<script src="../../node_modules/sinon/pkg/sinon.js"></script>
<script src="../../node_modules/@blockly/dev-tools/dist/index.js"></script>
<script>
mocha.setup({
ui: 'tdd'
});
</script>
<script>
goog.require('Blockly.test.astNode');
goog.require('Blockly.test.blockChangeEvent');
goog.require('Blockly.test.blockJson');
goog.require('Blockly.test.blocks');
goog.require('Blockly.test.comments');
goog.require('Blockly.test.connectionChecker');
goog.require('Blockly.test.connectionDb');
goog.require('Blockly.test.connection');
goog.require('Blockly.test.contextMenuItem');
goog.require('Blockly.test.cursor');
goog.require('Blockly.test.dropdown');
goog.require('Blockly.test.event');
goog.require('Blockly.test.extensions');
goog.require('Blockly.test.fieldAngle');
goog.require('Blockly.test.fieldCheckbox');
goog.require('Blockly.test.fieldColour');
goog.require('Blockly.test.fieldDropdown');
goog.require('Blockly.test.fieldImage');
goog.require('Blockly.test.fieldLabelSerialization');
goog.require('Blockly.test.fieldLabel');
goog.require('Blockly.test.fieldMultiline');
goog.require('Blockly.test.fieldNumber');
goog.require('Blockly.test.fieldRegistry');
goog.require('Blockly.test.fieldTest');
goog.require('Blockly.test.fieldTextInput');
goog.require('Blockly.test.fieldVariable');
goog.require('Blockly.test.flyout');
goog.require('Blockly.test.generator');
goog.require('Blockly.test.gesture');
goog.require('Blockly.test.input');
goog.require('Blockly.test.insertionMarker');
goog.require('Blockly.test.jsoDeserialization');
goog.require('Blockly.test.jsoSerialization');
goog.require('Blockly.test.json');
goog.require('Blockly.test.keydown');
goog.require('Blockly.test.logicTernary');
goog.require('Blockly.test.metrics');
goog.require('Blockly.test.mutator');
goog.require('Blockly.test.names');
goog.require('Blockly.test.procedures');
goog.require('Blockly.test.registry');
goog.require('Blockly.test.serialization');
goog.require('Blockly.test.shortcutRegistry');
goog.require('Blockly.test.theme');
goog.require('Blockly.test.toolbox');
goog.require('Blockly.test.tooltip');
goog.require('Blockly.test.trashcan');
goog.require('Blockly.test.utils');
goog.require('Blockly.test.variableMap');
goog.require('Blockly.test.variableModel');
goog.require('Blockly.test.variables');
goog.require('Blockly.test.widgetDiv');
goog.require('Blockly.test.workspaceComment');
goog.require('Blockly.test.workspaceSvg');
goog.require('Blockly.test.workspace');
goog.require('Blockly.test.xml');
goog.require('Blockly.test.zoomControls');
</script>
<div id="blocklyDiv"></div>
<xml xmlns="https://developers.google.com/blockly/xml" id="toolbox-simple" style="display: none">
<block type="logic_operation"></block>
<sep gap="20"></sep>
<button text="insert" callbackkey="insertConnectionRows"></button>
<label text="tooltips"></label>
</xml>
<xml xmlns="https://developers.google.com/blockly/xml" id="toolbox-categories" style="display: none">
<category name="First" css-container="something">
<block type="basic_block">
<field name="TEXT">FirstCategory-FirstBlock</field>
</block>
<block type="basic_block">
<field name="TEXT">FirstCategory-SecondBlock</field>
</block>
</category>
<category name="Second">
<block type="basic_block">
<field name="TEXT">SecondCategory-FirstBlock</field>
</block>
</category>
</xml>
<xml xmlns="https://developers.google.com/blockly/xml" id="toolbox-test" style="display: none">
<category name="First" expanded="true" categorystyle="logic_category">
<sep gap="-1"></sep>
<button text="insert" callbackkey="insertConnectionRows"></button>
<block type="stack_block"></block>
<block type="stack_block"></block>
</category>
<category name="Second">
<block type="stack_block"></block>
</category>
<sep toolboxitemid="separator" gap="-1"></sep>
<category name="Variables" custom="VARIABLE"></category>
<category name="NestedCategory" >
<category toolboxitemid="nestedCategory" name="NestedItemOne"></category>
</category>
<category name="lastItem"></category>
</xml>
<xml xmlns="https://developers.google.com/blockly/xml" id="gesture-test-toolbox" style="display: none">
<block type="test_field_block"></block>
</xml>
<script>
mocha.run(function(failures) {
var failureDiv = document.getElementById('failureCount');
failureDiv.setAttribute('tests_failed', failures);
});
</script>
</body>
</html>