From 2ded72b2f80837731e6968fd0a5ac1fe4927c65e Mon Sep 17 00:00:00 2001
From: Paul Kaplan <pkaplan@media.mit.edu>
Date: Mon, 7 May 2018 10:46:21 -0400
Subject: [PATCH] Add an integration test for surprise sounds

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

diff --git a/test/integration/sounds.test.js b/test/integration/sounds.test.js
index 44b670dd7..aa3790f95 100644
--- a/test/integration/sounds.test.js
+++ b/test/integration/sounds.test.js
@@ -25,7 +25,7 @@ describe('Working with sounds', () => {
         await driver.quit();
     });
 
-    test('Adding a sound', async () => {
+    test('Adding a sound through the library', async () => {
         await loadUri(uri);
         await clickXpath('//button[@title="tryit"]');
         await clickText('Sounds');
@@ -63,6 +63,19 @@ describe('Working with sounds', () => {
         await expect(logs).toEqual([]);
     });
 
+    test('Adding a sound by surprise button', async () => {
+        await loadUri(uri);
+        await clickXpath('//button[@title="tryit"]');
+        await clickText('Sounds');
+        const el = await findByXpath('//button[@aria-label="Choose a Sound"]');
+        await driver.actions().mouseMove(el)
+            .perform();
+        await driver.sleep(500); // Wait for thermometer menu to come up
+        await clickXpath('//button[@aria-label="Surprise"]');
+        const logs = await getLogs();
+        await expect(logs).toEqual([]);
+    });
+
     test('Duplicating a sound', async () => {
         await loadUri(uri);
         await clickXpath('//button[@title="tryit"]');
-- 
GitLab