fix(chat): allow empty poke messages

This commit is contained in:
Edison Jwa
2026-06-09 01:47:23 +09:00
parent 3462de1eee
commit eca77ece81
3 changed files with 222 additions and 5 deletions
@@ -60,4 +60,22 @@ void main() {
expect(specifics['groupKey'], 'chanora.pokes');
},
);
test('show uses fallback body for empty poke messages', () async {
final service = PokeNotificationService();
await service.show(
senderName: 'Alice',
message: ' ',
senderId: BigInt.from(42),
strength: rust.BridgePokeStrength.strong,
);
final showCall = calls.singleWhere((call) => call.method == 'show');
final arguments = Map<Object?, Object?>.from(showCall.arguments as Map);
expect(arguments['title'], 'Poke from Alice');
expect(arguments['body'], 'Alice pokes you');
expect(arguments['payload'], 'poke:42');
});
}