From e501b15bb50748f06b211404bc80e0d89f2228a9 Mon Sep 17 00:00:00 2001
From: Paul Kaplan <pkaplan@media.mit.edu>
Date: Thu, 3 May 2018 11:22:07 -0400
Subject: [PATCH] Add an integration test for bitmap vector conversion

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

diff --git a/test/integration/costumes.test.js b/test/integration/costumes.test.js
index bb4ee08c4..04a0f338c 100644
--- a/test/integration/costumes.test.js
+++ b/test/integration/costumes.test.js
@@ -64,4 +64,28 @@ describe('Working with costumes', () => {
         const logs = await getLogs();
         await expect(logs).toEqual([]);
     });
+
+    test('Converting bitmap/vector in paint editor', async () => {
+        await loadUri(uri);
+        await clickXpath('//button[@title="tryit"]');
+        await clickText('Costumes');
+
+        // Convert the first costume to bitmap.
+        await clickText('costume1', scope.costumesTab);
+        await clickText('Convert to Bitmap', scope.costumesTab);
+
+        // Make sure mode switches back to vector for vector costume.
+        await clickText('costume2', scope.costumesTab);
+        await clickText('Convert to Bitmap', scope.costumesTab);
+
+        // Make sure bitmap is saved by switching back and converting to vector.
+        await clickText('Sounds');
+        await clickText('Costumes');
+        await clickText('Convert to Vector', scope.costumesTab); // costume2
+        await clickText('costume1', scope.costumesTab);
+        await clickText('Convert to Vector', scope.costumesTab);
+
+        const logs = await getLogs();
+        await expect(logs).toEqual([]);
+    });
 });
-- 
GitLab