From 985b7a268d8a03f9ef5785fa851dae7e2f14b233 Mon Sep 17 00:00:00 2001 From: Mathias Mogensen Date: Fri, 21 Jun 2024 12:56:00 +0200 Subject: [PATCH] test: pump and settle --- .../shortcuts/character_shortcuts/undo_markdown_test.dart | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/test/new/editor_component/service/shortcuts/character_shortcuts/undo_markdown_test.dart b/test/new/editor_component/service/shortcuts/character_shortcuts/undo_markdown_test.dart index 3997be7ae..4bb8d84dc 100644 --- a/test/new/editor_component/service/shortcuts/character_shortcuts/undo_markdown_test.dart +++ b/test/new/editor_component/service/shortcuts/character_shortcuts/undo_markdown_test.dart @@ -18,6 +18,8 @@ void main() async { await editor.ime.typeText('_Hello world'); await editor.ime.typeText('_'); + await tester.pumpAndSettle(); + Delta delta = editor.nodeAtPath([0])!.delta!; expect(delta.length, 'Hello world'.length); expect(delta.first.attributes![AppFlowyRichTextKeys.italic], true); @@ -27,6 +29,8 @@ void main() async { await tester.sendKeyUpEvent(LogicalKeyboardKey.control); await tester.sendKeyUpEvent(LogicalKeyboardKey.keyZ); + await tester.pumpAndSettle(); + delta = editor.nodeAtPath([0])!.delta!; expect(delta.length, helloWorld.length); expect(delta.toPlainText(), helloWorld); @@ -45,6 +49,8 @@ void main() async { await editor.ime.typeText('__Hello world_'); await editor.ime.typeText('_'); + await tester.pumpAndSettle(); + Delta delta = editor.nodeAtPath([0])!.delta!; expect(delta.length, 'Hello world'.length); expect(delta.first.attributes![AppFlowyRichTextKeys.bold], true); @@ -54,6 +60,8 @@ void main() async { await tester.sendKeyUpEvent(LogicalKeyboardKey.control); await tester.sendKeyUpEvent(LogicalKeyboardKey.keyZ); + await tester.pumpAndSettle(); + delta = editor.nodeAtPath([0])!.delta!; expect(delta.length, helloWorld.length); expect(delta.toPlainText(), helloWorld);