Skip to content

Commit f5fc3e2

Browse files
committed
Fix Tests
• Changed how post notifications works in the previous commits. Also changed the type of tags from Map<dynamic, dynamic> to Map<String, dynamic>.
1 parent 65a479e commit f5fc3e2

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

test/mock_channel.dart

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ class OneSignalMockChannelController {
2424
state = OneSignalState();
2525
}
2626

27-
Future<Null> _handleMethod(MethodCall call) async {
27+
Future<dynamic> _handleMethod(MethodCall call) async {
2828
print("Mock method called: ${call.method}");
2929
switch (call.method) {
3030
case "OneSignal#init":
@@ -59,10 +59,10 @@ class OneSignalMockChannelController {
5959
break;
6060
case "OneSignal#sendTags":
6161
this.state.tags = call.arguments;
62-
break;
62+
return {"success" : true};
6363
case "OneSignal#deleteTags":
6464
this.state.deleteTags = call.arguments;
65-
break;
65+
return {"success" : true};
6666
}
6767
}
6868
}

test/onesignal_test.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ void main() {
5555
});
5656

5757
test ('post notification', () {
58-
onesignal.postNotification({"content_available" : true, "include_player_ids" : [testPlayerId]}).then(expectAsync1((v) {
58+
onesignal.postNotificationWithJson({"content_available" : true, "include_player_ids" : [testPlayerId]}).then(expectAsync1((v) {
5959
expect(channelController.state.postNotificationJson['content_available'], true);
6060
expect(channelController.state.postNotificationJson['include_player_ids'], [testPlayerId]);
6161
}));

0 commit comments

Comments
 (0)