@@ -63,6 +63,26 @@ Future<void> setupToMessageActionSheet(WidgetTester tester, {
63
63
void main () {
64
64
TestZulipBinding .ensureInitialized ();
65
65
66
+ void prepareRawContentResponseSuccess (PerAccountStore store, {
67
+ required Message message,
68
+ required String rawContent,
69
+ }) {
70
+ // Prepare fetch-raw-Markdown response
71
+ // TODO: Message should really only differ from `message`
72
+ // in its content / content_type, not in `id` or anything else.
73
+ (store.connection as FakeApiConnection ).prepare (json:
74
+ GetMessageResult (message: eg.streamMessage (contentMarkdown: rawContent)).toJson ());
75
+ }
76
+
77
+ void prepareRawContentResponseError (PerAccountStore store) {
78
+ final fakeResponseJson = {
79
+ 'code' : 'BAD_REQUEST' ,
80
+ 'msg' : 'Invalid message(s)' ,
81
+ 'result' : 'error' ,
82
+ };
83
+ (store.connection as FakeApiConnection ).prepare (httpStatus: 400 , json: fakeResponseJson);
84
+ }
85
+
66
86
group ('QuoteAndReplyButton' , () {
67
87
ComposeBoxController ? findComposeBoxController (WidgetTester tester) {
68
88
return tester.widget <ComposeBox >(find.byType (ComposeBox ))
@@ -73,26 +93,6 @@ void main() {
73
93
return tester.widgetList (find.byIcon (Icons .format_quote_outlined)).singleOrNull;
74
94
}
75
95
76
- void prepareRawContentResponseSuccess (PerAccountStore store, {
77
- required Message message,
78
- required String rawContent,
79
- }) {
80
- // Prepare fetch-raw-Markdown response
81
- // TODO: Message should really only differ from `message`
82
- // in its content / content_type, not in `id` or anything else.
83
- (store.connection as FakeApiConnection ).prepare (json:
84
- GetMessageResult (message: eg.streamMessage (contentMarkdown: rawContent)).toJson ());
85
- }
86
-
87
- void prepareRawContentResponseError (PerAccountStore store) {
88
- final fakeResponseJson = {
89
- 'code' : 'BAD_REQUEST' ,
90
- 'msg' : 'Invalid message(s)' ,
91
- 'result' : 'error' ,
92
- };
93
- (store.connection as FakeApiConnection ).prepare (httpStatus: 400 , json: fakeResponseJson);
94
- }
95
-
96
96
/// Simulates tapping the quote-and-reply button in the message action sheet.
97
97
///
98
98
/// Checks that there is a quote-and-reply button.
0 commit comments