From 11c8162437e44d2fd9feda659e828418216279e4 Mon Sep 17 00:00:00 2001
From: Paul Kaplan <pkaplan@media.mit.edu>
Date: Thu, 30 Nov 2017 14:43:16 -0500
Subject: [PATCH] Add integration test for deleting the only sprite

---
 test/integration/test.js | 14 ++++++++++++++
 1 file changed, 14 insertions(+)

diff --git a/test/integration/test.js b/test/integration/test.js
index 57feb8e08..eaf11ead1 100644
--- a/test/integration/test.js
+++ b/test/integration/test.js
@@ -163,4 +163,18 @@ describe('costumes, sounds and variables', () => {
         const logs = await getLogs(errorWhitelist);
         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([]);
+    });
 });
-- 
GitLab