@@ -55,6 +55,8 @@ void main() {
55
55
return controllerKey;
56
56
}
57
57
58
+ // TODO prepareComposeBoxWithNavigation
59
+
58
60
group ('ComposeContentController' , () {
59
61
group ('insertPadded' , () {
60
62
// Like `parseMarkedText` in test/model/autocomplete_test.dart,
@@ -198,16 +200,16 @@ void main() {
198
200
199
201
testWidgets ('$narrow : unfocusing content input stops previous typing notification' , (tester) async {
200
202
// TODO
201
- // await prepareComposeBox(tester, narrow: narrow);
203
+ await prepareComposeBox (tester, narrow: narrow);
202
204
203
- // connection.prepare(json: {});
204
- // await tester.enterText(contentInputFinder, 'hello world');
205
- // checkTypingRequest(TypingOp.start, narrow);
205
+ connection.prepare (json: {});
206
+ await tester.enterText (contentInputFinder, 'hello world' );
207
+ checkTypingRequest (TypingOp .start, narrow);
206
208
207
- // connection.prepare(json: {});
208
- // await tester.press (find.widgetWithIcon(IconButton, Icons.attach_file));
209
- // await tester.pump();
210
- // checkTypingRequest(TypingOp.stop, narrow);
209
+ connection.prepare (json: {});
210
+ await tester.tap (find.widgetWithIcon (IconButton , Icons .attach_file));
211
+ await tester.pump ();
212
+ checkTypingRequest (TypingOp .stop, narrow);
211
213
});
212
214
}
213
215
@@ -233,18 +235,24 @@ void main() {
233
235
234
236
testWidgets ('unfocusing content input stops previous typing notification' , (tester) async {
235
237
// TODO
236
- // const narrow = ChannelNarrow(123);
237
- // await prepareComposeBox(tester, narrow: narrow);
238
-
239
- // await tester.enterText(topicInputFinder, 'topic');
240
- // // Clean an irrelevant topic request.
241
- // check(connection.takePreviousRequests()).single
242
- // ..method.equals('GET')
243
- // ..url.path.equals('/api/v1/users/me/123/topics');
244
-
245
- // connection.prepare(json: {});
246
- // await tester.enterText(contentInputFinder, 'hello world');
247
- // checkTypingRequest(TypingOp.start, TopicNarrow(narrow.streamId, 'topic'));
238
+ const narrow = ChannelNarrow (123 );
239
+ await prepareComposeBox (tester, narrow: narrow);
240
+
241
+ await tester.enterText (topicInputFinder, 'topic' );
242
+ // Clean an irrelevant topic request.
243
+ check (connection.takePreviousRequests ()).single
244
+ ..method.equals ('GET' )
245
+ ..url.path.equals ('/api/v1/users/me/123/topics' );
246
+
247
+ connection.prepare (json: {});
248
+ await tester.enterText (contentInputFinder, 'hello world' );
249
+ checkTypingRequest (TypingOp .start, TopicNarrow (narrow.streamId, 'topic' ));
250
+
251
+ connection.prepare (json: {});
252
+ // await tester.enterText(topicInputFinder, 'asd');
253
+ await tester.tap (topicInputFinder);
254
+ await tester.pump ();
255
+ checkTypingRequest (TypingOp .stop, TopicNarrow (narrow.streamId, 'topic' ));
248
256
});
249
257
});
250
258
0 commit comments