You've already forked joplin
mirror of
https://github.com/laurent22/joplin.git
synced 2025-07-16 00:14:34 +02:00
Desktop: Accessibility: Improve focus handling for plugin and prompt dialogs (#10801)
This commit is contained in:
52
packages/app-desktop/integration-tests/goToAnything.spec.ts
Normal file
52
packages/app-desktop/integration-tests/goToAnything.spec.ts
Normal file
@ -0,0 +1,52 @@
|
||||
|
||||
import { test, expect } from './util/test';
|
||||
import MainScreen from './models/MainScreen';
|
||||
|
||||
test.describe('goToAnything', () => {
|
||||
test('clicking outside of go to anything should close it', async ({ electronApp, mainWindow }) => {
|
||||
const mainScreen = new MainScreen(mainWindow);
|
||||
await mainScreen.noteEditor.waitFor();
|
||||
const goToAnything = mainScreen.goToAnything;
|
||||
await goToAnything.open(electronApp);
|
||||
|
||||
await goToAnything.expectToBeOpen();
|
||||
|
||||
// Click outside of the dialog
|
||||
await goToAnything.containerLocator.click({ position: { x: 0, y: 0 } });
|
||||
|
||||
await goToAnything.expectToBeClosed();
|
||||
});
|
||||
|
||||
test('pressing escape in go to anything should close it ', async ({ electronApp, mainWindow }) => {
|
||||
const mainScreen = new MainScreen(mainWindow);
|
||||
const goToAnything = mainScreen.goToAnything;
|
||||
|
||||
// Pressing Escape to close the dialog should work even if opened multiple times in a row.
|
||||
for (let i = 0; i < 3; i++) {
|
||||
await goToAnything.open(electronApp);
|
||||
|
||||
await goToAnything.expectToBeOpen();
|
||||
await goToAnything.inputLocator.press('Escape');
|
||||
await goToAnything.expectToBeClosed();
|
||||
}
|
||||
});
|
||||
|
||||
test('should be possible to show the set tags dialog from goToAnything', async ({ electronApp, mainWindow }) => {
|
||||
const mainScreen = new MainScreen(mainWindow);
|
||||
await mainScreen.createNewNote('Test note');
|
||||
|
||||
const goToAnything = mainScreen.goToAnything;
|
||||
await goToAnything.open(electronApp);
|
||||
await goToAnything.inputLocator.fill(':setTags');
|
||||
|
||||
// Should show a matching command
|
||||
await expect(goToAnything.containerLocator.getByText('Tags (setTags)')).toBeAttached();
|
||||
|
||||
await mainWindow.keyboard.press('Enter');
|
||||
await goToAnything.expectToBeClosed();
|
||||
|
||||
// Should show the "set tags" dialog
|
||||
const setTagsLabel = mainWindow.getByText('Add or remove tags:');
|
||||
await expect(setTagsLabel).toBeVisible();
|
||||
});
|
||||
});
|
Reference in New Issue
Block a user