fix tests
This commit is contained in:
@@ -3,7 +3,6 @@ analyzer:
|
||||
- lib/**/*.g.dart
|
||||
- lib/**/*.freezed.dart
|
||||
- example/*
|
||||
- test/*
|
||||
linter:
|
||||
rules:
|
||||
- always_use_package_imports
|
||||
|
||||
@@ -223,7 +223,10 @@ void main() {
|
||||
final mockDio = MockDio();
|
||||
final mockUploader = MockAttachmentUploader();
|
||||
|
||||
const file = AttachmentFile(path: 'filePath/fileName.pdf');
|
||||
const file = AttachmentFile(
|
||||
path: 'filePath/fileName.pdf',
|
||||
size: 100,
|
||||
);
|
||||
const channelId = 'testId';
|
||||
const channelType = 'messaging';
|
||||
|
||||
@@ -262,7 +265,10 @@ void main() {
|
||||
final mockDio = MockDio();
|
||||
final mockUploader = MockAttachmentUploader();
|
||||
|
||||
const image = AttachmentFile(path: 'imagePath/imageName.jpeg');
|
||||
const image = AttachmentFile(
|
||||
path: 'imagePath/imageName.jpeg',
|
||||
size: 100,
|
||||
);
|
||||
const channelId = 'testId';
|
||||
const channelType = 'messaging';
|
||||
|
||||
|
||||
@@ -861,10 +861,10 @@ void main() {
|
||||
DateTime.parse('2019-04-03T18:43:33.213374Z'));
|
||||
expect(channelState.channel?.createdBy, isA<User>());
|
||||
expect(channelState.channel?.frozen, true);
|
||||
expect(channelState.channel?.extraData!['example'], 1);
|
||||
expect(channelState.channel?.extraData!['name'], '#dev');
|
||||
expect(channelState.channel?.extraData['example'], 1);
|
||||
expect(channelState.channel?.extraData['name'], '#dev');
|
||||
expect(
|
||||
channelState.channel?.extraData!['image'],
|
||||
channelState.channel?.extraData['image'],
|
||||
'https://cdn.chrisshort.net/testing-certificate-chains-in-go/GOPHER_MIC_DROP.png',
|
||||
);
|
||||
expect(channelState.messages, hasLength(25));
|
||||
|
||||
@@ -20,8 +20,8 @@ void main() {
|
||||
expect(channel.id, equals('test'));
|
||||
expect(channel.type, equals('livestream'));
|
||||
expect(channel.cid, equals('livestream:test'));
|
||||
expect(channel.extraData!['cats'], equals(true));
|
||||
expect(channel.extraData!['fruit'], equals(['bananas', 'apples']));
|
||||
expect(channel.extraData['cats'], equals(true));
|
||||
expect(channel.extraData['fruit'], equals(['bananas', 'apples']));
|
||||
});
|
||||
|
||||
test('should serialize to json correctly', () {
|
||||
|
||||
@@ -1,8 +1,7 @@
|
||||
import 'dart:io';
|
||||
|
||||
import 'package:rxdart/rxdart.dart';
|
||||
import 'package:test/test.dart';
|
||||
import 'package:stream_chat/version.dart';
|
||||
import 'package:test/test.dart';
|
||||
|
||||
void prepareTest() {
|
||||
// https://github.com/flutter/flutter/issues/20907
|
||||
@@ -14,10 +13,11 @@ void prepareTest() {
|
||||
void main() {
|
||||
prepareTest();
|
||||
test('stream chat version matches pubspec', () {
|
||||
final String pubspecPath = '${Directory.current.path}/pubspec.yaml';
|
||||
final String pubspec = File(pubspecPath).readAsStringSync();
|
||||
final RegExp regex = RegExp('version:\s*(.*)');
|
||||
final RegExpMatch? match = regex.firstMatch(pubspec);
|
||||
final pubspecPath = '${Directory.current.path}/pubspec.yaml';
|
||||
final pubspec = File(pubspecPath).readAsStringSync();
|
||||
// ignore: unnecessary_string_escapes
|
||||
final regex = RegExp('version:\s*(.*)');
|
||||
final match = regex.firstMatch(pubspec);
|
||||
expect(match, isNotNull);
|
||||
expect(PACKAGE_VERSION, match?.group(1)?.trim());
|
||||
});
|
||||
|
||||
@@ -168,7 +168,12 @@ void main() {
|
||||
// Should match with the inserted channels
|
||||
final updatedChannels = await channelQueryDao.getChannels(
|
||||
filter: filter,
|
||||
sort: [SortOption('member_count', comparator: sortComparator)],
|
||||
sort: [
|
||||
SortOption(
|
||||
'member_count',
|
||||
comparator: sortComparator,
|
||||
)
|
||||
],
|
||||
);
|
||||
|
||||
expect(updatedChannels.length, insertedChannels.length);
|
||||
|
||||
Reference in New Issue
Block a user