35 lines
1.0 KiB
Dart
35 lines
1.0 KiB
Dart
import 'package:flutter_test/flutter_test.dart';
|
|
import 'package:yumi/shared/business_logic/models/res/sc_room_emoji_res.dart';
|
|
|
|
void main() {
|
|
test(
|
|
'room emoji response accepts numeric metadata and network resources',
|
|
() {
|
|
final group = SCRoomEmojiRes.fromJson({
|
|
'id': 123,
|
|
'groupCode': 'vip',
|
|
'groupName': 'VIP',
|
|
'cover': 'https://example.com/group.png',
|
|
'have': 1,
|
|
'amount': '10',
|
|
'emojis': [
|
|
{
|
|
'sourceUrl': 'https://example.com/emoji.svga',
|
|
'sourceType': '2',
|
|
'coverUrl': 'https://example.com/emoji.png',
|
|
'type': 'SVGA',
|
|
},
|
|
],
|
|
});
|
|
|
|
expect(group.id, '123');
|
|
expect(group.have, isTrue);
|
|
expect(group.amount, 10);
|
|
expect(group.emojis, hasLength(1));
|
|
expect(group.emojis!.single.sourceType, 2);
|
|
expect(group.emojis!.single.sourceUrl, 'https://example.com/emoji.svga');
|
|
expect(group.emojis!.single.coverUrl, 'https://example.com/emoji.png');
|
|
},
|
|
);
|
|
}
|