mirror of
https://github.com/google/blockly.git
synced 2026-01-10 18:37:09 +01:00
Merge branch 'develop' into ensure-immovable-blocks-are-considered-during-workspace-tidying
This commit is contained in:
@@ -9,7 +9,7 @@
|
||||
*/
|
||||
|
||||
import * as chai from 'chai';
|
||||
import {testSetup, testFileLocations} from './test_setup.mjs';
|
||||
import {testFileLocations, testSetup} from './test_setup.mjs';
|
||||
|
||||
suite('Testing Connecting Blocks', function (done) {
|
||||
// Setting timeout to unlimited as the webdriver takes a longer time to run than most mocha test
|
||||
|
||||
@@ -11,12 +11,11 @@
|
||||
|
||||
import * as chai from 'chai';
|
||||
import {
|
||||
testSetup,
|
||||
testFileLocations,
|
||||
getAllBlocks,
|
||||
dragNthBlockFromFlyout,
|
||||
getAllBlocks,
|
||||
testFileLocations,
|
||||
testSetup,
|
||||
} from './test_setup.mjs';
|
||||
import {Key} from 'webdriverio';
|
||||
|
||||
suite('Basic block tests', function (done) {
|
||||
// Setting timeout to unlimited as the webdriver takes a longer time
|
||||
|
||||
@@ -10,13 +10,13 @@
|
||||
|
||||
import * as chai from 'chai';
|
||||
import {
|
||||
testSetup,
|
||||
testFileLocations,
|
||||
dragNthBlockFromFlyout,
|
||||
dragBlockTypeFromFlyout,
|
||||
connect,
|
||||
contextMenuSelect,
|
||||
dragBlockTypeFromFlyout,
|
||||
dragNthBlockFromFlyout,
|
||||
PAUSE_TIME,
|
||||
testFileLocations,
|
||||
testSetup,
|
||||
} from './test_setup.mjs';
|
||||
|
||||
async function getIsCollapsed(browser, blockId) {
|
||||
|
||||
@@ -11,11 +11,11 @@
|
||||
import * as chai from 'chai';
|
||||
import {Key} from 'webdriverio';
|
||||
import {
|
||||
testSetup,
|
||||
testFileLocations,
|
||||
dragBlockTypeFromFlyout,
|
||||
screenDirection,
|
||||
getAllBlocks,
|
||||
screenDirection,
|
||||
testFileLocations,
|
||||
testSetup,
|
||||
} from './test_setup.mjs';
|
||||
|
||||
suite('Testing undo block movement', function (done) {
|
||||
|
||||
@@ -5,16 +5,16 @@
|
||||
*/
|
||||
|
||||
import * as chai from 'chai';
|
||||
import {Key} from 'webdriverio';
|
||||
import {
|
||||
testSetup,
|
||||
testFileLocations,
|
||||
getAllBlocks,
|
||||
getBlockElementById,
|
||||
clickBlock,
|
||||
contextMenuSelect,
|
||||
getAllBlocks,
|
||||
getBlockElementById,
|
||||
PAUSE_TIME,
|
||||
testFileLocations,
|
||||
testSetup,
|
||||
} from './test_setup.mjs';
|
||||
import {Key} from 'webdriverio';
|
||||
|
||||
const firstBlockId = 'root_block';
|
||||
const startBlocks = {
|
||||
|
||||
@@ -9,14 +9,14 @@
|
||||
*/
|
||||
|
||||
import * as chai from 'chai';
|
||||
import {
|
||||
testSetup,
|
||||
testFileLocations,
|
||||
getBlockElementById,
|
||||
getAllBlocks,
|
||||
PAUSE_TIME,
|
||||
} from './test_setup.mjs';
|
||||
import {Key} from 'webdriverio';
|
||||
import {
|
||||
getAllBlocks,
|
||||
getBlockElementById,
|
||||
PAUSE_TIME,
|
||||
testFileLocations,
|
||||
testSetup,
|
||||
} from './test_setup.mjs';
|
||||
|
||||
suite('This tests loading Large Configuration and Deletion', function (done) {
|
||||
// Setting timeout to unlimited as the webdriver takes a longer time to run than most mocha test
|
||||
|
||||
@@ -9,14 +9,14 @@
|
||||
*/
|
||||
|
||||
import * as chai from 'chai';
|
||||
import {Key} from 'webdriverio';
|
||||
import {
|
||||
testSetup,
|
||||
testFileLocations,
|
||||
clickWorkspace,
|
||||
dragBlockTypeFromFlyout,
|
||||
screenDirection,
|
||||
clickWorkspace,
|
||||
testFileLocations,
|
||||
testSetup,
|
||||
} from './test_setup.mjs';
|
||||
import {Key} from 'webdriverio';
|
||||
|
||||
suite('Testing Field Edits', function (done) {
|
||||
// Setting timeout to unlimited as the webdriver takes a longer time to run than most mocha test
|
||||
|
||||
@@ -6,15 +6,15 @@
|
||||
|
||||
import * as chai from 'chai';
|
||||
import {
|
||||
testSetup,
|
||||
testFileLocations,
|
||||
connect,
|
||||
dragBlockTypeFromFlyout,
|
||||
screenDirection,
|
||||
PAUSE_TIME,
|
||||
getBlockElementById,
|
||||
connect,
|
||||
dragBlockFromMutatorFlyout,
|
||||
dragBlockTypeFromFlyout,
|
||||
getBlockElementById,
|
||||
openMutatorForBlock,
|
||||
screenDirection,
|
||||
testFileLocations,
|
||||
testSetup,
|
||||
} from './test_setup.mjs';
|
||||
|
||||
suite('Mutating a block', function (done) {
|
||||
|
||||
@@ -10,13 +10,13 @@
|
||||
|
||||
import * as chai from 'chai';
|
||||
import {
|
||||
testSetup,
|
||||
testFileLocations,
|
||||
getSelectedBlockElement,
|
||||
getNthBlockOfCategory,
|
||||
getBlockTypeFromCategory,
|
||||
connect,
|
||||
getBlockTypeFromCategory,
|
||||
getNthBlockOfCategory,
|
||||
getSelectedBlockElement,
|
||||
PAUSE_TIME,
|
||||
testFileLocations,
|
||||
testSetup,
|
||||
} from './test_setup.mjs';
|
||||
|
||||
suite('Testing Connecting Blocks', function (done) {
|
||||
|
||||
@@ -16,9 +16,9 @@
|
||||
* identifiers that Selenium can use to find those elements.
|
||||
*/
|
||||
|
||||
import * as webdriverio from 'webdriverio';
|
||||
import * as path from 'path';
|
||||
import {fileURLToPath} from 'url';
|
||||
import * as webdriverio from 'webdriverio';
|
||||
import {posixPath} from '../../../scripts/helpers.js';
|
||||
|
||||
let driver = null;
|
||||
|
||||
@@ -10,12 +10,12 @@
|
||||
|
||||
import * as chai from 'chai';
|
||||
import {
|
||||
testSetup,
|
||||
testFileLocations,
|
||||
getCategory,
|
||||
scrollFlyout,
|
||||
screenDirection,
|
||||
PAUSE_TIME,
|
||||
screenDirection,
|
||||
scrollFlyout,
|
||||
testFileLocations,
|
||||
testSetup,
|
||||
} from './test_setup.mjs';
|
||||
|
||||
// Categories in the basic toolbox.
|
||||
@@ -25,7 +25,6 @@ const basicCategories = [
|
||||
'Math',
|
||||
'Text',
|
||||
'Lists',
|
||||
'Colour',
|
||||
'Variables',
|
||||
'Functions',
|
||||
];
|
||||
@@ -39,12 +38,13 @@ const testCategories = [
|
||||
'Row',
|
||||
'Stack',
|
||||
'Statement',
|
||||
'Drag',
|
||||
// Disabled due to #8466
|
||||
// 'Drag',
|
||||
|
||||
// Skip fields because it's an accordion that is already open.
|
||||
// 'Fields',
|
||||
'Defaults',
|
||||
'Numbers',
|
||||
'Angles',
|
||||
'Drop-downs',
|
||||
// Note: images has a block that has a bad image source, but still builds and renders
|
||||
// just fine.
|
||||
|
||||
@@ -6,8 +6,7 @@
|
||||
|
||||
import * as chai from 'chai';
|
||||
import * as sinon from 'sinon';
|
||||
import {Key} from 'webdriverio';
|
||||
import {testSetup, testFileLocations} from './test_setup.mjs';
|
||||
import {testFileLocations, testSetup} from './test_setup.mjs';
|
||||
|
||||
suite('Workspace comments', function () {
|
||||
// Setting timeout to unlimited as the webdriver takes a longer time
|
||||
|
||||
@@ -11,11 +11,10 @@
|
||||
* (renamings-schema.json).
|
||||
*/
|
||||
|
||||
import JSON5 from 'json5';
|
||||
import {readFile} from 'fs/promises';
|
||||
import {posixPath} from '../../scripts/helpers.js';
|
||||
import {validate} from '@hyperjump/json-schema/draft-2020-12';
|
||||
import {BASIC} from '@hyperjump/json-schema/experimental';
|
||||
import {readFile} from 'fs/promises';
|
||||
import JSON5 from 'json5';
|
||||
|
||||
/** @type {URL} Renaming schema filename. */
|
||||
const SCHEMA_URL = new URL('renamings.schema.json', import.meta.url);
|
||||
|
||||
@@ -4,8 +4,8 @@
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
import {assert} from '../../node_modules/chai/chai.js';
|
||||
import {ASTNode} from '../../build/src/core/keyboard_nav/ast_node.js';
|
||||
import {assert} from '../../node_modules/chai/chai.js';
|
||||
import {
|
||||
sharedTestSetup,
|
||||
sharedTestTeardown,
|
||||
|
||||
@@ -4,8 +4,8 @@
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
import {assert} from '../../node_modules/chai/chai.js';
|
||||
import {Align} from '../../build/src/core/inputs/align.js';
|
||||
import {assert} from '../../node_modules/chai/chai.js';
|
||||
import {
|
||||
sharedTestSetup,
|
||||
sharedTestTeardown,
|
||||
|
||||
@@ -4,23 +4,22 @@
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
import {assert} from '../../node_modules/chai/chai.js';
|
||||
import {ConnectionType} from '../../build/src/core/connection_type.js';
|
||||
import {createDeprecationWarningStub} from './test_helpers/warnings.js';
|
||||
import {createRenderedBlock} from './test_helpers/block_definitions.js';
|
||||
import {EventType} from '../../build/src/core/events/type.js';
|
||||
import * as eventUtils from '../../build/src/core/events/utils.js';
|
||||
import {EndRowInput} from '../../build/src/core/inputs/end_row_input.js';
|
||||
import {assert} from '../../node_modules/chai/chai.js';
|
||||
import {createRenderedBlock} from './test_helpers/block_definitions.js';
|
||||
import {
|
||||
createChangeListenerSpy,
|
||||
createMockEvent,
|
||||
} from './test_helpers/events.js';
|
||||
import {MockBubbleIcon, MockIcon} from './test_helpers/icon_mocks.js';
|
||||
import {
|
||||
sharedTestSetup,
|
||||
sharedTestTeardown,
|
||||
workspaceTeardown,
|
||||
} from './test_helpers/setup_teardown.js';
|
||||
import {
|
||||
createChangeListenerSpy,
|
||||
createMockEvent,
|
||||
} from './test_helpers/events.js';
|
||||
import {MockIcon, MockBubbleIcon} from './test_helpers/icon_mocks.js';
|
||||
import {IconType} from '../../build/src/core/icons/icon_types.js';
|
||||
|
||||
suite('Blocks', function () {
|
||||
setup(function () {
|
||||
@@ -1253,7 +1252,7 @@ suite('Blocks', function () {
|
||||
function assertCommentEvent(eventSpy, oldValue, newValue) {
|
||||
const calls = eventSpy.getCalls();
|
||||
const event = calls[calls.length - 1].args[0];
|
||||
assert.equal(event.type, eventUtils.BLOCK_CHANGE);
|
||||
assert.equal(event.type, EventType.BLOCK_CHANGE);
|
||||
assert.equal(
|
||||
event.element,
|
||||
'comment',
|
||||
@@ -1273,7 +1272,7 @@ suite('Blocks', function () {
|
||||
function assertNoCommentEvent(eventSpy) {
|
||||
const calls = eventSpy.getCalls();
|
||||
const event = calls[calls.length - 1].args[0];
|
||||
assert.notEqual(event.type, eventUtils.BLOCK_CHANGE);
|
||||
assert.notEqual(event.type, EventType.BLOCK_CHANGE);
|
||||
}
|
||||
setup(function () {
|
||||
this.eventsFireSpy = sinon.spy(eventUtils.TEST_ONLY, 'fireInternal');
|
||||
|
||||
@@ -4,14 +4,14 @@
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
import {ConnectionType} from '../../../build/src/core/connection_type.js';
|
||||
import {assert} from '../../../node_modules/chai/chai.js';
|
||||
import {defineStatementBlock} from '../test_helpers/block_definitions.js';
|
||||
import {runSerializationTestSuite} from '../test_helpers/serialization.js';
|
||||
import {
|
||||
sharedTestSetup,
|
||||
sharedTestTeardown,
|
||||
} from '../test_helpers/setup_teardown.js';
|
||||
import {ConnectionType} from '../../../build/src/core/connection_type.js';
|
||||
import {defineStatementBlock} from '../test_helpers/block_definitions.js';
|
||||
|
||||
suite('Lists', function () {
|
||||
setup(function () {
|
||||
|
||||
@@ -4,8 +4,8 @@
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
import {assert} from '../../../node_modules/chai/chai.js';
|
||||
import * as eventUtils from '../../../build/src/core/events/utils.js';
|
||||
import {assert} from '../../../node_modules/chai/chai.js';
|
||||
import {runSerializationTestSuite} from '../test_helpers/serialization.js';
|
||||
import {
|
||||
sharedTestSetup,
|
||||
|
||||
@@ -4,8 +4,8 @@
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
import {assert} from '../../../node_modules/chai/chai.js';
|
||||
import * as Blockly from '../../../build/src/core/blockly.js';
|
||||
import {assert} from '../../../node_modules/chai/chai.js';
|
||||
import {
|
||||
sharedTestSetup,
|
||||
sharedTestTeardown,
|
||||
|
||||
@@ -4,13 +4,14 @@
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
import {assert} from '../../../node_modules/chai/chai.js';
|
||||
import * as Blockly from '../../../build/src/core/blockly.js';
|
||||
import {assert} from '../../../node_modules/chai/chai.js';
|
||||
import {defineRowBlock} from '../test_helpers/block_definitions.js';
|
||||
import {
|
||||
assertCallBlockStructure,
|
||||
assertDefBlockStructure,
|
||||
createProcDefBlock,
|
||||
createProcCallBlock,
|
||||
createProcDefBlock,
|
||||
MockProcedureModel,
|
||||
} from '../test_helpers/procedures.js';
|
||||
import {runSerializationTestSuite} from '../test_helpers/serialization.js';
|
||||
@@ -20,7 +21,6 @@ import {
|
||||
sharedTestTeardown,
|
||||
workspaceTeardown,
|
||||
} from '../test_helpers/setup_teardown.js';
|
||||
import {defineRowBlock} from '../test_helpers/block_definitions.js';
|
||||
|
||||
suite('Procedures', function () {
|
||||
setup(function () {
|
||||
|
||||
@@ -4,16 +4,16 @@
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
import {assert} from '../../../node_modules/chai/chai.js';
|
||||
import {
|
||||
sharedTestSetup,
|
||||
sharedTestTeardown,
|
||||
} from '../test_helpers/setup_teardown.js';
|
||||
import {nameUsedWithConflictingParam} from '../../../build/src/core/variables.js';
|
||||
import {assert} from '../../../node_modules/chai/chai.js';
|
||||
import {
|
||||
MockParameterModelWithVar,
|
||||
MockProcedureModel,
|
||||
} from '../test_helpers/procedures.js';
|
||||
import {
|
||||
sharedTestSetup,
|
||||
sharedTestTeardown,
|
||||
} from '../test_helpers/setup_teardown.js';
|
||||
|
||||
suite('Variables', function () {
|
||||
setup(function () {
|
||||
|
||||
@@ -5,14 +5,14 @@
|
||||
*/
|
||||
|
||||
import {assert} from '../../node_modules/chai/chai.js';
|
||||
import {
|
||||
sharedTestSetup,
|
||||
sharedTestTeardown,
|
||||
} from './test_helpers/setup_teardown.js';
|
||||
import {
|
||||
assertEventFired,
|
||||
createChangeListenerSpy,
|
||||
} from './test_helpers/events.js';
|
||||
import {
|
||||
sharedTestSetup,
|
||||
sharedTestTeardown,
|
||||
} from './test_helpers/setup_teardown.js';
|
||||
|
||||
suite('Clipboard', function () {
|
||||
setup(function () {
|
||||
|
||||
@@ -4,9 +4,9 @@
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
import {EventType} from '../../build/src/core/events/type.js';
|
||||
import {assert} from '../../node_modules/chai/chai.js';
|
||||
import {assertEventFired} from './test_helpers/events.js';
|
||||
import * as eventUtils from '../../build/src/core/events/utils.js';
|
||||
import {
|
||||
sharedTestSetup,
|
||||
sharedTestTeardown,
|
||||
@@ -55,7 +55,7 @@ suite('Comments', function () {
|
||||
assertEventFired(
|
||||
this.eventsFireStub,
|
||||
Blockly.Events.BubbleOpen,
|
||||
{bubbleType: 'comment', isOpen: true, type: eventUtils.BUBBLE_OPEN},
|
||||
{bubbleType: 'comment', isOpen: true, type: EventType.BUBBLE_OPEN},
|
||||
this.workspace.id,
|
||||
this.block.id,
|
||||
);
|
||||
@@ -70,7 +70,7 @@ suite('Comments', function () {
|
||||
assertEventFired(
|
||||
this.eventsFireStub,
|
||||
Blockly.Events.BubbleOpen,
|
||||
{bubbleType: 'comment', isOpen: true, type: eventUtils.BUBBLE_OPEN},
|
||||
{bubbleType: 'comment', isOpen: true, type: EventType.BUBBLE_OPEN},
|
||||
this.workspace.id,
|
||||
this.block.id,
|
||||
);
|
||||
@@ -86,7 +86,7 @@ suite('Comments', function () {
|
||||
assertEventFired(
|
||||
this.eventsFireStub,
|
||||
Blockly.Events.BubbleOpen,
|
||||
{bubbleType: 'comment', isOpen: true, type: eventUtils.BUBBLE_OPEN},
|
||||
{bubbleType: 'comment', isOpen: true, type: EventType.BUBBLE_OPEN},
|
||||
this.workspace.id,
|
||||
this.block.id,
|
||||
);
|
||||
@@ -104,7 +104,7 @@ suite('Comments', function () {
|
||||
assertEventFired(
|
||||
this.eventsFireStub,
|
||||
Blockly.Events.BubbleOpen,
|
||||
{bubbleType: 'comment', isOpen: true, type: eventUtils.BUBBLE_OPEN},
|
||||
{bubbleType: 'comment', isOpen: true, type: EventType.BUBBLE_OPEN},
|
||||
this.workspace.id,
|
||||
this.block.id,
|
||||
);
|
||||
|
||||
@@ -4,8 +4,8 @@
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
import {assert} from '../../node_modules/chai/chai.js';
|
||||
import {ConnectionType} from '../../build/src/core/connection_type.js';
|
||||
import {assert} from '../../node_modules/chai/chai.js';
|
||||
import {
|
||||
sharedTestSetup,
|
||||
sharedTestTeardown,
|
||||
|
||||
@@ -4,8 +4,8 @@
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
import {assert} from '../../node_modules/chai/chai.js';
|
||||
import {ConnectionType} from '../../build/src/core/connection_type.js';
|
||||
import {assert} from '../../node_modules/chai/chai.js';
|
||||
import {
|
||||
sharedTestSetup,
|
||||
sharedTestTeardown,
|
||||
|
||||
@@ -5,17 +5,17 @@
|
||||
*/
|
||||
|
||||
import {assert} from '../../node_modules/chai/chai.js';
|
||||
import {
|
||||
defineRowBlock,
|
||||
defineStackBlock,
|
||||
defineStatementBlock,
|
||||
} from './test_helpers/block_definitions.js';
|
||||
import {
|
||||
createGenUidStubWithReturns,
|
||||
sharedTestSetup,
|
||||
sharedTestTeardown,
|
||||
workspaceTeardown,
|
||||
} from './test_helpers/setup_teardown.js';
|
||||
import {
|
||||
defineRowBlock,
|
||||
defineStatementBlock,
|
||||
defineStackBlock,
|
||||
} from './test_helpers/block_definitions.js';
|
||||
|
||||
suite('Connection', function () {
|
||||
setup(function () {
|
||||
|
||||
@@ -4,16 +4,15 @@
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
import {callbackFactory} from '../../build/src/core/contextmenu.js';
|
||||
import * as xmlUtils from '../../build/src/core/utils/xml.js';
|
||||
import * as Variables from '../../build/src/core/variables.js';
|
||||
import {assert} from '../../node_modules/chai/chai.js';
|
||||
import {
|
||||
sharedTestSetup,
|
||||
sharedTestTeardown,
|
||||
} from './test_helpers/setup_teardown.js';
|
||||
|
||||
import {callbackFactory} from '../../build/src/core/contextmenu.js';
|
||||
import * as xmlUtils from '../../build/src/core/utils/xml.js';
|
||||
import * as Variables from '../../build/src/core/variables.js';
|
||||
|
||||
suite('Context Menu', function () {
|
||||
setup(function () {
|
||||
sharedTestSetup.call(this);
|
||||
|
||||
@@ -4,12 +4,12 @@
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
import {ASTNode} from '../../build/src/core/keyboard_nav/ast_node.js';
|
||||
import {assert} from '../../node_modules/chai/chai.js';
|
||||
import {
|
||||
sharedTestSetup,
|
||||
sharedTestTeardown,
|
||||
} from './test_helpers/setup_teardown.js';
|
||||
import {ASTNode} from '../../build/src/core/keyboard_nav/ast_node.js';
|
||||
|
||||
suite('Cursor', function () {
|
||||
setup(function () {
|
||||
|
||||
@@ -5,11 +5,11 @@
|
||||
*/
|
||||
|
||||
import {assert} from '../../node_modules/chai/chai.js';
|
||||
import {defineMutatorBlocks} from './test_helpers/block_definitions.js';
|
||||
import {
|
||||
sharedTestSetup,
|
||||
sharedTestTeardown,
|
||||
} from './test_helpers/setup_teardown.js';
|
||||
import {defineMutatorBlocks} from './test_helpers/block_definitions.js';
|
||||
|
||||
suite('Block Change Event', function () {
|
||||
setup(function () {
|
||||
|
||||
@@ -4,14 +4,14 @@
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
import {EventType} from '../../build/src/core/events/type.js';
|
||||
import {assert} from '../../node_modules/chai/chai.js';
|
||||
import {defineRowBlock} from './test_helpers/block_definitions.js';
|
||||
import {assertEventFired} from './test_helpers/events.js';
|
||||
import * as eventUtils from '../../build/src/core/events/utils.js';
|
||||
import {
|
||||
sharedTestSetup,
|
||||
sharedTestTeardown,
|
||||
} from './test_helpers/setup_teardown.js';
|
||||
import {defineRowBlock} from './test_helpers/block_definitions.js';
|
||||
|
||||
suite('Block Create Event', function () {
|
||||
setup(function () {
|
||||
@@ -48,7 +48,7 @@ suite('Block Create Event', function () {
|
||||
assertEventFired(
|
||||
this.eventsFireStub,
|
||||
Blockly.Events.BlockCreate,
|
||||
{'recordUndo': false, 'type': eventUtils.BLOCK_CREATE},
|
||||
{'recordUndo': false, 'type': EventType.BLOCK_CREATE},
|
||||
this.workspace.id,
|
||||
'shadowId',
|
||||
);
|
||||
|
||||
@@ -4,22 +4,22 @@
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
import {assert} from '../../node_modules/chai/chai.js';
|
||||
import * as Blockly from '../../build/src/core/blockly.js';
|
||||
import * as eventUtils from '../../build/src/core/events/utils.js';
|
||||
import {ASTNode} from '../../build/src/core/keyboard_nav/ast_node.js';
|
||||
import {assert} from '../../node_modules/chai/chai.js';
|
||||
import {
|
||||
assertEventEquals,
|
||||
assertNthCallEventArgEquals,
|
||||
createChangeListenerSpy,
|
||||
} from './test_helpers/events.js';
|
||||
import {assertVariableValues} from './test_helpers/variables.js';
|
||||
import {
|
||||
createGenUidStubWithReturns,
|
||||
sharedTestSetup,
|
||||
sharedTestTeardown,
|
||||
workspaceTeardown,
|
||||
} from './test_helpers/setup_teardown.js';
|
||||
import * as eventUtils from '../../build/src/core/events/utils.js';
|
||||
import {assertVariableValues} from './test_helpers/variables.js';
|
||||
|
||||
suite('Events', function () {
|
||||
setup(function () {
|
||||
|
||||
@@ -4,8 +4,9 @@
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
import {assert} from '../../node_modules/chai/chai.js';
|
||||
import * as Blockly from '../../build/src/core/blockly.js';
|
||||
import {assert} from '../../node_modules/chai/chai.js';
|
||||
import {defineRowBlock} from './test_helpers/block_definitions.js';
|
||||
import {
|
||||
assertFieldValue,
|
||||
runConstructorSuiteTests,
|
||||
@@ -17,7 +18,6 @@ import {
|
||||
sharedTestTeardown,
|
||||
workspaceTeardown,
|
||||
} from './test_helpers/setup_teardown.js';
|
||||
import {defineRowBlock} from './test_helpers/block_definitions.js';
|
||||
|
||||
suite('Checkbox Fields', function () {
|
||||
setup(function () {
|
||||
|
||||
@@ -4,18 +4,18 @@
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
import {assert} from '../../node_modules/chai/chai.js';
|
||||
import * as Blockly from '../../build/src/core/blockly.js';
|
||||
import {assert} from '../../node_modules/chai/chai.js';
|
||||
import {
|
||||
createTestBlock,
|
||||
defineRowBlock,
|
||||
} from './test_helpers/block_definitions.js';
|
||||
import {
|
||||
assertFieldValue,
|
||||
runConstructorSuiteTests,
|
||||
runFromJsonSuiteTests,
|
||||
runSetValueTests,
|
||||
} from './test_helpers/fields.js';
|
||||
import {
|
||||
createTestBlock,
|
||||
defineRowBlock,
|
||||
} from './test_helpers/block_definitions.js';
|
||||
import {
|
||||
sharedTestSetup,
|
||||
sharedTestTeardown,
|
||||
|
||||
@@ -4,18 +4,18 @@
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
import {assert} from '../../node_modules/chai/chai.js';
|
||||
import * as Blockly from '../../build/src/core/blockly.js';
|
||||
import {assert} from '../../node_modules/chai/chai.js';
|
||||
import {
|
||||
createTestBlock,
|
||||
defineRowBlock,
|
||||
} from './test_helpers/block_definitions.js';
|
||||
import {
|
||||
assertFieldValue,
|
||||
runConstructorSuiteTests,
|
||||
runFromJsonSuiteTests,
|
||||
runSetValueTests,
|
||||
} from './test_helpers/fields.js';
|
||||
import {
|
||||
createTestBlock,
|
||||
defineRowBlock,
|
||||
} from './test_helpers/block_definitions.js';
|
||||
import {
|
||||
sharedTestSetup,
|
||||
sharedTestTeardown,
|
||||
|
||||
@@ -4,8 +4,8 @@
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
import {assert} from '../../node_modules/chai/chai.js';
|
||||
import * as Blockly from '../../build/src/core/blockly.js';
|
||||
import {assert} from '../../node_modules/chai/chai.js';
|
||||
import {
|
||||
assertFieldValue,
|
||||
runConstructorSuiteTests,
|
||||
|
||||
@@ -4,8 +4,12 @@
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
import {assert} from '../../node_modules/chai/chai.js';
|
||||
import * as Blockly from '../../build/src/core/blockly.js';
|
||||
import {assert} from '../../node_modules/chai/chai.js';
|
||||
import {
|
||||
createTestBlock,
|
||||
defineRowBlock,
|
||||
} from './test_helpers/block_definitions.js';
|
||||
import {
|
||||
assertFieldValue,
|
||||
runConstructorSuiteTests,
|
||||
@@ -17,10 +21,6 @@ import {
|
||||
sharedTestTeardown,
|
||||
workspaceTeardown,
|
||||
} from './test_helpers/setup_teardown.js';
|
||||
import {
|
||||
createTestBlock,
|
||||
defineRowBlock,
|
||||
} from './test_helpers/block_definitions.js';
|
||||
|
||||
suite('Label Serializable Fields', function () {
|
||||
setup(function () {
|
||||
|
||||
@@ -4,8 +4,9 @@
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
import {assert} from '../../node_modules/chai/chai.js';
|
||||
import * as Blockly from '../../build/src/core/blockly.js';
|
||||
import {assert} from '../../node_modules/chai/chai.js';
|
||||
import {createTestBlock} from './test_helpers/block_definitions.js';
|
||||
import {
|
||||
assertFieldValue,
|
||||
runConstructorSuiteTests,
|
||||
@@ -16,7 +17,6 @@ import {
|
||||
sharedTestSetup,
|
||||
sharedTestTeardown,
|
||||
} from './test_helpers/setup_teardown.js';
|
||||
import {createTestBlock} from './test_helpers/block_definitions.js';
|
||||
|
||||
suite('Label Fields', function () {
|
||||
setup(function () {
|
||||
|
||||
@@ -4,21 +4,21 @@
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
import {assert} from '../../node_modules/chai/chai.js';
|
||||
import * as Blockly from '../../build/src/core/blockly.js';
|
||||
import {assert} from '../../node_modules/chai/chai.js';
|
||||
import {defineRowBlock} from './test_helpers/block_definitions.js';
|
||||
import {runTestCases} from './test_helpers/common.js';
|
||||
import {
|
||||
assertFieldValue,
|
||||
runConstructorSuiteTests,
|
||||
runFromJsonSuiteTests,
|
||||
runSetValueTests,
|
||||
} from './test_helpers/fields.js';
|
||||
import {defineRowBlock} from './test_helpers/block_definitions.js';
|
||||
import {
|
||||
sharedTestSetup,
|
||||
sharedTestTeardown,
|
||||
workspaceTeardown,
|
||||
} from './test_helpers/setup_teardown.js';
|
||||
import {runTestCases} from './test_helpers/common.js';
|
||||
|
||||
suite('Number Fields', function () {
|
||||
setup(function () {
|
||||
|
||||
@@ -4,9 +4,8 @@
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
import {assert} from '../../node_modules/chai/chai.js';
|
||||
import * as Blockly from '../../build/src/core/blockly.js';
|
||||
import {createDeprecationWarningStub} from './test_helpers/warnings.js';
|
||||
import {assert} from '../../node_modules/chai/chai.js';
|
||||
import {
|
||||
sharedTestSetup,
|
||||
sharedTestTeardown,
|
||||
|
||||
@@ -4,8 +4,8 @@
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
import {assert} from '../../node_modules/chai/chai.js';
|
||||
import * as Blockly from '../../build/src/core/blockly.js';
|
||||
import {assert} from '../../node_modules/chai/chai.js';
|
||||
import {
|
||||
addBlockTypeToCleanup,
|
||||
addMessageToCleanup,
|
||||
@@ -13,7 +13,6 @@ import {
|
||||
sharedTestTeardown,
|
||||
workspaceTeardown,
|
||||
} from './test_helpers/setup_teardown.js';
|
||||
import {createDeprecationWarningStub} from './test_helpers/warnings.js';
|
||||
|
||||
suite('Abstract Fields', function () {
|
||||
setup(function () {
|
||||
|
||||
@@ -4,18 +4,18 @@
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
import {assert} from '../../node_modules/chai/chai.js';
|
||||
import * as Blockly from '../../build/src/core/blockly.js';
|
||||
import {assert} from '../../node_modules/chai/chai.js';
|
||||
import {
|
||||
createTestBlock,
|
||||
defineRowBlock,
|
||||
} from './test_helpers/block_definitions.js';
|
||||
import {
|
||||
assertFieldValue,
|
||||
runConstructorSuiteTests,
|
||||
runFromJsonSuiteTests,
|
||||
runSetValueTests,
|
||||
} from './test_helpers/fields.js';
|
||||
import {
|
||||
createTestBlock,
|
||||
defineRowBlock,
|
||||
} from './test_helpers/block_definitions.js';
|
||||
import {
|
||||
sharedTestSetup,
|
||||
sharedTestTeardown,
|
||||
|
||||
@@ -4,8 +4,12 @@
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
import {assert} from '../../node_modules/chai/chai.js';
|
||||
import * as Blockly from '../../build/src/core/blockly.js';
|
||||
import {assert} from '../../node_modules/chai/chai.js';
|
||||
import {
|
||||
createTestBlock,
|
||||
defineRowBlock,
|
||||
} from './test_helpers/block_definitions.js';
|
||||
import {
|
||||
assertFieldValue,
|
||||
runConstructorSuiteTests,
|
||||
@@ -18,10 +22,6 @@ import {
|
||||
sharedTestTeardown,
|
||||
workspaceTeardown,
|
||||
} from './test_helpers/setup_teardown.js';
|
||||
import {
|
||||
createTestBlock,
|
||||
defineRowBlock,
|
||||
} from './test_helpers/block_definitions.js';
|
||||
|
||||
suite('Variable Fields', function () {
|
||||
const FAKE_VARIABLE_NAME = 'default_name';
|
||||
|
||||
@@ -10,16 +10,8 @@ import {
|
||||
sharedTestTeardown,
|
||||
workspaceTeardown,
|
||||
} from './test_helpers/setup_teardown.js';
|
||||
import {defineStackBlock} from './test_helpers/block_definitions.js';
|
||||
import {
|
||||
getBasicToolbox,
|
||||
getChildItem,
|
||||
getCollapsibleItem,
|
||||
getDeeplyNestedJSON,
|
||||
getInjectedToolbox,
|
||||
getNonCollapsibleItem,
|
||||
getProperSimpleJson,
|
||||
getSeparator,
|
||||
getSimpleJson,
|
||||
getXmlArray,
|
||||
} from './test_helpers/toolbox_definitions.js';
|
||||
|
||||
@@ -4,13 +4,13 @@
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
import {assert} from '../../node_modules/chai/chai.js';
|
||||
import * as Blockly from '../../build/src/core/blockly.js';
|
||||
import {DartGenerator} from '../../build/src/generators/dart/dart_generator.js';
|
||||
import {JavascriptGenerator} from '../../build/src/generators/javascript/javascript_generator.js';
|
||||
import {LuaGenerator} from '../../build/src/generators/lua/lua_generator.js';
|
||||
import {PhpGenerator} from '../../build/src/generators/php/php_generator.js';
|
||||
import {PythonGenerator} from '../../build/src/generators/python/python_generator.js';
|
||||
import {assert} from '../../node_modules/chai/chai.js';
|
||||
import {
|
||||
sharedTestSetup,
|
||||
sharedTestTeardown,
|
||||
|
||||
@@ -4,15 +4,15 @@
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
import {EventType} from '../../build/src/core/events/type.js';
|
||||
import {assert} from '../../node_modules/chai/chai.js';
|
||||
import {assertEventFired, assertEventNotFired} from './test_helpers/events.js';
|
||||
import {defineBasicBlockWithField} from './test_helpers/block_definitions.js';
|
||||
import {dispatchPointerEvent} from './test_helpers/user_input.js';
|
||||
import * as eventUtils from '../../build/src/core/events/utils.js';
|
||||
import {assertEventFired, assertEventNotFired} from './test_helpers/events.js';
|
||||
import {
|
||||
sharedTestSetup,
|
||||
sharedTestTeardown,
|
||||
} from './test_helpers/setup_teardown.js';
|
||||
import {dispatchPointerEvent} from './test_helpers/user_input.js';
|
||||
|
||||
suite('Gesture', function () {
|
||||
function testGestureIsFieldClick(block, isFieldClick, eventsFireStub) {
|
||||
@@ -39,11 +39,11 @@ suite('Gesture', function () {
|
||||
assertEventFired(
|
||||
eventsFireStub,
|
||||
Blockly.Events.Selected,
|
||||
{newElementId: block.id, type: eventUtils.SELECTED},
|
||||
{newElementId: block.id, type: EventType.SELECTED},
|
||||
fieldWorkspace.id,
|
||||
);
|
||||
assertEventNotFired(eventsFireStub, Blockly.Events.Click, {
|
||||
type: eventUtils.CLICK,
|
||||
type: EventType.CLICK,
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@@ -5,12 +5,12 @@
|
||||
*/
|
||||
|
||||
import {assert} from '../../node_modules/chai/chai.js';
|
||||
import {defineEmptyBlock} from './test_helpers/block_definitions.js';
|
||||
import {MockIcon, MockSerializableIcon} from './test_helpers/icon_mocks.js';
|
||||
import {
|
||||
sharedTestSetup,
|
||||
sharedTestTeardown,
|
||||
} from './test_helpers/setup_teardown.js';
|
||||
import {defineEmptyBlock} from './test_helpers/block_definitions.js';
|
||||
import {MockIcon, MockSerializableIcon} from './test_helpers/icon_mocks.js';
|
||||
|
||||
suite('Icon', function () {
|
||||
setup(function () {
|
||||
|
||||
@@ -5,15 +5,15 @@
|
||||
*/
|
||||
|
||||
import {assert} from '../../node_modules/chai/chai.js';
|
||||
import {
|
||||
sharedTestSetup,
|
||||
sharedTestTeardown,
|
||||
} from './test_helpers/setup_teardown.js';
|
||||
import {
|
||||
defineRowBlock,
|
||||
defineRowToStackBlock,
|
||||
defineStackBlock,
|
||||
} from './test_helpers/block_definitions.js';
|
||||
import {
|
||||
sharedTestSetup,
|
||||
sharedTestTeardown,
|
||||
} from './test_helpers/setup_teardown.js';
|
||||
|
||||
suite('Insertion marker manager', function () {
|
||||
setup(function () {
|
||||
|
||||
@@ -4,18 +4,17 @@
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
import {EventType} from '../../build/src/core/events/type.js';
|
||||
import {assert} from '../../node_modules/chai/chai.js';
|
||||
import {
|
||||
sharedTestSetup,
|
||||
sharedTestTeardown,
|
||||
workspaceTeardown,
|
||||
} from './test_helpers/setup_teardown.js';
|
||||
import {assertEventFired} from './test_helpers/events.js';
|
||||
import * as eventUtils from '../../build/src/core/events/utils.js';
|
||||
import {
|
||||
MockParameterModel,
|
||||
MockProcedureModel,
|
||||
} from './test_helpers/procedures.js';
|
||||
import {
|
||||
sharedTestSetup,
|
||||
sharedTestTeardown,
|
||||
} from './test_helpers/setup_teardown.js';
|
||||
|
||||
suite('JSO Deserialization', function () {
|
||||
setup(function () {
|
||||
@@ -67,7 +66,7 @@ suite('JSO Deserialization', function () {
|
||||
assertEventFired(
|
||||
this.eventsFireStub,
|
||||
Blockly.Events.FinishedLoading,
|
||||
{type: eventUtils.FINISHED_LOADING},
|
||||
{type: EventType.FINISHED_LOADING},
|
||||
this.workspace.id,
|
||||
);
|
||||
});
|
||||
@@ -90,7 +89,7 @@ suite('JSO Deserialization', function () {
|
||||
assertEventFired(
|
||||
this.eventsFireStub,
|
||||
Blockly.Events.FinishedLoading,
|
||||
{'group': 'my group', 'type': eventUtils.FINISHED_LOADING},
|
||||
{'group': 'my group', 'type': EventType.FINISHED_LOADING},
|
||||
this.workspace.id,
|
||||
);
|
||||
});
|
||||
@@ -145,7 +144,7 @@ suite('JSO Deserialization', function () {
|
||||
'varId': 'testId',
|
||||
'varType': '',
|
||||
'recordUndo': false,
|
||||
'type': eventUtils.VAR_CREATE,
|
||||
'type': EventType.VAR_CREATE,
|
||||
},
|
||||
this.workspace.id,
|
||||
);
|
||||
@@ -171,7 +170,7 @@ suite('JSO Deserialization', function () {
|
||||
'varId': 'testId',
|
||||
'varType': '',
|
||||
'recordUndo': true,
|
||||
'type': eventUtils.VAR_CREATE,
|
||||
'type': EventType.VAR_CREATE,
|
||||
},
|
||||
this.workspace.id,
|
||||
);
|
||||
@@ -196,7 +195,7 @@ suite('JSO Deserialization', function () {
|
||||
'varId': 'testId',
|
||||
'varType': '',
|
||||
'group': 'my group',
|
||||
'type': eventUtils.VAR_CREATE,
|
||||
'type': EventType.VAR_CREATE,
|
||||
},
|
||||
this.workspace.id,
|
||||
);
|
||||
@@ -261,7 +260,7 @@ suite('JSO Deserialization', function () {
|
||||
'varName': 'test',
|
||||
'varId': 'testId',
|
||||
'varType': '',
|
||||
'type': eventUtils.VAR_CREATE,
|
||||
'type': EventType.VAR_CREATE,
|
||||
},
|
||||
this.workspace.id,
|
||||
);
|
||||
@@ -287,7 +286,7 @@ suite('JSO Deserialization', function () {
|
||||
assertEventFired(
|
||||
this.eventsFireStub,
|
||||
Blockly.Events.BlockCreate,
|
||||
{'recordUndo': false, 'type': eventUtils.BLOCK_CREATE},
|
||||
{'recordUndo': false, 'type': EventType.BLOCK_CREATE},
|
||||
this.workspace.id,
|
||||
'testId',
|
||||
);
|
||||
@@ -312,7 +311,7 @@ suite('JSO Deserialization', function () {
|
||||
assertEventFired(
|
||||
this.eventsFireStub,
|
||||
Blockly.Events.BlockCreate,
|
||||
{'recordUndo': true, 'type': eventUtils.BLOCK_CREATE},
|
||||
{'recordUndo': true, 'type': EventType.BLOCK_CREATE},
|
||||
this.workspace.id,
|
||||
'testId',
|
||||
);
|
||||
@@ -336,7 +335,7 @@ suite('JSO Deserialization', function () {
|
||||
assertEventFired(
|
||||
this.eventsFireStub,
|
||||
Blockly.Events.BlockCreate,
|
||||
{'group': 'my group', 'type': eventUtils.BLOCK_CREATE},
|
||||
{'group': 'my group', 'type': EventType.BLOCK_CREATE},
|
||||
this.workspace.id,
|
||||
'testId',
|
||||
);
|
||||
@@ -398,7 +397,7 @@ suite('JSO Deserialization', function () {
|
||||
assertEventFired(
|
||||
this.eventsFireStub,
|
||||
Blockly.Events.BlockCreate,
|
||||
{type: eventUtils.BLOCK_CREATE},
|
||||
{type: EventType.BLOCK_CREATE},
|
||||
this.workspace.id,
|
||||
'id1',
|
||||
);
|
||||
@@ -436,7 +435,7 @@ suite('JSO Deserialization', function () {
|
||||
assertEventFired(
|
||||
this.eventsFireStub,
|
||||
Blockly.Events.BlockCreate,
|
||||
{'recordUndo': true, 'type': eventUtils.BLOCK_CREATE},
|
||||
{'recordUndo': true, 'type': EventType.BLOCK_CREATE},
|
||||
this.workspace.id,
|
||||
'testId',
|
||||
);
|
||||
@@ -454,7 +453,7 @@ suite('JSO Deserialization', function () {
|
||||
assertEventFired(
|
||||
this.eventsFireStub,
|
||||
Blockly.Events.BlockCreate,
|
||||
{'group': 'my group', 'type': eventUtils.BLOCK_CREATE},
|
||||
{'group': 'my group', 'type': EventType.BLOCK_CREATE},
|
||||
this.workspace.id,
|
||||
'testId',
|
||||
);
|
||||
|
||||
@@ -4,14 +4,8 @@
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
import {assert} from '../../node_modules/chai/chai.js';
|
||||
import * as Blockly from '../../build/src/core/blockly.js';
|
||||
import {
|
||||
createGenUidStubWithReturns,
|
||||
sharedTestSetup,
|
||||
sharedTestTeardown,
|
||||
workspaceTeardown,
|
||||
} from './test_helpers/setup_teardown.js';
|
||||
import {assert} from '../../node_modules/chai/chai.js';
|
||||
import {
|
||||
defineRowBlock,
|
||||
defineStackBlock,
|
||||
@@ -21,6 +15,12 @@ import {
|
||||
MockParameterModel,
|
||||
MockProcedureModel,
|
||||
} from './test_helpers/procedures.js';
|
||||
import {
|
||||
createGenUidStubWithReturns,
|
||||
sharedTestSetup,
|
||||
sharedTestTeardown,
|
||||
workspaceTeardown,
|
||||
} from './test_helpers/setup_teardown.js';
|
||||
|
||||
suite('JSO Serialization', function () {
|
||||
setup(function () {
|
||||
|
||||
@@ -5,12 +5,12 @@
|
||||
*/
|
||||
|
||||
import * as Blockly from '../../build/src/core/blockly.js';
|
||||
import {createKeyDownEvent} from './test_helpers/user_input.js';
|
||||
import {defineStackBlock} from './test_helpers/block_definitions.js';
|
||||
import {
|
||||
sharedTestSetup,
|
||||
sharedTestTeardown,
|
||||
} from './test_helpers/setup_teardown.js';
|
||||
import {createKeyDownEvent} from './test_helpers/user_input.js';
|
||||
|
||||
suite('Key Down', function () {
|
||||
setup(function () {
|
||||
|
||||
@@ -5,15 +5,15 @@
|
||||
*/
|
||||
|
||||
import {assert} from '../../node_modules/chai/chai.js';
|
||||
import {
|
||||
sharedTestSetup,
|
||||
sharedTestTeardown,
|
||||
} from './test_helpers/setup_teardown.js';
|
||||
import {
|
||||
createRenderedBlock,
|
||||
defineMutatorBlocks,
|
||||
} from './test_helpers/block_definitions.js';
|
||||
import {assertEventFired, assertEventNotFired} from './test_helpers/events.js';
|
||||
import {
|
||||
sharedTestSetup,
|
||||
sharedTestTeardown,
|
||||
} from './test_helpers/setup_teardown.js';
|
||||
|
||||
suite('Mutator', function () {
|
||||
setup(function () {
|
||||
|
||||
@@ -5,16 +5,11 @@
|
||||
*/
|
||||
|
||||
import {assert} from '../../node_modules/chai/chai.js';
|
||||
import {MockProcedureModel} from './test_helpers/procedures.js';
|
||||
import {
|
||||
sharedTestSetup,
|
||||
sharedTestTeardown,
|
||||
} from './test_helpers/setup_teardown.js';
|
||||
import {
|
||||
assertEventFiredShallow,
|
||||
assertEventNotFired,
|
||||
createChangeListenerSpy,
|
||||
} from './test_helpers/events.js';
|
||||
import {MockProcedureModel} from './test_helpers/procedures.js';
|
||||
|
||||
suite('Procedure Map', function () {
|
||||
setup(function () {
|
||||
|
||||
@@ -5,11 +5,11 @@
|
||||
*/
|
||||
|
||||
import {assert} from '../../node_modules/chai/chai.js';
|
||||
import {assertWarnings} from './test_helpers/warnings.js';
|
||||
import {
|
||||
sharedTestSetup,
|
||||
sharedTestTeardown,
|
||||
} from './test_helpers/setup_teardown.js';
|
||||
import {assertWarnings} from './test_helpers/warnings.js';
|
||||
|
||||
suite('Registry', function () {
|
||||
const TestClass = function () {};
|
||||
|
||||
@@ -4,8 +4,8 @@
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
import {assert} from '../../node_modules/chai/chai.js';
|
||||
import * as Blockly from '../../build/src/core/blockly.js';
|
||||
import {assert} from '../../node_modules/chai/chai.js';
|
||||
import {
|
||||
TestCase,
|
||||
TestSuite,
|
||||
|
||||
@@ -5,11 +5,11 @@
|
||||
*/
|
||||
|
||||
import {assert} from '../../node_modules/chai/chai.js';
|
||||
import {createKeyDownEvent} from './test_helpers/user_input.js';
|
||||
import {
|
||||
sharedTestSetup,
|
||||
sharedTestTeardown,
|
||||
} from './test_helpers/setup_teardown.js';
|
||||
import {createKeyDownEvent} from './test_helpers/user_input.js';
|
||||
|
||||
suite('Keyboard Shortcut Registry Test', function () {
|
||||
setup(function () {
|
||||
|
||||
@@ -4,9 +4,9 @@
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
import {assert} from '../../../node_modules/chai/chai.js';
|
||||
import {ConnectionType} from '../../../build/src/core/connection_type.js';
|
||||
import {VariableModel} from '../../../build/src/core/variable_model.js';
|
||||
import {assert} from '../../../node_modules/chai/chai.js';
|
||||
|
||||
/**
|
||||
* Asserts that the procedure definition or call block has the expected var
|
||||
|
||||
@@ -4,11 +4,11 @@
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
import * as eventUtils from '../../../build/src/core/events/utils.js';
|
||||
import {assert} from '../../../node_modules/chai/chai.js';
|
||||
import {workspaceTeardown} from './setup_teardown.js';
|
||||
import {assertVariableValues} from './variables.js';
|
||||
import {assertWarnings} from './warnings.js';
|
||||
import * as eventUtils from '../../../build/src/core/events/utils.js';
|
||||
import {workspaceTeardown} from './setup_teardown.js';
|
||||
|
||||
export function testAWorkspace() {
|
||||
setup(function () {
|
||||
|
||||
@@ -4,9 +4,9 @@
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
import {EventType} from '../../build/src/core/events/type.js';
|
||||
import {assert} from '../../node_modules/chai/chai.js';
|
||||
import {assertEventFired} from './test_helpers/events.js';
|
||||
import * as eventUtils from '../../build/src/core/events/utils.js';
|
||||
import {
|
||||
sharedTestSetup,
|
||||
sharedTestTeardown,
|
||||
@@ -153,7 +153,7 @@ suite('Theme', function () {
|
||||
assertEventFired(
|
||||
this.eventsFireStub,
|
||||
Blockly.Events.ThemeChange,
|
||||
{themeName: 'themeName', type: eventUtils.THEME_CHANGE},
|
||||
{themeName: 'themeName', type: EventType.THEME_CHANGE},
|
||||
workspace.id,
|
||||
);
|
||||
} finally {
|
||||
|
||||
@@ -4,12 +4,9 @@
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
import {EventType} from '../../build/src/core/events/type.js';
|
||||
import * as eventUtils from '../../build/src/core/events/utils.js';
|
||||
import {assert} from '../../node_modules/chai/chai.js';
|
||||
import {assertEventFired, assertEventNotFired} from './test_helpers/events.js';
|
||||
import {
|
||||
sharedTestSetup,
|
||||
sharedTestTeardown,
|
||||
} from './test_helpers/setup_teardown.js';
|
||||
import {
|
||||
defineBasicBlockWithField,
|
||||
defineMutatorBlocks,
|
||||
@@ -17,7 +14,11 @@ import {
|
||||
defineStackBlock,
|
||||
defineStatementBlock,
|
||||
} from './test_helpers/block_definitions.js';
|
||||
import * as eventUtils from '../../build/src/core/events/utils.js';
|
||||
import {assertEventFired, assertEventNotFired} from './test_helpers/events.js';
|
||||
import {
|
||||
sharedTestSetup,
|
||||
sharedTestTeardown,
|
||||
} from './test_helpers/setup_teardown.js';
|
||||
import {simulateClick} from './test_helpers/user_input.js';
|
||||
|
||||
suite('Trashcan', function () {
|
||||
@@ -91,12 +92,12 @@ suite('Trashcan', function () {
|
||||
simulateClick(this.trashcan.svgGroup);
|
||||
|
||||
assertEventNotFired(this.eventsFireStub, Blockly.Events.TrashcanOpen, {
|
||||
type: eventUtils.CLICK,
|
||||
type: EventType.CLICK,
|
||||
});
|
||||
assertEventFired(
|
||||
this.eventsFireStub,
|
||||
Blockly.Events.Click,
|
||||
{targetType: 'workspace', type: eventUtils.CLICK},
|
||||
{targetType: 'workspace', type: EventType.CLICK},
|
||||
this.workspace.id,
|
||||
undefined,
|
||||
);
|
||||
@@ -114,11 +115,11 @@ suite('Trashcan', function () {
|
||||
assertEventFired(
|
||||
this.eventsFireStub,
|
||||
Blockly.Events.TrashcanOpen,
|
||||
{isOpen: true, type: eventUtils.TRASHCAN_OPEN},
|
||||
{isOpen: true, type: EventType.TRASHCAN_OPEN},
|
||||
this.workspace.id,
|
||||
);
|
||||
assertEventNotFired(this.eventsFireStub, Blockly.Events.Click, {
|
||||
type: eventUtils.TRASHCAN_OPEN,
|
||||
type: EventType.TRASHCAN_OPEN,
|
||||
});
|
||||
});
|
||||
test('Click outside trashcan - fires trashcanClose', function () {
|
||||
@@ -133,13 +134,13 @@ suite('Trashcan', function () {
|
||||
assertEventFired(
|
||||
this.eventsFireStub,
|
||||
Blockly.Events.TrashcanOpen,
|
||||
{isOpen: false, type: eventUtils.TRASHCAN_OPEN},
|
||||
{isOpen: false, type: EventType.TRASHCAN_OPEN},
|
||||
this.workspace.id,
|
||||
);
|
||||
assertEventFired(
|
||||
this.eventsFireStub,
|
||||
Blockly.Events.Click,
|
||||
{targetType: 'workspace', type: eventUtils.CLICK},
|
||||
{targetType: 'workspace', type: EventType.CLICK},
|
||||
this.workspace.id,
|
||||
undefined,
|
||||
);
|
||||
|
||||
@@ -5,17 +5,17 @@
|
||||
*/
|
||||
|
||||
import {assert} from '../../node_modules/chai/chai.js';
|
||||
import {assertVariableValues} from './test_helpers/variables.js';
|
||||
import {
|
||||
createGenUidStubWithReturns,
|
||||
sharedTestSetup,
|
||||
sharedTestTeardown,
|
||||
} from './test_helpers/setup_teardown.js';
|
||||
import {
|
||||
assertEventFired,
|
||||
assertEventNotFired,
|
||||
createChangeListenerSpy,
|
||||
} from './test_helpers/events.js';
|
||||
import {
|
||||
createGenUidStubWithReturns,
|
||||
sharedTestSetup,
|
||||
sharedTestTeardown,
|
||||
} from './test_helpers/setup_teardown.js';
|
||||
import {assertVariableValues} from './test_helpers/variables.js';
|
||||
|
||||
suite('Variable Map', function () {
|
||||
setup(function () {
|
||||
|
||||
@@ -4,14 +4,14 @@
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
import {
|
||||
assertEventFired,
|
||||
createChangeListenerSpy,
|
||||
} from './test_helpers/events.js';
|
||||
import {
|
||||
sharedTestSetup,
|
||||
sharedTestTeardown,
|
||||
} from './test_helpers/setup_teardown.js';
|
||||
import {
|
||||
createChangeListenerSpy,
|
||||
assertEventFired,
|
||||
} from './test_helpers/events.js';
|
||||
|
||||
suite('Workspace comment', function () {
|
||||
setup(function () {
|
||||
|
||||
@@ -4,15 +4,14 @@
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
import {EventType} from '../../build/src/core/events/type.js';
|
||||
import {assert} from '../../node_modules/chai/chai.js';
|
||||
import {defineStackBlock} from './test_helpers/block_definitions.js';
|
||||
import {
|
||||
assertEventFired,
|
||||
assertEventNotFired,
|
||||
createChangeListenerSpy,
|
||||
} from './test_helpers/events.js';
|
||||
import {assertVariableValues} from './test_helpers/variables.js';
|
||||
import {defineStackBlock} from './test_helpers/block_definitions.js';
|
||||
import * as eventUtils from '../../build/src/core/events/utils.js';
|
||||
import {
|
||||
sharedTestSetup,
|
||||
sharedTestTeardown,
|
||||
@@ -188,7 +187,7 @@ suite('WorkspaceSvg', function () {
|
||||
oldScale: 1,
|
||||
viewTop: metrics.viewTop,
|
||||
viewLeft: metrics.viewLeft,
|
||||
type: eventUtils.VIEWPORT_CHANGE,
|
||||
type: EventType.VIEWPORT_CHANGE,
|
||||
};
|
||||
assertSpyFiredViewportEvent(
|
||||
changeListenerSpy,
|
||||
@@ -351,7 +350,7 @@ suite('WorkspaceSvg', function () {
|
||||
assertEventNotFired(
|
||||
this.changeListenerSpy,
|
||||
Blockly.Events.ViewportChange,
|
||||
{type: eventUtils.VIEWPORT_CHANGE},
|
||||
{type: EventType.VIEWPORT_CHANGE},
|
||||
);
|
||||
});
|
||||
test("domToWorkspace at 0,0 that doesn't trigger scroll", function () {
|
||||
@@ -378,7 +377,7 @@ suite('WorkspaceSvg', function () {
|
||||
assertEventNotFired(
|
||||
this.changeListenerSpy,
|
||||
Blockly.Events.ViewportChange,
|
||||
{type: eventUtils.VIEWPORT_CHANGE},
|
||||
{type: EventType.VIEWPORT_CHANGE},
|
||||
);
|
||||
});
|
||||
test.skip('domToWorkspace multiple blocks triggers one viewport event', function () {
|
||||
|
||||
@@ -4,11 +4,9 @@
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
import {assertVariableValues} from './test_helpers/variables.js';
|
||||
import {
|
||||
sharedTestSetup,
|
||||
sharedTestTeardown,
|
||||
workspaceTeardown,
|
||||
} from './test_helpers/setup_teardown.js';
|
||||
import {testAWorkspace} from './test_helpers/workspace.js';
|
||||
|
||||
|
||||
@@ -4,9 +4,9 @@
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
import {EventType} from '../../build/src/core/events/type.js';
|
||||
import {assert} from '../../node_modules/chai/chai.js';
|
||||
import {assertEventFired, assertEventNotFired} from './test_helpers/events.js';
|
||||
import * as eventUtils from '../../build/src/core/events/utils.js';
|
||||
import {
|
||||
sharedTestSetup,
|
||||
sharedTestTeardown,
|
||||
@@ -35,13 +35,13 @@ suite('Zoom Controls', function () {
|
||||
assertEventFired(
|
||||
this.eventsFireStub,
|
||||
Blockly.Events.Click,
|
||||
{targetType: 'zoom_controls', type: eventUtils.CLICK},
|
||||
{targetType: 'zoom_controls', type: EventType.CLICK},
|
||||
this.workspace.id,
|
||||
undefined,
|
||||
);
|
||||
assertEventNotFired(this.eventsFireStub, Blockly.Events.Click, {
|
||||
targetType: 'workspace',
|
||||
type: eventUtils.CLICK,
|
||||
type: EventType.CLICK,
|
||||
});
|
||||
assert.closeTo(this.workspace.getScale(), 1.2, 0.05);
|
||||
});
|
||||
@@ -51,13 +51,13 @@ suite('Zoom Controls', function () {
|
||||
assertEventFired(
|
||||
this.eventsFireStub,
|
||||
Blockly.Events.Click,
|
||||
{targetType: 'zoom_controls', type: eventUtils.CLICK},
|
||||
{targetType: 'zoom_controls', type: EventType.CLICK},
|
||||
this.workspace.id,
|
||||
undefined,
|
||||
);
|
||||
assertEventNotFired(this.eventsFireStub, Blockly.Events.Click, {
|
||||
targetType: 'workspace',
|
||||
type: eventUtils.CLICK,
|
||||
type: EventType.CLICK,
|
||||
});
|
||||
assert.closeTo(this.workspace.getScale(), 0.8, 0.05);
|
||||
});
|
||||
@@ -67,13 +67,13 @@ suite('Zoom Controls', function () {
|
||||
assertEventFired(
|
||||
this.eventsFireStub,
|
||||
Blockly.Events.Click,
|
||||
{targetType: 'zoom_controls', type: eventUtils.CLICK},
|
||||
{targetType: 'zoom_controls', type: EventType.CLICK},
|
||||
this.workspace.id,
|
||||
undefined,
|
||||
);
|
||||
assertEventNotFired(this.eventsFireStub, Blockly.Events.Click, {
|
||||
targetType: 'workspace',
|
||||
type: eventUtils.CLICK,
|
||||
type: EventType.CLICK,
|
||||
});
|
||||
assert.equal(this.workspace.getScale(), 1);
|
||||
});
|
||||
|
||||
@@ -22,9 +22,9 @@ console.log(process.cwd());
|
||||
// copied when packaged), resulting in require() looking for the
|
||||
// compressed bundles in the wrong place.
|
||||
|
||||
import {assert} from 'chai';
|
||||
import * as Blockly from 'blockly-test';
|
||||
import {javascriptGenerator} from 'blockly-test/javascript';
|
||||
import {assert} from 'chai';
|
||||
|
||||
const xmlText =
|
||||
'<xml xmlns="https://developers.google.com/blockly/xml">\n' +
|
||||
|
||||
@@ -4,12 +4,14 @@
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
/* eslint-disable */
|
||||
|
||||
import * as Blockly from 'blockly-test/core';
|
||||
import {JavascriptGenerator} from 'blockly-test/javascript';
|
||||
import {PhpGenerator, phpGenerator, Order} from 'blockly-test/php';
|
||||
import {LuaGenerator} from 'blockly-test/lua';
|
||||
import {PythonGenerator} from 'blockly-test/python';
|
||||
import {DartGenerator} from 'blockly-test/dart';
|
||||
import {JavascriptGenerator} from 'blockly-test/javascript';
|
||||
import {LuaGenerator} from 'blockly-test/lua';
|
||||
import {Order, PhpGenerator, phpGenerator} from 'blockly-test/php';
|
||||
import {PythonGenerator} from 'blockly-test/python';
|
||||
|
||||
JavascriptGenerator;
|
||||
PhpGenerator;
|
||||
|
||||
@@ -10,7 +10,7 @@ import * as Blockly from 'blockly-test/core';
|
||||
* Test: should be able to import a generator instance, class, and
|
||||
* Order enum.
|
||||
*/
|
||||
import {phpGenerator, PhpGenerator, Order} from 'blockly-test/php';
|
||||
import {Order, phpGenerator, PhpGenerator} from 'blockly-test/php';
|
||||
|
||||
/**
|
||||
* Test: should be able to create a simple block generator function,
|
||||
|
||||
@@ -10,7 +10,7 @@ import * as Blockly from 'blockly-test/core';
|
||||
* Test: should be able to import a generator instance, class, and
|
||||
* Order enum.
|
||||
*/
|
||||
import {pythonGenerator, PythonGenerator, Order} from 'blockly-test/python';
|
||||
import {Order, pythonGenerator, PythonGenerator} from 'blockly-test/python';
|
||||
|
||||
/**
|
||||
* Test: should be able to create a simple block generator function,
|
||||
|
||||
Reference in New Issue
Block a user