You've already forked joplin
mirror of
https://github.com/laurent22/joplin.git
synced 2025-08-10 22:11:50 +02:00
Chore: Mobile: Fix "missing act()
" warning (#12476)
This commit is contained in:
@@ -143,6 +143,12 @@ const openEditor = async () => {
|
||||
await expectToBeEditing(true);
|
||||
};
|
||||
|
||||
const runEditorCommand = async (commandName: string) => {
|
||||
await act(() => {
|
||||
return CommandService.instance().execute(commandName);
|
||||
});
|
||||
};
|
||||
|
||||
describe('screens/Note', () => {
|
||||
beforeEach(async () => {
|
||||
await setupDatabaseAndSynchronizer(1);
|
||||
@@ -340,9 +346,9 @@ describe('screens/Note', () => {
|
||||
render(<WrappedNoteScreen />);
|
||||
|
||||
await expectToBeEditing(false);
|
||||
await CommandService.instance().execute('toggleVisiblePanes');
|
||||
await runEditorCommand('toggleVisiblePanes');
|
||||
await expectToBeEditing(true);
|
||||
await CommandService.instance().execute('toggleVisiblePanes');
|
||||
await runEditorCommand('toggleVisiblePanes');
|
||||
await expectToBeEditing(false);
|
||||
});
|
||||
});
|
||||
|
Reference in New Issue
Block a user