mirror of
https://github.com/scratchfoundation/scratch-vm.git
synced 2025-03-13 17:04:39 -04:00
add unit test for loading draggability
to serialization_sb3.js
This commit is contained in:
parent
040aeaa44e
commit
7a9bea5007
1 changed files with 12 additions and 0 deletions
|
@ -9,6 +9,7 @@ const commentsSB3ProjectPath = path.resolve(__dirname, '../fixtures/comments.sb3
|
|||
const commentsSB3NoDupeIds = path.resolve(__dirname, '../fixtures/comments_no_duplicate_id_serialization.sb3');
|
||||
const variableReporterSB2ProjectPath = path.resolve(__dirname, '../fixtures/top-level-variable-reporter.sb2');
|
||||
const topLevelReportersProjectPath = path.resolve(__dirname, '../fixtures/top-level-reporters.sb3');
|
||||
const draggableSB3ProjectPath = path.resolve(__dirname, '../fixtures/draggable.sb3');
|
||||
const FakeRenderer = require('../fixtures/fake-renderer');
|
||||
|
||||
test('serialize', t => {
|
||||
|
@ -288,3 +289,14 @@ test('(#1608) serializeBlocks maintains top level variable reporters', t => {
|
|||
t.end();
|
||||
});
|
||||
});
|
||||
|
||||
test('(#1850) sprite draggability state read when loading SB3 file', t => {
|
||||
const vm = new VirtualMachine();
|
||||
vm.loadProject(readFileToBuffer(draggableSB3ProjectPath))
|
||||
.then(() => {
|
||||
const sprite1Obj = vm.runtime.targets.find(target => target.sprite.name === 'Sprite1')
|
||||
// Sprite1 in project should have draggable set to true
|
||||
t.equal(sprite1Obj.draggable, true);
|
||||
t.end();
|
||||
});
|
||||
});
|
||||
|
|
Loading…
Reference in a new issue