From 58499cec737a2faeb725208bb339c8a4c843a668 Mon Sep 17 00:00:00 2001
From: Eric Rosenbaum <eric.rosenbaum@gmail.com>
Date: Tue, 30 Jul 2019 14:57:25 -0400
Subject: [PATCH] Add integration test for sound editor keyboard shortcuts

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

diff --git a/test/integration/sounds.test.js b/test/integration/sounds.test.js
index 62bbd5085..e564f511a 100644
--- a/test/integration/sounds.test.js
+++ b/test/integration/sounds.test.js
@@ -1,5 +1,6 @@
 import path from 'path';
 import SeleniumHelper from '../helpers/selenium-helper';
+import {Key} from 'selenium-webdriver';
 
 const {
     clickText,
@@ -166,4 +167,21 @@ describe('Working with sounds', () => {
         const logs = await getLogs();
         await expect(logs).toEqual([]);
     });
+
+    test.only('Keyboard shortcuts', async () => {
+        await loadUri(uri);
+        await clickText('Sounds');
+        const el = await findByXpath('//button[@aria-label="Choose a Sound"]');
+        await el.sendKeys(Key.chord(Key.COMMAND, 'a')); // Select all
+        await findByText('0.85', scope.soundsTab); // Meow sound duration
+        await el.sendKeys(Key.DELETE);
+        await findByText('0.00', scope.soundsTab); // Sound is now empty
+        await el.sendKeys(Key.chord(Key.COMMAND, 'z')); // undo
+        await findByText('0.85', scope.soundsTab); // Meow sound is back
+        await el.sendKeys(Key.chord(Key.COMMAND, Key.SHIFT, 'z')); // redo
+        await findByText('0.00', scope.soundsTab); // Sound is empty again
+
+        const logs = await getLogs();
+        await expect(logs).toEqual([]);
+    });
 });
-- 
GitLab