Skip to content

Commit

Permalink
test: pump and settle
Browse files Browse the repository at this point in the history
  • Loading branch information
Xazin committed Jun 21, 2024
1 parent 43ec450 commit 985b7a2
Showing 1 changed file with 8 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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);
Expand All @@ -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);
Expand All @@ -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);
Expand Down

0 comments on commit 985b7a2

Please sign in to comment.