mirror of
https://github.com/laurent22/joplin.git
synced 2024-12-21 09:38:01 +02:00
13d8fbbd65
Co-authored-by: Laurent Cozic <laurent22@users.noreply.github.com>
27 lines
979 B
TypeScript
27 lines
979 B
TypeScript
|
|
import { test } from './util/test';
|
|
import MainScreen from './models/MainScreen';
|
|
|
|
test.describe('pluginApi', () => {
|
|
test('the editor.setText command should update the current note (use RTE: false)', async ({ startAppWithPlugins }) => {
|
|
const { app, mainWindow } = await startAppWithPlugins(['resources/test-plugins/execCommand.js']);
|
|
const mainScreen = await new MainScreen(mainWindow).setup();
|
|
await mainScreen.createNewNote('First note');
|
|
const editor = mainScreen.noteEditor;
|
|
|
|
await editor.focusCodeMirrorEditor();
|
|
await mainWindow.keyboard.type('This content should be overwritten.');
|
|
|
|
await editor.expectToHaveText('This content should be overwritten.');
|
|
await mainScreen.goToAnything.runCommand(app, 'testUpdateEditorText');
|
|
await editor.expectToHaveText('PASS');
|
|
|
|
// Should still have the same text after switching notes:
|
|
await mainScreen.createNewNote('Second note');
|
|
await editor.goBack();
|
|
|
|
await editor.expectToHaveText('PASS');
|
|
});
|
|
});
|
|
|