Skip to content

Commit

Permalink
fix: run runner, remove metric client
Browse files Browse the repository at this point in the history
Signed-off-by: phuoc <[email protected]>
  • Loading branch information
phuocbitmark committed Feb 27, 2024
1 parent 0a1882b commit bb4bc3b
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 102 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -315,11 +315,18 @@ class MockFeralFileService extends _i1.Mock implements _i6.FeralFileService {
)),
) as _i7.Future<_i4.Artwork>);
@override
_i7.Future<_i9.File?> downloadFeralfileArtwork(_i10.AssetToken? assetToken) =>
_i7.Future<_i9.File?> downloadFeralfileArtwork(
_i10.AssetToken? assetToken, {
dynamic Function(
int,
int,
)? onReceiveProgress,
}) =>
(super.noSuchMethod(
Invocation.method(
#downloadFeralfileArtwork,
[assetToken],
{#onReceiveProgress: onReceiveProgress},
),
returnValue: _i7.Future<_i9.File?>.value(),
) as _i7.Future<_i9.File?>);
Expand Down
100 changes: 4 additions & 96 deletions test/generate_mock/service/mock_metric_client_service.mocks.dart
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
// ignore_for_file: no_leading_underscores_for_library_prefixes
import 'dart:async' as _i4;

import 'package:autonomy_flutter/database/entity/connection.dart' as _i5;
import 'package:autonomy_flutter/service/metric_client_service.dart' as _i3;
import 'package:autonomy_flutter/service/mix_panel_client_service.dart' as _i2;
import 'package:mockito/mockito.dart' as _i1;
Expand Down Expand Up @@ -41,14 +40,6 @@ class MockMetricClientService extends _i1.Mock
_i1.throwOnMissingStub(this);
}

@override
set useAppTimer(_i4.Timer? _useAppTimer) => super.noSuchMethod(
Invocation.setter(
#useAppTimer,
_useAppTimer,
),
returnValueForMissingStub: null,
);
@override
_i2.MixPanelClientService get mixPanelClient => (super.noSuchMethod(
Invocation.getter(#mixPanelClient),
Expand Down Expand Up @@ -80,39 +71,13 @@ class MockMetricClientService extends _i1.Mock
returnValueForMissingStub: _i4.Future<void>.value(),
) as _i4.Future<void>);
@override
_i4.Future<void> refreshNumberNfts() => (super.noSuchMethod(
Invocation.method(
#refreshNumberNfts,
[],
),
returnValue: _i4.Future<void>.value(),
returnValueForMissingStub: _i4.Future<void>.value(),
) as _i4.Future<void>);
@override
_i4.Future<void> addEvent(
String? name, {
String? message,
Map<String, dynamic>? data = const {},
Map<String, dynamic>? hashedData = const {},
}) =>
(super.noSuchMethod(
void timerEvent(String? name) => super.noSuchMethod(
Invocation.method(
#addEvent,
#timerEvent,
[name],
{
#message: message,
#data: data,
#hashedData: hashedData,
},
),
returnValue: _i4.Future<void>.value(),
returnValueForMissingStub: _i4.Future<void>.value(),
) as _i4.Future<void>);
@override
dynamic timerEvent(String? name) => super.noSuchMethod(Invocation.method(
#timerEvent,
[name],
));
returnValueForMissingStub: null,
);
@override
_i4.Future<void> sendAndClearMetrics() => (super.noSuchMethod(
Invocation.method(
Expand Down Expand Up @@ -156,45 +121,6 @@ class MockMetricClientService extends _i1.Mock
returnValueForMissingStub: null,
);
@override
void incrementPropertyLabel(
String? prop,
double? value,
) =>
super.noSuchMethod(
Invocation.method(
#incrementPropertyLabel,
[
prop,
value,
],
),
returnValueForMissingStub: null,
);
@override
void onAddConnection(_i5.Connection? connection) => super.noSuchMethod(
Invocation.method(
#onAddConnection,
[connection],
),
returnValueForMissingStub: null,
);
@override
void onRemoveConnection(_i5.Connection? connection) => super.noSuchMethod(
Invocation.method(
#onRemoveConnection,
[connection],
),
returnValueForMissingStub: null,
);
@override
void onRestore() => super.noSuchMethod(
Invocation.method(
#onRestore,
[],
),
returnValueForMissingStub: null,
);
@override
_i4.Future<void> initConfigIfNeed(Map<String, dynamic>? config) =>
(super.noSuchMethod(
Invocation.method(
Expand Down Expand Up @@ -230,22 +156,4 @@ class MockMetricClientService extends _i1.Mock
returnValue: _i4.Future<void>.value(),
returnValueForMissingStub: _i4.Future<void>.value(),
) as _i4.Future<void>);
@override
_i4.Future<void> onOpenApp() => (super.noSuchMethod(
Invocation.method(
#onOpenApp,
[],
),
returnValue: _i4.Future<void>.value(),
returnValueForMissingStub: _i4.Future<void>.value(),
) as _i4.Future<void>);
@override
_i4.Future<void> onUseAppInForeground() => (super.noSuchMethod(
Invocation.method(
#onUseAppInForeground,
[],
),
returnValue: _i4.Future<void>.value(),
returnValueForMissingStub: _i4.Future<void>.value(),
) as _i4.Future<void>);
}
5 changes: 0 additions & 5 deletions test/services/postcard_service_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import 'package:autonomy_flutter/gateway/postcard_api.dart';
import 'package:autonomy_flutter/service/account_service.dart';
import 'package:autonomy_flutter/service/chat_service.dart';
import 'package:autonomy_flutter/service/configuration_service.dart';
import 'package:autonomy_flutter/service/metric_client_service.dart';
import 'package:autonomy_flutter/service/postcard_service.dart';
import 'package:autonomy_flutter/service/tezos_service.dart';
import 'package:flutter_test/flutter_test.dart';
Expand All @@ -16,7 +15,6 @@ import '../generate_mock/service/mock_account_service.mocks.dart';
import '../generate_mock/service/mock_chat_service.mocks.dart';
import '../generate_mock/service/mock_configuration_service.mocks.dart';
import '../generate_mock/service/mock_indexer_service.mocks.dart';
import '../generate_mock/service/mock_metric_client_service.mocks.dart';
import '../generate_mock/service/mock_tezos_service.mocks.dart';
import '../generate_mock/service/mock_tokens_service.mocks.dart';
import '../mock_data/postcard_api_mock.dart';
Expand All @@ -35,7 +33,6 @@ void main() async {
late ConfigurationService mockConfigurationService;
late AccountService mockAccountService;
late TokensService mockTokensService;
late MetricClientService mockMetricClientService;
late ChatService mockChatService;
late PostcardService postcardService;
setUp(() {
Expand All @@ -45,7 +42,6 @@ void main() async {
mockConfigurationService = MockConfigurationService();
mockAccountService = MockAccountService();
mockTokensService = MockTokensService();
mockMetricClientService = MockMetricClientService();
mockChatService = MockChatService();
postcardService = PostcardServiceImpl(
mockPostcardApi,
Expand All @@ -54,7 +50,6 @@ void main() async {
mockConfigurationService,
mockAccountService,
mockTokensService,
mockMetricClientService,
mockChatService);
PostcardApiMock.setup(mockPostcardApi);
});
Expand Down

0 comments on commit bb4bc3b

Please sign in to comment.