From 8485a47f9bef6ccd1d5991f97c6268730b313284 Mon Sep 17 00:00:00 2001
From: Paul Kaplan <pkaplan@media.mit.edu>
Date: Thu, 17 Jan 2019 09:06:30 -0500
Subject: [PATCH] Add an integration test for using the X button to delete a
 sprite

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

diff --git a/test/integration/sprites.test.js b/test/integration/sprites.test.js
index 178fb6b98..a3dd48cf4 100644
--- a/test/integration/sprites.test.js
+++ b/test/integration/sprites.test.js
@@ -76,6 +76,17 @@ describe('Working with sprites', () => {
         await expect(logs).toEqual([]);
     });
 
+    test('Deleting by x button on sprite tile', async () => {
+        await loadUri(uri);
+        await clickXpath('//button[@title="Try It"]');
+        await new Promise(resolve => setTimeout(resolve, 1000)); // Wait for scroll animation
+        await clickXpath('//*[@aria-label="Close"]'); // Only visible close button is on the sprite
+        // Confirm that the stage has been switched to
+        await findByText('Stage selected: no motion blocks');
+        const logs = await getLogs();
+        await expect(logs).toEqual([]);
+    });
+
     test('Adding a sprite by uploading a png', async () => {
         await loadUri(uri);
         await clickXpath('//button[@title="Try It"]');
-- 
GitLab