@@ -3,11 +3,31 @@ import 'package:http/http.dart' as http;
3
3
import 'package:flutter_test/flutter_test.dart' ;
4
4
import 'package:zulip/api/model/model.dart' ;
5
5
import 'package:zulip/api/route/users.dart' ;
6
+ import 'package:zulip/basic.dart' ;
6
7
7
8
import '../../stdlib_checks.dart' ;
8
9
import '../fake_api.dart' ;
9
10
10
11
void main () {
12
+ test ('smoke updateStatus' , () {
13
+ return FakeApiConnection .with_ ((connection) async {
14
+ connection.prepare (json: {});
15
+ await updateStatus (connection, change: UserStatusChange (
16
+ text: OptionSome ('Busy' ),
17
+ emoji: OptionSome (StatusEmoji (emojiName: 'working_on_it' ,
18
+ emojiCode: '1f6e0' , reactionType: ReactionType .unicodeEmoji))));
19
+ check (connection.takeRequests ()).single.isA< http.Request > ()
20
+ ..method.equals ('POST' )
21
+ ..url.path.equals ('/api/v1/users/me/status' )
22
+ ..bodyFields.deepEquals ({
23
+ 'status_text' : 'Busy' ,
24
+ 'emoji_name' : 'working_on_it' ,
25
+ 'emoji_code' : '1f6e0' ,
26
+ 'reaction_type' : 'unicode_emoji' ,
27
+ });
28
+ });
29
+ });
30
+
11
31
test ('smoke updatePresence' , () {
12
32
return FakeApiConnection .with_ ((connection) async {
13
33
final response = UpdatePresenceResult (
0 commit comments