Selaa lähdekoodia

Fixed test and adjusted dependency to work with current Flutter beta

Anatoly Pulyaevskiy 7 vuotta sitten
vanhempi
commit
9294db171c

+ 1
- 1
packages/zefyr/pubspec.yaml Näytä tiedosto

16
 dev_dependencies:
16
 dev_dependencies:
17
   flutter_test:
17
   flutter_test:
18
     sdk: flutter
18
     sdk: flutter
19
-  test: ^0.12.41
19
+  test: ^0.12.37

+ 10
- 3
packages/zefyr/test/widgets/editable_text_test.dart Näytä tiedosto

1
 // Copyright (c) 2018, the Zefyr project authors.  Please see the AUTHORS file
1
 // Copyright (c) 2018, the Zefyr project authors.  Please see the AUTHORS file
2
 // for details. All rights reserved. Use of this source code is governed by a
2
 // for details. All rights reserved. Use of this source code is governed by a
3
 // BSD-style license that can be found in the LICENSE file.
3
 // BSD-style license that can be found in the LICENSE file.
4
+import 'package:flutter/widgets.dart';
4
 import 'package:flutter_test/flutter_test.dart';
5
 import 'package:flutter_test/flutter_test.dart';
5
 import 'package:zefyr/zefyr.dart';
6
 import 'package:zefyr/zefyr.dart';
6
 
7
 
11
     testWidgets('user input', (tester) async {
12
     testWidgets('user input', (tester) async {
12
       final editor = new EditorSandBox(tester: tester);
13
       final editor = new EditorSandBox(tester: tester);
13
       await editor.tapEditor();
14
       await editor.tapEditor();
14
-      await enterText(tester, 'Test');
15
-      expect(editor.document.toPlainText(), startsWith('Test'));
15
+      final currentValue = editor.document.toPlainText();
16
+      await enterText(tester, 'Added $currentValue');
17
+      expect(editor.document.toPlainText(), 'Added This House Is A Circus\n');
16
     });
18
     });
17
   });
19
   });
18
 }
20
 }
19
 
21
 
20
 Future<Null> enterText(WidgetTester tester, String text) async {
22
 Future<Null> enterText(WidgetTester tester, String text) async {
21
   return TestAsyncUtils.guard(() async {
23
   return TestAsyncUtils.guard(() async {
22
-    tester.testTextInput.enterText(text);
24
+    tester.testTextInput.updateEditingValue(
25
+      new TextEditingValue(
26
+        text: text,
27
+        selection: new TextSelection.collapsed(offset: 6),
28
+      ),
29
+    );
23
     await tester.idle();
30
     await tester.idle();
24
   });
31
   });
25
 }
32
 }