Anatoly Pulyaevskiy 5 years ago
parent
commit
b83949b491

+ 1
- 0
packages/notus/tool/travis.sh View File

5
 pub get
5
 pub get
6
 pub run test -r expanded
6
 pub run test -r expanded
7
 dartfmt -n --set-exit-if-changed lib/
7
 dartfmt -n --set-exit-if-changed lib/
8
+dartfmt -n --set-exit-if-changed test/
8
 dartanalyzer --fatal-infos --fatal-warnings .
9
 dartanalyzer --fatal-infos --fatal-warnings .
9
 pub run test_coverage
10
 pub run test_coverage

+ 1
- 1
packages/zefyr/test/rendering/render_zefyr_paragraph_test.dart View File

38
       expect(renderContext.active, contains(p));
38
       expect(renderContext.active, contains(p));
39
     }, skip: 'TODO: move to RenderEditableProxyBox');
39
     }, skip: 'TODO: move to RenderEditableProxyBox');
40
   });
40
   });
41
-}
41
+}

+ 3
- 8
packages/zefyr/test/widgets/controller_test.dart View File

58
       expect(notified, isTrue);
58
       expect(notified, isTrue);
59
       var expectedSelection = TextSelection.collapsed(offset: 10);
59
       var expectedSelection = TextSelection.collapsed(offset: 10);
60
       expect(controller.selection, expectedSelection);
60
       expect(controller.selection, expectedSelection);
61
-      expect(
62
-          controller.document.toDelta(), Delta()..insert('More Words\n'));
61
+      expect(controller.document.toDelta(), Delta()..insert('More Words\n'));
63
       expect(controller.lastChangeSource, ChangeSource.remote);
62
       expect(controller.lastChangeSource, ChangeSource.remote);
64
     });
63
     });
65
 
64
 
86
       expect(notified, isTrue);
85
       expect(notified, isTrue);
87
       expect(
86
       expect(
88
         controller.document.toDelta(),
87
         controller.document.toDelta(),
89
-        Delta()
90
-          ..insert('Words', NotusAttribute.bold.toJson())
91
-          ..insert('\n'),
88
+        Delta()..insert('Words', NotusAttribute.bold.toJson())..insert('\n'),
92
       );
89
       );
93
       expect(controller.lastChangeSource, ChangeSource.local);
90
       expect(controller.lastChangeSource, ChangeSource.local);
94
     });
91
     });
104
       expect(notified, isTrue);
101
       expect(notified, isTrue);
105
       expect(
102
       expect(
106
         controller.document.toDelta(),
103
         controller.document.toDelta(),
107
-        Delta()
108
-          ..insert('Words', NotusAttribute.bold.toJson())
109
-          ..insert('\n'),
104
+        Delta()..insert('Words', NotusAttribute.bold.toJson())..insert('\n'),
110
       );
105
       );
111
       expect(controller.lastChangeSource, ChangeSource.local);
106
       expect(controller.lastChangeSource, ChangeSource.local);
112
     });
107
     });

+ 1
- 2
packages/zefyr/test/widgets/editor_test.dart View File

20
         ..insert('\n');
20
         ..insert('\n');
21
       var doc = NotusDocument.fromDelta(delta);
21
       var doc = NotusDocument.fromDelta(delta);
22
       var theme = ZefyrThemeData(linkStyle: TextStyle(color: Colors.red));
22
       var theme = ZefyrThemeData(linkStyle: TextStyle(color: Colors.red));
23
-      var editor =
24
-          EditorSandBox(tester: tester, document: doc, theme: theme);
23
+      var editor = EditorSandBox(tester: tester, document: doc, theme: theme);
25
       await editor.pumpAndTap();
24
       await editor.pumpAndTap();
26
       // TODO: figure out why this extra pump is needed here
25
       // TODO: figure out why this extra pump is needed here
27
       await tester.pumpAndSettle();
26
       await tester.pumpAndSettle();

+ 1
- 2
packages/zefyr/test/widgets/horizontal_rule_test.dart View File

48
       expect(editor.selection.extentOffset, embed.documentOffset + 1);
48
       expect(editor.selection.extentOffset, embed.documentOffset + 1);
49
     });
49
     });
50
 
50
 
51
-    testWidgets('selects on long press',
52
-        (tester) async {
51
+    testWidgets('selects on long press', (tester) async {
53
       final editor = EditorSandBox(tester: tester);
52
       final editor = EditorSandBox(tester: tester);
54
       await editor.pumpAndTap();
53
       await editor.pumpAndTap();
55
       await editor.tapButtonWithIcon(Icons.remove);
54
       await editor.tapButtonWithIcon(Icons.remove);

+ 1
- 2
packages/zefyr/test/widgets/rich_text_test.dart View File

27
 
27
 
28
     testWidgets('initialize', (tester) async {
28
     testWidgets('initialize', (tester) async {
29
       await tester.pumpWidget(widget);
29
       await tester.pumpWidget(widget);
30
-      ZefyrRichText result =
31
-          tester.firstWidget(find.byType(ZefyrRichText));
30
+      ZefyrRichText result = tester.firstWidget(find.byType(ZefyrRichText));
32
       expect(result, isNotNull);
31
       expect(result, isNotNull);
33
       expect(result.text.text, 'This House Is A Circus');
32
       expect(result.text.text, 'This House Is A Circus');
34
     });
33
     });

+ 1
- 2
packages/zefyr/test/widgets/selection_test.dart View File

37
     testWidgets('tap on padding area finds closest paragraph', (tester) async {
37
     testWidgets('tap on padding area finds closest paragraph', (tester) async {
38
       final editor = EditorSandBox(tester: tester);
38
       final editor = EditorSandBox(tester: tester);
39
       await editor.pumpAndTap();
39
       await editor.pumpAndTap();
40
-      editor.controller
41
-          .updateSelection(TextSelection.collapsed(offset: 10));
40
+      editor.controller.updateSelection(TextSelection.collapsed(offset: 10));
42
       await tester.pumpAndSettle();
41
       await tester.pumpAndSettle();
43
       expect(editor.controller.selection.extentOffset, 10);
42
       expect(editor.controller.selection.extentOffset, 10);
44
 
43
 

+ 3
- 0
packages/zefyr/tool/travis.sh View File

3
 set -e
3
 set -e
4
 
4
 
5
 $TRAVIS_BUILD_DIR/flutter/bin/flutter test
5
 $TRAVIS_BUILD_DIR/flutter/bin/flutter test
6
+
7
+dartfmt -n --set-exit-if-changed lib/
8
+dartfmt -n --set-exit-if-changed test/