Skip to content

Commit 58499ce

Browse files
committed
Add integration test for sound editor keyboard shortcuts
1 parent 2890609 commit 58499ce

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

test/integration/sounds.test.js

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import path from 'path';
22
import SeleniumHelper from '../helpers/selenium-helper';
3+
import {Key} from 'selenium-webdriver';
34

45
const {
56
clickText,
@@ -166,4 +167,21 @@ describe('Working with sounds', () => {
166167
const logs = await getLogs();
167168
await expect(logs).toEqual([]);
168169
});
170+
171+
test.only('Keyboard shortcuts', async () => {
172+
await loadUri(uri);
173+
await clickText('Sounds');
174+
const el = await findByXpath('//button[@aria-label="Choose a Sound"]');
175+
await el.sendKeys(Key.chord(Key.COMMAND, 'a')); // Select all
176+
await findByText('0.85', scope.soundsTab); // Meow sound duration
177+
await el.sendKeys(Key.DELETE);
178+
await findByText('0.00', scope.soundsTab); // Sound is now empty
179+
await el.sendKeys(Key.chord(Key.COMMAND, 'z')); // undo
180+
await findByText('0.85', scope.soundsTab); // Meow sound is back
181+
await el.sendKeys(Key.chord(Key.COMMAND, Key.SHIFT, 'z')); // redo
182+
await findByText('0.00', scope.soundsTab); // Sound is empty again
183+
184+
const logs = await getLogs();
185+
await expect(logs).toEqual([]);
186+
});
169187
});

0 commit comments

Comments
 (0)