feat(stream_chat): upgrade to null safe dependencies
This commit is contained in:
@@ -1,12 +1,12 @@
|
||||
import 'dart:convert';
|
||||
import 'package:stream_chat/src/models/attachment.dart';
|
||||
import 'package:stream_chat/src/models/action.dart';
|
||||
import 'dart:convert';
|
||||
|
||||
import 'package:test/test.dart';
|
||||
|
||||
void main() {
|
||||
group('src/models/attachment', () {
|
||||
const jsonExample = r'''{
|
||||
const jsonExample = '''{
|
||||
"type": "giphy",
|
||||
"title": "awesome",
|
||||
"title_link": "https://giphy.com/gifs/nrkp3-dance-happy-3o7TKnCdBx5cMg0qti",
|
||||
@@ -38,22 +38,27 @@ void main() {
|
||||
|
||||
test('should parse json correctly', () {
|
||||
final attachment = Attachment.fromJson(json.decode(jsonExample));
|
||||
expect(attachment.type, "giphy");
|
||||
expect(attachment.title, "awesome");
|
||||
expect(attachment.titleLink,
|
||||
"https://giphy.com/gifs/nrkp3-dance-happy-3o7TKnCdBx5cMg0qti");
|
||||
expect(attachment.thumbUrl,
|
||||
"https://media0.giphy.com/media/3o7TKnCdBx5cMg0qti/giphy.gif");
|
||||
expect(attachment.type, 'giphy');
|
||||
expect(attachment.title, 'awesome');
|
||||
expect(
|
||||
attachment.titleLink,
|
||||
'https://giphy.com/gifs/nrkp3-dance-happy-3o7TKnCdBx5cMg0qti',
|
||||
);
|
||||
expect(
|
||||
attachment.thumbUrl,
|
||||
'https://media0.giphy.com/media/3o7TKnCdBx5cMg0qti/giphy.gif',
|
||||
);
|
||||
expect(attachment.actions, hasLength(3));
|
||||
expect(attachment.actions[0], isA<Action>());
|
||||
});
|
||||
|
||||
test('should serialize to json correctly', () {
|
||||
final channel = Attachment(
|
||||
type: "image",
|
||||
title: "soo",
|
||||
titleLink:
|
||||
"https://giphy.com/gifs/nrkp3-dance-happy-3o7TKnCdBx5cMg0qti");
|
||||
type: 'image',
|
||||
title: 'soo',
|
||||
titleLink:
|
||||
'https://giphy.com/gifs/nrkp3-dance-happy-3o7TKnCdBx5cMg0qti',
|
||||
);
|
||||
|
||||
expect(
|
||||
channel.toJson(),
|
||||
|
||||
Reference in New Issue
Block a user