fix tests

This commit is contained in:
Deven Joshi
2021-11-01 18:40:07 +05:30
parent 4b6879650d
commit a4e6f152cb
9 changed files with 23 additions and 18 deletions
@@ -118,9 +118,9 @@ void main() {
setUpAll(() { setUpAll(() {
// Fallback values // Fallback values
registerFallbackValue<Message>(FakeMessage()); registerFallbackValue(FakeMessage());
registerFallbackValue<List<Message>>(<Message>[]); registerFallbackValue(<Message>[]);
registerFallbackValue<AttachmentFile>(FakeAttachmentFile()); registerFallbackValue(FakeAttachmentFile());
// detached loggers // detached loggers
when(() => client.detachedLogger(any())).thenAnswer((invocation) { when(() => client.detachedLogger(any())).thenAnswer((invocation) {
@@ -176,9 +176,9 @@ void main() {
setUpAll(() { setUpAll(() {
// Fallback values // Fallback values
registerFallbackValue<Message>(FakeMessage()); registerFallbackValue(FakeMessage());
registerFallbackValue<AttachmentFile>(FakeAttachmentFile()); registerFallbackValue(FakeAttachmentFile());
registerFallbackValue<Event>(FakeEvent()); registerFallbackValue(FakeEvent());
// detached loggers // detached loggers
when(() => client.detachedLogger(any())).thenAnswer((invocation) { when(() => client.detachedLogger(any())).thenAnswer((invocation) {
@@ -31,7 +31,7 @@ void main() {
setUpAll(() { setUpAll(() {
// fallback values // fallback values
registerFallbackValue<User>(FakeUser()); registerFallbackValue(FakeUser());
}); });
setUp(() { setUp(() {
@@ -230,7 +230,7 @@ void main() {
setUpAll(() { setUpAll(() {
// fallback values // fallback values
registerFallbackValue<User>(FakeUser()); registerFallbackValue(FakeUser());
}); });
setUp(() { setUp(() {
@@ -311,7 +311,7 @@ void main() {
setUpAll(() { setUpAll(() {
// fallback values // fallback values
registerFallbackValue<User>(FakeUser()); registerFallbackValue(FakeUser());
}); });
setUp(() { setUp(() {
@@ -399,7 +399,7 @@ void main() {
setUpAll(() { setUpAll(() {
// fallback values // fallback values
registerFallbackValue<User>(FakeUser()); registerFallbackValue(FakeUser());
}); });
setUp(() { setUp(() {
@@ -523,9 +523,9 @@ void main() {
setUpAll(() { setUpAll(() {
// fallback values // fallback values
registerFallbackValue<Event>(FakeEvent()); registerFallbackValue(FakeEvent());
registerFallbackValue<PaginationParams>(const PaginationParams()); registerFallbackValue(const PaginationParams());
registerFallbackValue<ChannelState>(FakeChannelState()); registerFallbackValue(FakeChannelState());
}); });
setUp(() async { setUp(() async {
@@ -827,9 +827,9 @@ void main() {
setUpAll(() { setUpAll(() {
// fallback values // fallback values
registerFallbackValue<Event>(FakeEvent()); registerFallbackValue(FakeEvent());
registerFallbackValue<Message>(FakeMessage()); registerFallbackValue(FakeMessage());
registerFallbackValue<PaginationParams>(const PaginationParams()); registerFallbackValue(const PaginationParams());
}); });
setUp(() async { setUp(() async {
@@ -15,7 +15,7 @@ void main() {
setUp(() { setUp(() {
fileUploader = StreamAttachmentFileUploader(client); fileUploader = StreamAttachmentFileUploader(client);
registerFallbackValue<MultipartFile>(FakeMultiPartFile()); registerFallbackValue(FakeMultiPartFile());
}); });
Response successResponse(String path, {Object? data}) => Response( Response successResponse(String path, {Object? data}) => Response(
@@ -2,6 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be // Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file. // found in the LICENSE file.
import 'dart:async';
import 'dart:ui'; import 'dart:ui';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
@@ -3,6 +3,7 @@
// found in the LICENSE file. // found in the LICENSE file.
import 'dart:ui'; import 'dart:ui';
import 'dart:async';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter_test/flutter_test.dart'; import 'package:flutter_test/flutter_test.dart';
@@ -2,6 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be // Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file. // found in the LICENSE file.
import 'dart:async';
import 'dart:math'; import 'dart:math';
import 'dart:ui'; import 'dart:ui';
@@ -2,6 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be // Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file. // found in the LICENSE file.
import 'dart:async';
import 'dart:ui'; import 'dart:ui';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
@@ -2,6 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be // Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file. // found in the LICENSE file.
import 'dart:async';
import 'dart:ui'; import 'dart:ui';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
@@ -10,7 +10,7 @@ import 'mocks.dart';
void main() { void main() {
setUpAll(() { setUpAll(() {
registerFallbackValue<PaginationParams>(const PaginationParams()); registerFallbackValue(const PaginationParams());
}); });
List<Channel> _generateChannels( List<Channel> _generateChannels(