Skip to content
Snippets Groups Projects
Unverified Commit 4a528bb9 authored by Paul Kaplan's avatar Paul Kaplan Committed by GitHub
Browse files

Merge pull request #978 from paulkaplan/fix-only-sprite-failure

Fix only sprite failure
parents deea05a9 11c81624
No related branches found
No related tags found
No related merge requests found
...@@ -67,7 +67,11 @@ export default function (vm) { ...@@ -67,7 +67,11 @@ export default function (vm) {
const cloneMenu = function () { const cloneMenu = function () {
if (vm.editingTarget && vm.editingTarget.isStage) { if (vm.editingTarget && vm.editingTarget.isStage) {
return spriteMenu(); const menu = spriteMenu();
if (menu.length === 0) {
return [['', '']]; // Empty menu matches Scratch 2 behavior
}
return menu;
} }
return [['myself', '_myself_']].concat(spriteMenu()); return [['myself', '_myself_']].concat(spriteMenu());
}; };
......
...@@ -163,4 +163,18 @@ describe('costumes, sounds and variables', () => { ...@@ -163,4 +163,18 @@ describe('costumes, sounds and variables', () => {
const logs = await getLogs(errorWhitelist); const logs = await getLogs(errorWhitelist);
await expect(logs).toEqual([]); await expect(logs).toEqual([]);
}); });
test('Deleting only sprite does not crash', async () => {
const spriteTileContext = '*[starts-with(@class,"react-contextmenu-wrapper")]';
await loadUri(uri);
await new Promise(resolve => setTimeout(resolve, 1000)); // Wait for scroll animation
await rightClickText('Sprite1', spriteTileContext);
await clickText('delete', spriteTileContext);
await driver.switchTo().alert()
.accept();
// Confirm that the stage has been switched to
await findByText('Stage selected: no motion blocks');
const logs = await getLogs(errorWhitelist);
await expect(logs).toEqual([]);
});
}); });
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment