Initial commit of 001code-html Scratch frontend project.
Includes scratch-gui, scratch-vm, scratch-blocks, scratch-render, scratch-l10n, and deployment config. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
33
scratch-vm/test/integration/tw_allow_drop_anywhere.js
Normal file
33
scratch-vm/test/integration/tw_allow_drop_anywhere.js
Normal file
@@ -0,0 +1,33 @@
|
||||
const {test} = require('tap');
|
||||
const Runtime = require('../../src/engine/runtime');
|
||||
const BlockType = require('../../src/extension-support/block-type');
|
||||
|
||||
test('allowDropAnywhere', t => {
|
||||
t.plan(2);
|
||||
|
||||
const rt = new Runtime();
|
||||
|
||||
rt.on('EXTENSION_ADDED', json => {
|
||||
t.equal(json.blocks[0].json.output, 'String');
|
||||
t.equal(json.blocks[1].json.output, null);
|
||||
t.end();
|
||||
});
|
||||
|
||||
rt._registerExtensionPrimitives({
|
||||
id: 'testextension',
|
||||
name: 'test',
|
||||
blocks: [
|
||||
{
|
||||
opcode: 'drop1',
|
||||
text: 'drop not anywhere',
|
||||
blockType: BlockType.REPORTER
|
||||
},
|
||||
{
|
||||
opcode: 'drop2',
|
||||
text: 'drop anywhere',
|
||||
blockType: BlockType.REPORTER,
|
||||
allowDropAnywhere: true
|
||||
}
|
||||
]
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user