mirror of
https://github.com/cypherstack/stack_wallet.git
synced 2025-03-12 09:27:01 +00:00
fix: tests
This commit is contained in:
parent
c713de3e79
commit
4a5ca30b6f
47 changed files with 2003 additions and 472 deletions
|
@ -1,9 +1,11 @@
|
|||
import 'dart:io';
|
||||
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_riverpod/flutter_riverpod.dart';
|
||||
import 'package:flutter_svg/svg.dart';
|
||||
import 'package:stackwallet/providers/providers.dart';
|
||||
import 'package:stackwallet/themes/stack_colors.dart';
|
||||
import 'package:stackwallet/themes/coin_icon_provider.dart';
|
||||
import 'package:stackwallet/themes/stack_colors.dart';
|
||||
import 'package:stackwallet/utilities/constants.dart';
|
||||
import 'package:stackwallet/utilities/enums/coin_enum.dart';
|
||||
import 'package:stackwallet/utilities/text_styles.dart';
|
||||
|
@ -81,8 +83,10 @@ class _ManagedFavoriteCardState extends ConsumerState<ManagedFavorite> {
|
|||
),
|
||||
child: Padding(
|
||||
padding: EdgeInsets.all(isDesktop ? 6 : 4),
|
||||
child: SvgPicture.asset(
|
||||
ref.watch(coinIconProvider(manager.coin)),
|
||||
child: SvgPicture.file(
|
||||
File(
|
||||
ref.watch(coinIconProvider(manager.coin)),
|
||||
),
|
||||
width: 20,
|
||||
height: 20,
|
||||
),
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
import 'dart:io';
|
||||
|
||||
import 'package:decimal/decimal.dart';
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter_riverpod/flutter_riverpod.dart';
|
||||
|
@ -83,10 +85,16 @@ class TradeCard extends ConsumerWidget {
|
|||
borderRadius: BorderRadius.circular(32),
|
||||
),
|
||||
child: Center(
|
||||
child: SvgPicture.asset(
|
||||
_fetchIconAssetForStatus(
|
||||
trade.status,
|
||||
ref.watch(themeProvider.select((value) => value.assets)),
|
||||
child: SvgPicture.file(
|
||||
File(
|
||||
_fetchIconAssetForStatus(
|
||||
trade.status,
|
||||
ref.watch(
|
||||
themeProvider.select(
|
||||
(value) => value.assets,
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
width: 32,
|
||||
height: 32,
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
import 'dart:io';
|
||||
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_riverpod/flutter_riverpod.dart';
|
||||
import 'package:flutter_svg/svg.dart';
|
||||
|
@ -5,8 +7,8 @@ import 'package:isar/isar.dart';
|
|||
import 'package:stackwallet/models/isar/exchange_cache/currency.dart';
|
||||
import 'package:stackwallet/services/exchange/change_now/change_now_exchange.dart';
|
||||
import 'package:stackwallet/services/exchange/exchange_data_loading_service.dart';
|
||||
import 'package:stackwallet/themes/stack_colors.dart';
|
||||
import 'package:stackwallet/themes/coin_icon_provider.dart';
|
||||
import 'package:stackwallet/themes/stack_colors.dart';
|
||||
import 'package:stackwallet/utilities/constants.dart';
|
||||
import 'package:stackwallet/utilities/enums/coin_enum.dart';
|
||||
|
||||
|
@ -59,8 +61,10 @@ class WalletInfoCoinIcon extends ConsumerWidget {
|
|||
width: 20,
|
||||
height: 20,
|
||||
)
|
||||
: SvgPicture.asset(
|
||||
ref.watch(coinIconProvider(coin)),
|
||||
: SvgPicture.file(
|
||||
File(
|
||||
ref.watch(coinIconProvider(coin)),
|
||||
),
|
||||
width: 20,
|
||||
height: 20,
|
||||
),
|
||||
|
|
|
@ -1,13 +1,13 @@
|
|||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_svg/svg.dart';
|
||||
import 'package:flutter_test/flutter_test.dart';
|
||||
import 'package:stackwallet/models/isar/sw_theme.dart';
|
||||
import 'package:stackwallet/models/isar/stack_theme.dart';
|
||||
import 'package:stackwallet/models/notification_model.dart';
|
||||
import 'package:stackwallet/notifications/notification_card.dart';
|
||||
import 'package:stackwallet/themes/stack_colors.dart';
|
||||
import 'package:stackwallet/themes/defaults/dark.dart';
|
||||
import 'package:stackwallet/utilities/assets.dart';
|
||||
import 'package:stackwallet/utilities/enums/coin_enum.dart';
|
||||
|
||||
import '../sample_data/theme_json.dart';
|
||||
|
||||
void main() {
|
||||
testWidgets("test notification card", (widgetTester) async {
|
||||
|
@ -18,7 +18,7 @@ void main() {
|
|||
id: 1,
|
||||
title: "notification title",
|
||||
description: "notification description",
|
||||
iconAssetName: Assets.svg.iconFor(coin: Coin.bitcoin),
|
||||
iconAssetName: Assets.svg.plus,
|
||||
date: DateTime.parse("1662544771"),
|
||||
walletId: "wallet id",
|
||||
read: true,
|
||||
|
@ -32,8 +32,8 @@ void main() {
|
|||
extensions: [
|
||||
StackColors.fromStackColorTheme(
|
||||
StackTheme.fromJson(
|
||||
json: darkJson,
|
||||
applicationThemesDirectoryPath: "",
|
||||
json: lightThemeJsonMap,
|
||||
applicationThemesDirectoryPath: "test",
|
||||
),
|
||||
),
|
||||
],
|
||||
|
|
|
@ -3,7 +3,7 @@ import 'package:flutter_riverpod/flutter_riverpod.dart';
|
|||
import 'package:flutter_test/flutter_test.dart';
|
||||
import 'package:mockito/annotations.dart';
|
||||
import 'package:mockito/mockito.dart';
|
||||
import 'package:stackwallet/models/isar/sw_theme.dart';
|
||||
import 'package:stackwallet/models/isar/stack_theme.dart';
|
||||
import 'package:stackwallet/models/send_view_auto_fill_data.dart';
|
||||
import 'package:stackwallet/pages/send_view/send_view.dart';
|
||||
import 'package:stackwallet/providers/providers.dart';
|
||||
|
@ -15,10 +15,11 @@ import 'package:stackwallet/services/node_service.dart';
|
|||
import 'package:stackwallet/services/wallets.dart';
|
||||
import 'package:stackwallet/services/wallets_service.dart';
|
||||
import 'package:stackwallet/themes/stack_colors.dart';
|
||||
import 'package:stackwallet/themes/defaults/dark.dart';
|
||||
import 'package:stackwallet/themes/theme_service.dart';
|
||||
import 'package:stackwallet/utilities/enums/coin_enum.dart';
|
||||
import 'package:stackwallet/utilities/prefs.dart';
|
||||
|
||||
import '../../sample_data/theme_json.dart';
|
||||
import 'send_view_test.mocks.dart';
|
||||
|
||||
@GenerateMocks([
|
||||
|
@ -27,6 +28,7 @@ import 'send_view_test.mocks.dart';
|
|||
NodeService,
|
||||
BitcoinWallet,
|
||||
LocaleService,
|
||||
ThemeService,
|
||||
Prefs,
|
||||
], customMocks: [
|
||||
MockSpec<Manager>(returnNullOnMissingStub: true),
|
||||
|
@ -39,6 +41,7 @@ void main() {
|
|||
final mockNodeService = MockNodeService();
|
||||
final CoinServiceAPI wallet = MockBitcoinWallet();
|
||||
final mockLocaleService = MockLocaleService();
|
||||
final mockThemeService = MockThemeService();
|
||||
final mockPrefs = MockPrefs();
|
||||
|
||||
when(wallet.coin).thenAnswer((_) => Coin.bitcoin);
|
||||
|
@ -52,6 +55,12 @@ void main() {
|
|||
.thenAnswer((realInvocation) => manager);
|
||||
|
||||
when(mockLocaleService.locale).thenAnswer((_) => "en_US");
|
||||
when(mockThemeService.getTheme(themeId: "light")).thenAnswer(
|
||||
(_) => StackTheme.fromJson(
|
||||
json: lightThemeJsonMap,
|
||||
applicationThemesDirectoryPath: "test",
|
||||
),
|
||||
);
|
||||
when(mockPrefs.currency).thenAnswer((_) => "USD");
|
||||
when(mockPrefs.enableCoinControl).thenAnswer((_) => false);
|
||||
when(wallet.validateAddress("send to address"))
|
||||
|
@ -67,6 +76,7 @@ void main() {
|
|||
localeServiceChangeNotifierProvider
|
||||
.overrideWithValue(mockLocaleService),
|
||||
prefsChangeNotifierProvider.overrideWithValue(mockPrefs),
|
||||
pThemeService.overrideWithValue(mockThemeService),
|
||||
// previewTxButtonStateProvider
|
||||
],
|
||||
child: MaterialApp(
|
||||
|
@ -74,8 +84,8 @@ void main() {
|
|||
extensions: [
|
||||
StackColors.fromStackColorTheme(
|
||||
StackTheme.fromJson(
|
||||
json: darkJson,
|
||||
applicationThemesDirectoryPath: "",
|
||||
json: lightThemeJsonMap,
|
||||
applicationThemesDirectoryPath: "test",
|
||||
),
|
||||
),
|
||||
],
|
||||
|
@ -106,6 +116,7 @@ void main() {
|
|||
final CoinServiceAPI wallet = MockBitcoinWallet();
|
||||
final mockLocaleService = MockLocaleService();
|
||||
final mockPrefs = MockPrefs();
|
||||
final mockThemeService = MockThemeService();
|
||||
|
||||
when(wallet.coin).thenAnswer((_) => Coin.bitcoin);
|
||||
when(wallet.walletName).thenAnswer((_) => "some wallet");
|
||||
|
@ -122,6 +133,12 @@ void main() {
|
|||
when(mockPrefs.enableCoinControl).thenAnswer((_) => false);
|
||||
when(wallet.validateAddress("send to address"))
|
||||
.thenAnswer((realInvocation) => false);
|
||||
when(mockThemeService.getTheme(themeId: "light")).thenAnswer(
|
||||
(_) => StackTheme.fromJson(
|
||||
json: lightThemeJsonMap,
|
||||
applicationThemesDirectoryPath: "test",
|
||||
),
|
||||
);
|
||||
|
||||
// when(manager.isOwnAddress("send to address"))
|
||||
// .thenAnswer((realInvocation) => Future(() => true));
|
||||
|
@ -136,6 +153,7 @@ void main() {
|
|||
localeServiceChangeNotifierProvider
|
||||
.overrideWithValue(mockLocaleService),
|
||||
prefsChangeNotifierProvider.overrideWithValue(mockPrefs),
|
||||
pThemeService.overrideWithValue(mockThemeService)
|
||||
// previewTxButtonStateProvider
|
||||
],
|
||||
child: MaterialApp(
|
||||
|
@ -143,8 +161,8 @@ void main() {
|
|||
extensions: [
|
||||
StackColors.fromStackColorTheme(
|
||||
StackTheme.fromJson(
|
||||
json: darkJson,
|
||||
applicationThemesDirectoryPath: "",
|
||||
json: lightThemeJsonMap,
|
||||
applicationThemesDirectoryPath: "test",
|
||||
),
|
||||
),
|
||||
],
|
||||
|
|
|
@ -18,6 +18,7 @@ import 'package:stackwallet/electrumx_rpc/cached_electrumx.dart' as _i11;
|
|||
import 'package:stackwallet/electrumx_rpc/electrumx.dart' as _i10;
|
||||
import 'package:stackwallet/models/balance.dart' as _i12;
|
||||
import 'package:stackwallet/models/isar/models/isar_models.dart' as _i18;
|
||||
import 'package:stackwallet/models/isar/stack_theme.dart' as _i33;
|
||||
import 'package:stackwallet/models/node_model.dart' as _i26;
|
||||
import 'package:stackwallet/models/paymint/fee_object_model.dart' as _i9;
|
||||
import 'package:stackwallet/models/signing_data.dart' as _i29;
|
||||
|
@ -30,11 +31,12 @@ import 'package:stackwallet/services/transaction_notification_tracker.dart'
|
|||
as _i8;
|
||||
import 'package:stackwallet/services/wallets.dart' as _i21;
|
||||
import 'package:stackwallet/services/wallets_service.dart' as _i2;
|
||||
import 'package:stackwallet/themes/theme_service.dart' as _i32;
|
||||
import 'package:stackwallet/utilities/amount/amount.dart' as _i15;
|
||||
import 'package:stackwallet/utilities/enums/backup_frequency_type.dart' as _i33;
|
||||
import 'package:stackwallet/utilities/enums/backup_frequency_type.dart' as _i35;
|
||||
import 'package:stackwallet/utilities/enums/coin_enum.dart' as _i22;
|
||||
import 'package:stackwallet/utilities/enums/derive_path_type_enum.dart' as _i28;
|
||||
import 'package:stackwallet/utilities/enums/sync_type_enum.dart' as _i32;
|
||||
import 'package:stackwallet/utilities/enums/sync_type_enum.dart' as _i34;
|
||||
import 'package:stackwallet/utilities/flutter_secure_storage_interface.dart'
|
||||
as _i7;
|
||||
import 'package:stackwallet/utilities/prefs.dart' as _i24;
|
||||
|
@ -2225,6 +2227,96 @@ class MockLocaleService extends _i1.Mock implements _i31.LocaleService {
|
|||
);
|
||||
}
|
||||
|
||||
/// A class which mocks [ThemeService].
|
||||
///
|
||||
/// See the documentation for Mockito's code generation for more information.
|
||||
class MockThemeService extends _i1.Mock implements _i32.ThemeService {
|
||||
MockThemeService() {
|
||||
_i1.throwOnMissingStub(this);
|
||||
}
|
||||
|
||||
@override
|
||||
_i13.MainDB get db => (super.noSuchMethod(
|
||||
Invocation.getter(#db),
|
||||
returnValue: _FakeMainDB_10(
|
||||
this,
|
||||
Invocation.getter(#db),
|
||||
),
|
||||
) as _i13.MainDB);
|
||||
@override
|
||||
List<_i33.StackTheme> get installedThemes => (super.noSuchMethod(
|
||||
Invocation.getter(#installedThemes),
|
||||
returnValue: <_i33.StackTheme>[],
|
||||
) as List<_i33.StackTheme>);
|
||||
@override
|
||||
void init(_i13.MainDB? db) => super.noSuchMethod(
|
||||
Invocation.method(
|
||||
#init,
|
||||
[db],
|
||||
),
|
||||
returnValueForMissingStub: null,
|
||||
);
|
||||
@override
|
||||
_i23.Future<void> install({required _i30.Uint8List? themeArchiveData}) =>
|
||||
(super.noSuchMethod(
|
||||
Invocation.method(
|
||||
#install,
|
||||
[],
|
||||
{#themeArchiveData: themeArchiveData},
|
||||
),
|
||||
returnValue: _i23.Future<void>.value(),
|
||||
returnValueForMissingStub: _i23.Future<void>.value(),
|
||||
) as _i23.Future<void>);
|
||||
@override
|
||||
_i23.Future<void> remove({required String? themeId}) => (super.noSuchMethod(
|
||||
Invocation.method(
|
||||
#remove,
|
||||
[],
|
||||
{#themeId: themeId},
|
||||
),
|
||||
returnValue: _i23.Future<void>.value(),
|
||||
returnValueForMissingStub: _i23.Future<void>.value(),
|
||||
) as _i23.Future<void>);
|
||||
@override
|
||||
_i23.Future<bool> verifyInstalled({required String? themeId}) =>
|
||||
(super.noSuchMethod(
|
||||
Invocation.method(
|
||||
#verifyInstalled,
|
||||
[],
|
||||
{#themeId: themeId},
|
||||
),
|
||||
returnValue: _i23.Future<bool>.value(false),
|
||||
) as _i23.Future<bool>);
|
||||
@override
|
||||
_i23.Future<List<_i32.StackThemeMetaData>> fetchThemes() =>
|
||||
(super.noSuchMethod(
|
||||
Invocation.method(
|
||||
#fetchThemes,
|
||||
[],
|
||||
),
|
||||
returnValue: _i23.Future<List<_i32.StackThemeMetaData>>.value(
|
||||
<_i32.StackThemeMetaData>[]),
|
||||
) as _i23.Future<List<_i32.StackThemeMetaData>>);
|
||||
@override
|
||||
_i23.Future<_i30.Uint8List> fetchTheme(
|
||||
{required _i32.StackThemeMetaData? themeMetaData}) =>
|
||||
(super.noSuchMethod(
|
||||
Invocation.method(
|
||||
#fetchTheme,
|
||||
[],
|
||||
{#themeMetaData: themeMetaData},
|
||||
),
|
||||
returnValue: _i23.Future<_i30.Uint8List>.value(_i30.Uint8List(0)),
|
||||
) as _i23.Future<_i30.Uint8List>);
|
||||
@override
|
||||
_i33.StackTheme? getTheme({required String? themeId}) =>
|
||||
(super.noSuchMethod(Invocation.method(
|
||||
#getTheme,
|
||||
[],
|
||||
{#themeId: themeId},
|
||||
)) as _i33.StackTheme?);
|
||||
}
|
||||
|
||||
/// A class which mocks [Prefs].
|
||||
///
|
||||
/// See the documentation for Mockito's code generation for more information.
|
||||
|
@ -2284,12 +2376,12 @@ class MockPrefs extends _i1.Mock implements _i24.Prefs {
|
|||
returnValueForMissingStub: null,
|
||||
);
|
||||
@override
|
||||
_i32.SyncingType get syncType => (super.noSuchMethod(
|
||||
_i34.SyncingType get syncType => (super.noSuchMethod(
|
||||
Invocation.getter(#syncType),
|
||||
returnValue: _i32.SyncingType.currentWalletOnly,
|
||||
) as _i32.SyncingType);
|
||||
returnValue: _i34.SyncingType.currentWalletOnly,
|
||||
) as _i34.SyncingType);
|
||||
@override
|
||||
set syncType(_i32.SyncingType? syncType) => super.noSuchMethod(
|
||||
set syncType(_i34.SyncingType? syncType) => super.noSuchMethod(
|
||||
Invocation.setter(
|
||||
#syncType,
|
||||
syncType,
|
||||
|
@ -2435,12 +2527,12 @@ class MockPrefs extends _i1.Mock implements _i24.Prefs {
|
|||
returnValueForMissingStub: null,
|
||||
);
|
||||
@override
|
||||
_i33.BackupFrequencyType get backupFrequencyType => (super.noSuchMethod(
|
||||
_i35.BackupFrequencyType get backupFrequencyType => (super.noSuchMethod(
|
||||
Invocation.getter(#backupFrequencyType),
|
||||
returnValue: _i33.BackupFrequencyType.everyTenMinutes,
|
||||
) as _i33.BackupFrequencyType);
|
||||
returnValue: _i35.BackupFrequencyType.everyTenMinutes,
|
||||
) as _i35.BackupFrequencyType);
|
||||
@override
|
||||
set backupFrequencyType(_i33.BackupFrequencyType? backupFrequencyType) =>
|
||||
set backupFrequencyType(_i35.BackupFrequencyType? backupFrequencyType) =>
|
||||
super.noSuchMethod(
|
||||
Invocation.setter(
|
||||
#backupFrequencyType,
|
||||
|
|
BIN
test/sample_data/light/assets/dummy.png
Normal file
BIN
test/sample_data/light/assets/dummy.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 1.9 KiB |
4
test/sample_data/light/assets/dummy.svg
Normal file
4
test/sample_data/light/assets/dummy.svg
Normal file
|
@ -0,0 +1,4 @@
|
|||
<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path d="M15 5L5 15" stroke="#8A95B2" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
|
||||
<path d="M5 5L15 15" stroke="#8A95B2" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
|
||||
</svg>
|
After Width: | Height: | Size: 311 B |
235
test/sample_data/theme_json.dart
Normal file
235
test/sample_data/theme_json.dart
Normal file
|
@ -0,0 +1,235 @@
|
|||
const Map<String, dynamic> lightThemeJsonMap = {
|
||||
"name": "Light",
|
||||
"id": "light",
|
||||
"brightness": "light",
|
||||
"colors": {
|
||||
"coin": {
|
||||
"bitcoin": "0xFFFCC17B",
|
||||
"litecoin": "0xFF7FA6E1",
|
||||
"bitcoincash": "0xFF7BCFB8",
|
||||
"firo": "0xFFFF897A",
|
||||
"dogecoin": "0xFFFFE079",
|
||||
"epicCash": "0xFFC5C7CB",
|
||||
"ethereum": "0xFFA7ADE9",
|
||||
"monero": "0xFFFF9E6B",
|
||||
"namecoin": "0xFF91B1E1",
|
||||
"wownero": "0xFFED80C1",
|
||||
"particl": "0xFF8175BD"
|
||||
},
|
||||
"background": "0xFFF7F7F7",
|
||||
"background_app_bar": "0xFFF7F7F7",
|
||||
"overlay": "0xFF111215",
|
||||
"accent_color_blue": "0xFF0052DF",
|
||||
"accent_color_green": "0xFF4CC0A0",
|
||||
"accent_color_yellow": "0xFFF7D65D",
|
||||
"accent_color_red": "0xFFD34E50",
|
||||
"accent_color_orange": "0xFFFEA68D",
|
||||
"accent_color_dark": "0xFF232323",
|
||||
"shadow": "0x0F2D3132",
|
||||
"text_dark_one": "0xFF232323",
|
||||
"text_dark_two": "0xFF414141",
|
||||
"text_dark_three": "0xFF747778",
|
||||
"text_white": "0xFFFFFFFF",
|
||||
"text_favorite": "0xFF232323",
|
||||
"text_error": "0xFF930006",
|
||||
"text_restore": "0xFF111215",
|
||||
"text_subtitle_one": "0xFF8E9192",
|
||||
"text_subtitle_two": "0xFFA9ACAC",
|
||||
"text_subtitle_three": "0xFFC4C7C7",
|
||||
"text_subtitle_four": "0xFFE0E3E3",
|
||||
"text_subtitle_five": "0xFFEEEFF1",
|
||||
"text_subtitle_six": "0xFFF5F5F5",
|
||||
"button_back_primary": "0xFF232323",
|
||||
"button_back_secondary": "0xFFE0E3E3",
|
||||
"button_back_primary_disabled": "0xFFD7D7D7",
|
||||
"button_back_secondary_disabled": "0xFFF0F1F1",
|
||||
"button_back_border": "0xFF232323",
|
||||
"button_back_border_disabled": "0xFFB6B6B6",
|
||||
"button_back_border_secondary": "0xFFE0E3E3",
|
||||
"button_back_border_secondary_disabled": "0xFFF0F1F1",
|
||||
"number_back_default": "0xFFFFFFFF",
|
||||
"numpad_back_default": "0xFF232323",
|
||||
"bottom_nav_back": "0xFFFFFFFF",
|
||||
"button_text_primary": "0xFFFFFFFF",
|
||||
"button_text_secondary": "0xFF232323",
|
||||
"button_text_primary_disabled": "0xFFF8F8F8",
|
||||
"button_text_secondary_disabled": "0xFFB7B7B7",
|
||||
"button_text_border": "0xFF232323",
|
||||
"button_text_disabled": "0xFFB6B6B6",
|
||||
"button_text_borderless": "0xFF0052DF",
|
||||
"button_text_borderless_disabled": "0xFFB6B6B6",
|
||||
"number_text_default": "0xFF232323",
|
||||
"numpad_text_default": "0xFFFFFFFF",
|
||||
"bottom_nav_text": "0xFF232323",
|
||||
"custom_text_button_enabled_text": "0xFF0052DF",
|
||||
"custom_text_button_disabled_text": "0xFF8E9192",
|
||||
"switch_bg_on": "0xFF0052DF",
|
||||
"switch_bg_off": "0xFFD8E4FB",
|
||||
"switch_bg_disabled": "0xFFC5C6C9",
|
||||
"switch_circle_on": "0xFFDAE2FF",
|
||||
"switch_circle_off": "0xFFFBFCFF",
|
||||
"switch_circle_disabled": "0xFFFBFCFF",
|
||||
"step_indicator_bg_check": "0xFFD9E2FF",
|
||||
"step_indicator_bg_number": "0xFFD9E2FF",
|
||||
"step_indicator_bg_inactive": "0xFFCDCDCD",
|
||||
"step_indicator_bg_lines": "0xFF0056D2",
|
||||
"step_indicator_bg_lines_inactive": "0xFFCDCDCD",
|
||||
"step_indicator_icon_text": "0xFF0056D2",
|
||||
"step_indicator_icon_number": "0xFF0056D2",
|
||||
"step_indicator_icon_inactive": "0xFFF7F7F7",
|
||||
"checkbox_bg_checked": "0xFF0056D2",
|
||||
"checkbox_border_empty": "0xFF8E9192",
|
||||
"checkbox_bg_disabled": "0xFFADC7EC",
|
||||
"checkbox_icon_checked": "0xFFFFFFFF",
|
||||
"checkbox_icon_disabled": "0xFFFFFFFF",
|
||||
"checkbox_text_label": "0xFF232323",
|
||||
"snack_bar_back_success": "0xFFB9E9D4",
|
||||
"snack_bar_back_error": "0xFFFFDAD4",
|
||||
"snack_bar_back_info": "0xFFDAE2FF",
|
||||
"snack_bar_text_success": "0xFF006C4D",
|
||||
"snack_bar_text_error": "0xFF930006",
|
||||
"snack_bar_text_info": "0xFF002A78",
|
||||
"bottom_nav_icon_back": "0xFFA2A2A2",
|
||||
"bottom_nav_icon_icon": "0xFF232323",
|
||||
"top_nav_icon_primary": "0xFF232323",
|
||||
"top_nav_icon_green": "0xFF00A578",
|
||||
"top_nav_icon_yellow": "0xFFF4C517",
|
||||
"top_nav_icon_red": "0xFFC00205",
|
||||
"settings_icon_back": "0xFFE0E3E3",
|
||||
"settings_icon_icon": "0xFF232323",
|
||||
"settings_icon_back_two": "0xFF94D6C4",
|
||||
"settings_icon_element": "0xFF00A578",
|
||||
"text_field_active_bg": "0xFFEEEFF1",
|
||||
"text_field_default_bg": "0xFFEEEFF1",
|
||||
"text_field_error_bg": "0xFFFFDAD4",
|
||||
"text_field_success_bg": "0xFFB9E9D4",
|
||||
"text_field_error_border": "0xFFFFDAD4",
|
||||
"text_field_success_border": "0xFFB9E9D4",
|
||||
"text_field_active_search_icon_left": "0xFFA9ACAC",
|
||||
"text_field_default_search_icon_left": "0xFFA9ACAC",
|
||||
"text_field_error_search_icon_left": "0xFF930006",
|
||||
"text_field_success_search_icon_left": "0xFF006C4D",
|
||||
"text_field_active_text": "0xFF232323",
|
||||
"text_field_default_text": "0xFFA9ACAC",
|
||||
"text_field_error_text": "0xFF000000",
|
||||
"text_field_success_text": "0xFF000000",
|
||||
"text_field_active_label": "0xFFA9ACAC",
|
||||
"text_field_error_label": "0xFF930006",
|
||||
"text_field_success_label": "0xFF006C4D",
|
||||
"text_field_active_search_icon_right": "0xFF747778",
|
||||
"text_field_default_search_icon_right": "0xFF747778",
|
||||
"text_field_error_search_icon_right": "0xFF930006",
|
||||
"text_field_success_search_icon_right": "0xFF006C4D",
|
||||
"settings_item_level_two_active_bg": "0xFFFFFFFF",
|
||||
"settings_item_level_two_active_text": "0xFF232323",
|
||||
"settings_item_level_two_active_sub": "0xFF8E9192",
|
||||
"radio_button_icon_border": "0xFF0056D2",
|
||||
"radio_button_icon_border_disabled": "0xFF8F909A",
|
||||
"radio_button_border_enabled": "0xFF0056D2",
|
||||
"radio_button_border_disabled": "0xFF8F909A",
|
||||
"radio_button_icon_circle": "0xFF0056D2",
|
||||
"radio_button_icon_enabled": "0xFF0056D2",
|
||||
"radio_button_text_enabled": "0xFF44464E",
|
||||
"radio_button_text_disabled": "0xFF44464E",
|
||||
"radio_button_label_enabled": "0xFF8E9192",
|
||||
"radio_button_label_disabled": "0xFF8E9192",
|
||||
"info_item_bg": "0xFFFFFFFF",
|
||||
"info_item_label": "0xFF8E9192",
|
||||
"info_item_text": "0xFF232323",
|
||||
"info_item_icons": "0xFF0056D2",
|
||||
"popup_bg": "0xFFFFFFFF",
|
||||
"currency_list_item_bg": "0xFFF9F9FC",
|
||||
"sw_bg": "0xFFFFFFFF",
|
||||
"sw_mid": "0xFFFFFFFF",
|
||||
"sw_bottom": "0xFF232323",
|
||||
"bottom_nav_shadow": "0xFF282E33",
|
||||
"favorite_star_active": "0xFF0056D2",
|
||||
"favorite_star_inactive": "0xFFC4C7C7",
|
||||
"splash": "0x358E9192",
|
||||
"highlight": "0x44A9ACAC",
|
||||
"warning_foreground": "0xFF232323",
|
||||
"warning_background": "0xFFFFDAD3",
|
||||
"loading_overlay_text_color": "0xFFF7F7F7",
|
||||
"my_stack_contact_icon_bg": "0xFFEEEFF1",
|
||||
"text_confirm_total_amount": "0xFF232323",
|
||||
"text_selected_word_table_iterm": "0xFF232323",
|
||||
"rate_type_toggle_color_on": "0xFFEEEFF1",
|
||||
"rate_type_toggle_color_off": "0xFFFFFFFF",
|
||||
"rate_type_toggle_desktop_color_on": "0xFFEEEFF1",
|
||||
"rate_type_toggle_desktop_color_off": "0xFFE0E3E3",
|
||||
"eth_tag_text": "0xFFFFFFFF",
|
||||
"eth_tag_bg": "0xFF4D5798",
|
||||
"eth_wallet_tag_text": "0xFF4D5798",
|
||||
"eth_wallet_tag_bg": "0xFFF0F3FD",
|
||||
"token_summary_text_primary": "0xFF232323",
|
||||
"token_summary_text_secondary": "0xFF8488AB",
|
||||
"token_summary_bg": "0xFFE9EAFF",
|
||||
"token_summary_button_bg": "0xFFFFFFFF",
|
||||
"token_summary_icon": "0xFF424A97",
|
||||
"box_shadows": {
|
||||
"standard": {
|
||||
"color": "0x0F2D3132",
|
||||
"spread_radius": 3.0,
|
||||
"blur_radius": 4.0
|
||||
},
|
||||
"home_view_button_bar": {
|
||||
"color": "0x0F2D3132",
|
||||
"spread_radius": 3.0,
|
||||
"blur_radius": 4.0
|
||||
}
|
||||
}
|
||||
},
|
||||
"assets": {
|
||||
"bitcoin": "dummy.svg",
|
||||
"litecoin": "dummy.svg",
|
||||
"bitcoincash": "dummy.svg",
|
||||
"dogecoin": "dummy.svg",
|
||||
"epicCash": "dummy.svg",
|
||||
"ethereum": "dummy.svg",
|
||||
"firo": "dummy.svg",
|
||||
"monero": "dummy.svg",
|
||||
"wownero": "dummy.svg",
|
||||
"namecoin": "dummy.svg",
|
||||
"particl": "dummy.svg",
|
||||
"bitcoin_image": "dummy.svg",
|
||||
"litecoin_image": "dummy.svg",
|
||||
"bitcoincash_image": "dummy.svg",
|
||||
"dogecoin_image": "dummy.svg",
|
||||
"epicCash_image": "dummy.svg.svg",
|
||||
"ethereum_image": "dummy.svg",
|
||||
"firo_image": "dummy.svg",
|
||||
"monero_image": "dummy.svg",
|
||||
"wownero_image": "dummy.svg",
|
||||
"namecoin_image": "dummy.svg",
|
||||
"particl_image": "dummy.svg",
|
||||
"bitcoin_image_secondary": "dummy.svg",
|
||||
"litecoin_image_secondary": "dummy.svg",
|
||||
"bitcoincash_image_secondary": "dummy.svg",
|
||||
"dogecoin_image_secondary": "dummy.svg",
|
||||
"epicCash_image_secondary": "dummy.svg.svg",
|
||||
"ethereum_image_secondary": "dummy.svg",
|
||||
"firo_image_secondary": "dummy.svg",
|
||||
"monero_image_secondary": "dummy.svg",
|
||||
"wownero_image_secondary": "dummy.svg",
|
||||
"namecoin_image_secondary": "dummy.svg",
|
||||
"particl_image_secondary": "dummy.svg",
|
||||
"bell_new": "dummy.svg",
|
||||
"persona_incognito": "dummy.svg.svg",
|
||||
"persona_easy": "dummy.svg",
|
||||
"stack": "dummy.svg",
|
||||
"stack_icon": "dummy.svg",
|
||||
"receive": "dummy.svg",
|
||||
"receive_pending": "dummy.svg",
|
||||
"receive_cancelled": "dummy.svg",
|
||||
"send": "sdummy.svg",
|
||||
"tx_exchange": "dummy.svg",
|
||||
"tx_exchange_pending": "dummy.svg",
|
||||
"tx_exchange_failed": "dummy.svg",
|
||||
"buy": "dummy.svg",
|
||||
"exchange": "dummy.svg",
|
||||
"send_pending": "dummy.svg",
|
||||
"send_cancelled": "dummy.svg",
|
||||
"theme_selector": "dummy.svg",
|
||||
"theme_preview": "dummy.png"
|
||||
}
|
||||
};
|
|
@ -7,12 +7,12 @@ import 'package:mockito/annotations.dart';
|
|||
import 'package:mockito/mockito.dart';
|
||||
import 'package:stackwallet/models/contact.dart';
|
||||
import 'package:stackwallet/models/contact_address_entry.dart';
|
||||
import 'package:stackwallet/models/isar/sw_theme.dart';
|
||||
import 'package:stackwallet/models/isar/stack_theme.dart';
|
||||
import 'package:stackwallet/pages/address_book_views/subviews/contact_popup.dart';
|
||||
import 'package:stackwallet/providers/global/address_book_service_provider.dart';
|
||||
import 'package:stackwallet/services/address_book_service.dart';
|
||||
import '../sample_data/theme_json.dart';
|
||||
import 'package:stackwallet/themes/stack_colors.dart';
|
||||
import 'package:stackwallet/themes/defaults/dark.dart';
|
||||
import 'package:stackwallet/utilities/enums/coin_enum.dart';
|
||||
import 'package:stackwallet/utilities/util.dart';
|
||||
import 'package:stackwallet/widgets/address_book_card.dart';
|
||||
|
@ -54,7 +54,7 @@ void main() {
|
|||
extensions: [
|
||||
StackColors.fromStackColorTheme(
|
||||
StackTheme.fromJson(
|
||||
json: darkJson,
|
||||
json: lightThemeJsonMap,
|
||||
applicationThemesDirectoryPath:
|
||||
applicationThemesDirectoryPath,
|
||||
),
|
||||
|
|
|
@ -1,10 +1,11 @@
|
|||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_test/flutter_test.dart';
|
||||
import 'package:stackwallet/models/isar/sw_theme.dart';
|
||||
import 'package:stackwallet/models/isar/stack_theme.dart';
|
||||
import 'package:stackwallet/themes/stack_colors.dart';
|
||||
import 'package:stackwallet/themes/defaults/dark.dart';
|
||||
import 'package:stackwallet/widgets/animated_text.dart';
|
||||
|
||||
import '../sample_data/theme_json.dart';
|
||||
|
||||
void main() {
|
||||
testWidgets("Widget displays first word in strings list",
|
||||
(widgetTester) async {
|
||||
|
@ -26,8 +27,8 @@ void main() {
|
|||
extensions: [
|
||||
StackColors.fromStackColorTheme(
|
||||
StackTheme.fromJson(
|
||||
json: darkJson,
|
||||
applicationThemesDirectoryPath: "",
|
||||
json: lightThemeJsonMap,
|
||||
applicationThemesDirectoryPath: "test",
|
||||
),
|
||||
),
|
||||
],
|
||||
|
|
|
@ -1,10 +1,11 @@
|
|||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_test/flutter_test.dart';
|
||||
import 'package:stackwallet/models/isar/sw_theme.dart';
|
||||
import 'package:stackwallet/models/isar/stack_theme.dart';
|
||||
import 'package:stackwallet/themes/stack_colors.dart';
|
||||
import 'package:stackwallet/themes/defaults/dark.dart';
|
||||
import 'package:stackwallet/widgets/custom_buttons/app_bar_icon_button.dart';
|
||||
|
||||
import '../../sample_data/theme_json.dart';
|
||||
|
||||
void main() {
|
||||
testWidgets("AppBarIconButton test", (tester) async {
|
||||
int buttonPressedCount = 0;
|
||||
|
@ -26,8 +27,8 @@ void main() {
|
|||
extensions: [
|
||||
StackColors.fromStackColorTheme(
|
||||
StackTheme.fromJson(
|
||||
json: darkJson,
|
||||
applicationThemesDirectoryPath: "",
|
||||
json: lightThemeJsonMap,
|
||||
applicationThemesDirectoryPath: "test",
|
||||
),
|
||||
),
|
||||
],
|
||||
|
|
|
@ -1,10 +1,11 @@
|
|||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_test/flutter_test.dart';
|
||||
import 'package:stackwallet/models/isar/sw_theme.dart';
|
||||
import 'package:stackwallet/models/isar/stack_theme.dart';
|
||||
import 'package:stackwallet/themes/stack_colors.dart';
|
||||
import 'package:stackwallet/themes/defaults/dark.dart';
|
||||
import 'package:stackwallet/widgets/custom_buttons/draggable_switch_button.dart';
|
||||
|
||||
import '../../sample_data/theme_json.dart';
|
||||
|
||||
void main() {
|
||||
testWidgets("DraggableSwitchButton tapped", (tester) async {
|
||||
bool? isButtonOn = false;
|
||||
|
@ -22,8 +23,8 @@ void main() {
|
|||
extensions: [
|
||||
StackColors.fromStackColorTheme(
|
||||
StackTheme.fromJson(
|
||||
json: darkJson,
|
||||
applicationThemesDirectoryPath: "",
|
||||
json: lightThemeJsonMap,
|
||||
applicationThemesDirectoryPath: "test",
|
||||
),
|
||||
),
|
||||
],
|
||||
|
@ -54,8 +55,8 @@ void main() {
|
|||
extensions: [
|
||||
StackColors.fromStackColorTheme(
|
||||
StackTheme.fromJson(
|
||||
json: darkJson,
|
||||
applicationThemesDirectoryPath: "",
|
||||
json: lightThemeJsonMap,
|
||||
applicationThemesDirectoryPath: "test",
|
||||
),
|
||||
),
|
||||
],
|
||||
|
@ -91,8 +92,8 @@ void main() {
|
|||
extensions: [
|
||||
StackColors.fromStackColorTheme(
|
||||
StackTheme.fromJson(
|
||||
json: darkJson,
|
||||
applicationThemesDirectoryPath: "",
|
||||
json: lightThemeJsonMap,
|
||||
applicationThemesDirectoryPath: "test",
|
||||
),
|
||||
),
|
||||
],
|
||||
|
|
|
@ -2,25 +2,42 @@ import 'package:flutter/material.dart';
|
|||
import 'package:flutter_riverpod/flutter_riverpod.dart';
|
||||
import 'package:flutter_svg/flutter_svg.dart';
|
||||
import 'package:flutter_test/flutter_test.dart';
|
||||
import 'package:stackwallet/models/isar/sw_theme.dart';
|
||||
import 'package:mockito/annotations.dart';
|
||||
import 'package:mockito/mockito.dart';
|
||||
import 'package:stackwallet/models/isar/stack_theme.dart';
|
||||
import 'package:stackwallet/themes/stack_colors.dart';
|
||||
import 'package:stackwallet/themes/defaults/dark.dart';
|
||||
import 'package:stackwallet/themes/theme_service.dart';
|
||||
import 'package:stackwallet/widgets/custom_buttons/favorite_toggle.dart';
|
||||
|
||||
import '../../sample_data/theme_json.dart';
|
||||
import 'favorite_toggle_test.mocks.dart';
|
||||
|
||||
@GenerateMocks([
|
||||
ThemeService,
|
||||
])
|
||||
void main() {
|
||||
testWidgets("Test widget build", (widgetTester) async {
|
||||
final key = UniqueKey();
|
||||
final mockThemeService = MockThemeService();
|
||||
when(mockThemeService.getTheme(themeId: "light")).thenAnswer(
|
||||
(_) => StackTheme.fromJson(
|
||||
json: lightThemeJsonMap,
|
||||
applicationThemesDirectoryPath: "test",
|
||||
),
|
||||
);
|
||||
|
||||
await widgetTester.pumpWidget(
|
||||
ProviderScope(
|
||||
overrides: [],
|
||||
overrides: [
|
||||
pThemeService.overrideWithValue(mockThemeService),
|
||||
],
|
||||
child: MaterialApp(
|
||||
theme: ThemeData(
|
||||
extensions: [
|
||||
StackColors.fromStackColorTheme(
|
||||
StackTheme.fromJson(
|
||||
json: darkJson,
|
||||
applicationThemesDirectoryPath: "",
|
||||
json: lightThemeJsonMap,
|
||||
applicationThemesDirectoryPath: "test",
|
||||
),
|
||||
),
|
||||
],
|
||||
|
|
122
test/widget_tests/custom_buttons/favorite_toggle_test.mocks.dart
Normal file
122
test/widget_tests/custom_buttons/favorite_toggle_test.mocks.dart
Normal file
|
@ -0,0 +1,122 @@
|
|||
// Mocks generated by Mockito 5.3.2 from annotations
|
||||
// in stackwallet/test/widget_tests/custom_buttons/favorite_toggle_test.dart.
|
||||
// Do not manually edit this file.
|
||||
|
||||
// ignore_for_file: no_leading_underscores_for_library_prefixes
|
||||
import 'dart:async' as _i5;
|
||||
import 'dart:typed_data' as _i6;
|
||||
|
||||
import 'package:mockito/mockito.dart' as _i1;
|
||||
import 'package:stackwallet/db/isar/main_db.dart' as _i2;
|
||||
import 'package:stackwallet/models/isar/stack_theme.dart' as _i4;
|
||||
import 'package:stackwallet/themes/theme_service.dart' as _i3;
|
||||
|
||||
// ignore_for_file: type=lint
|
||||
// ignore_for_file: avoid_redundant_argument_values
|
||||
// ignore_for_file: avoid_setters_without_getters
|
||||
// ignore_for_file: comment_references
|
||||
// ignore_for_file: implementation_imports
|
||||
// ignore_for_file: invalid_use_of_visible_for_testing_member
|
||||
// ignore_for_file: prefer_const_constructors
|
||||
// ignore_for_file: unnecessary_parenthesis
|
||||
// ignore_for_file: camel_case_types
|
||||
// ignore_for_file: subtype_of_sealed_class
|
||||
|
||||
class _FakeMainDB_0 extends _i1.SmartFake implements _i2.MainDB {
|
||||
_FakeMainDB_0(
|
||||
Object parent,
|
||||
Invocation parentInvocation,
|
||||
) : super(
|
||||
parent,
|
||||
parentInvocation,
|
||||
);
|
||||
}
|
||||
|
||||
/// A class which mocks [ThemeService].
|
||||
///
|
||||
/// See the documentation for Mockito's code generation for more information.
|
||||
class MockThemeService extends _i1.Mock implements _i3.ThemeService {
|
||||
MockThemeService() {
|
||||
_i1.throwOnMissingStub(this);
|
||||
}
|
||||
|
||||
@override
|
||||
_i2.MainDB get db => (super.noSuchMethod(
|
||||
Invocation.getter(#db),
|
||||
returnValue: _FakeMainDB_0(
|
||||
this,
|
||||
Invocation.getter(#db),
|
||||
),
|
||||
) as _i2.MainDB);
|
||||
@override
|
||||
List<_i4.StackTheme> get installedThemes => (super.noSuchMethod(
|
||||
Invocation.getter(#installedThemes),
|
||||
returnValue: <_i4.StackTheme>[],
|
||||
) as List<_i4.StackTheme>);
|
||||
@override
|
||||
void init(_i2.MainDB? db) => super.noSuchMethod(
|
||||
Invocation.method(
|
||||
#init,
|
||||
[db],
|
||||
),
|
||||
returnValueForMissingStub: null,
|
||||
);
|
||||
@override
|
||||
_i5.Future<void> install({required _i6.Uint8List? themeArchiveData}) =>
|
||||
(super.noSuchMethod(
|
||||
Invocation.method(
|
||||
#install,
|
||||
[],
|
||||
{#themeArchiveData: themeArchiveData},
|
||||
),
|
||||
returnValue: _i5.Future<void>.value(),
|
||||
returnValueForMissingStub: _i5.Future<void>.value(),
|
||||
) as _i5.Future<void>);
|
||||
@override
|
||||
_i5.Future<void> remove({required String? themeId}) => (super.noSuchMethod(
|
||||
Invocation.method(
|
||||
#remove,
|
||||
[],
|
||||
{#themeId: themeId},
|
||||
),
|
||||
returnValue: _i5.Future<void>.value(),
|
||||
returnValueForMissingStub: _i5.Future<void>.value(),
|
||||
) as _i5.Future<void>);
|
||||
@override
|
||||
_i5.Future<bool> verifyInstalled({required String? themeId}) =>
|
||||
(super.noSuchMethod(
|
||||
Invocation.method(
|
||||
#verifyInstalled,
|
||||
[],
|
||||
{#themeId: themeId},
|
||||
),
|
||||
returnValue: _i5.Future<bool>.value(false),
|
||||
) as _i5.Future<bool>);
|
||||
@override
|
||||
_i5.Future<List<_i3.StackThemeMetaData>> fetchThemes() => (super.noSuchMethod(
|
||||
Invocation.method(
|
||||
#fetchThemes,
|
||||
[],
|
||||
),
|
||||
returnValue: _i5.Future<List<_i3.StackThemeMetaData>>.value(
|
||||
<_i3.StackThemeMetaData>[]),
|
||||
) as _i5.Future<List<_i3.StackThemeMetaData>>);
|
||||
@override
|
||||
_i5.Future<_i6.Uint8List> fetchTheme(
|
||||
{required _i3.StackThemeMetaData? themeMetaData}) =>
|
||||
(super.noSuchMethod(
|
||||
Invocation.method(
|
||||
#fetchTheme,
|
||||
[],
|
||||
{#themeMetaData: themeMetaData},
|
||||
),
|
||||
returnValue: _i5.Future<_i6.Uint8List>.value(_i6.Uint8List(0)),
|
||||
) as _i5.Future<_i6.Uint8List>);
|
||||
@override
|
||||
_i4.StackTheme? getTheme({required String? themeId}) =>
|
||||
(super.noSuchMethod(Invocation.method(
|
||||
#getTheme,
|
||||
[],
|
||||
{#themeId: themeId},
|
||||
)) as _i4.StackTheme?);
|
||||
}
|
|
@ -1,29 +1,51 @@
|
|||
import 'package:event_bus/event_bus.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_riverpod/flutter_riverpod.dart';
|
||||
import 'package:flutter_test/flutter_test.dart';
|
||||
import 'package:stackwallet/models/isar/sw_theme.dart';
|
||||
import 'package:mockito/annotations.dart';
|
||||
import 'package:mockito/mockito.dart';
|
||||
import 'package:stackwallet/models/isar/stack_theme.dart';
|
||||
import 'package:stackwallet/themes/stack_colors.dart';
|
||||
import 'package:stackwallet/themes/defaults/dark.dart';
|
||||
import 'package:stackwallet/themes/theme_service.dart';
|
||||
import 'package:stackwallet/widgets/custom_loading_overlay.dart';
|
||||
|
||||
import '../sample_data/theme_json.dart';
|
||||
import 'custom_loading_overlay_test.mocks.dart';
|
||||
|
||||
@GenerateMocks([
|
||||
ThemeService,
|
||||
])
|
||||
void main() {
|
||||
testWidgets("Test wiget displays correct text", (widgetTester) async {
|
||||
testWidgets("Test widget displays correct text", (widgetTester) async {
|
||||
final eventBus = EventBus();
|
||||
final mockThemeService = MockThemeService();
|
||||
when(mockThemeService.getTheme(themeId: "light")).thenAnswer(
|
||||
(_) => StackTheme.fromJson(
|
||||
json: lightThemeJsonMap,
|
||||
applicationThemesDirectoryPath: "test",
|
||||
),
|
||||
);
|
||||
|
||||
await widgetTester.pumpWidget(
|
||||
MaterialApp(
|
||||
theme: ThemeData(
|
||||
extensions: [
|
||||
StackColors.fromStackColorTheme(
|
||||
StackTheme.fromJson(
|
||||
json: darkJson,
|
||||
applicationThemesDirectoryPath: "",
|
||||
ProviderScope(
|
||||
overrides: [
|
||||
pThemeService.overrideWithValue(mockThemeService),
|
||||
],
|
||||
child: MaterialApp(
|
||||
theme: ThemeData(
|
||||
extensions: [
|
||||
StackColors.fromStackColorTheme(
|
||||
StackTheme.fromJson(
|
||||
json: lightThemeJsonMap,
|
||||
applicationThemesDirectoryPath: "test",
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
home: Material(
|
||||
child: CustomLoadingOverlay(
|
||||
message: "Updating exchange rate", eventBus: eventBus),
|
||||
],
|
||||
),
|
||||
home: Material(
|
||||
child: CustomLoadingOverlay(
|
||||
message: "Updating exchange rate", eventBus: eventBus),
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
|
|
122
test/widget_tests/custom_loading_overlay_test.mocks.dart
Normal file
122
test/widget_tests/custom_loading_overlay_test.mocks.dart
Normal file
|
@ -0,0 +1,122 @@
|
|||
// Mocks generated by Mockito 5.3.2 from annotations
|
||||
// in stackwallet/test/widget_tests/custom_loading_overlay_test.dart.
|
||||
// Do not manually edit this file.
|
||||
|
||||
// ignore_for_file: no_leading_underscores_for_library_prefixes
|
||||
import 'dart:async' as _i5;
|
||||
import 'dart:typed_data' as _i6;
|
||||
|
||||
import 'package:mockito/mockito.dart' as _i1;
|
||||
import 'package:stackwallet/db/isar/main_db.dart' as _i2;
|
||||
import 'package:stackwallet/models/isar/stack_theme.dart' as _i4;
|
||||
import 'package:stackwallet/themes/theme_service.dart' as _i3;
|
||||
|
||||
// ignore_for_file: type=lint
|
||||
// ignore_for_file: avoid_redundant_argument_values
|
||||
// ignore_for_file: avoid_setters_without_getters
|
||||
// ignore_for_file: comment_references
|
||||
// ignore_for_file: implementation_imports
|
||||
// ignore_for_file: invalid_use_of_visible_for_testing_member
|
||||
// ignore_for_file: prefer_const_constructors
|
||||
// ignore_for_file: unnecessary_parenthesis
|
||||
// ignore_for_file: camel_case_types
|
||||
// ignore_for_file: subtype_of_sealed_class
|
||||
|
||||
class _FakeMainDB_0 extends _i1.SmartFake implements _i2.MainDB {
|
||||
_FakeMainDB_0(
|
||||
Object parent,
|
||||
Invocation parentInvocation,
|
||||
) : super(
|
||||
parent,
|
||||
parentInvocation,
|
||||
);
|
||||
}
|
||||
|
||||
/// A class which mocks [ThemeService].
|
||||
///
|
||||
/// See the documentation for Mockito's code generation for more information.
|
||||
class MockThemeService extends _i1.Mock implements _i3.ThemeService {
|
||||
MockThemeService() {
|
||||
_i1.throwOnMissingStub(this);
|
||||
}
|
||||
|
||||
@override
|
||||
_i2.MainDB get db => (super.noSuchMethod(
|
||||
Invocation.getter(#db),
|
||||
returnValue: _FakeMainDB_0(
|
||||
this,
|
||||
Invocation.getter(#db),
|
||||
),
|
||||
) as _i2.MainDB);
|
||||
@override
|
||||
List<_i4.StackTheme> get installedThemes => (super.noSuchMethod(
|
||||
Invocation.getter(#installedThemes),
|
||||
returnValue: <_i4.StackTheme>[],
|
||||
) as List<_i4.StackTheme>);
|
||||
@override
|
||||
void init(_i2.MainDB? db) => super.noSuchMethod(
|
||||
Invocation.method(
|
||||
#init,
|
||||
[db],
|
||||
),
|
||||
returnValueForMissingStub: null,
|
||||
);
|
||||
@override
|
||||
_i5.Future<void> install({required _i6.Uint8List? themeArchiveData}) =>
|
||||
(super.noSuchMethod(
|
||||
Invocation.method(
|
||||
#install,
|
||||
[],
|
||||
{#themeArchiveData: themeArchiveData},
|
||||
),
|
||||
returnValue: _i5.Future<void>.value(),
|
||||
returnValueForMissingStub: _i5.Future<void>.value(),
|
||||
) as _i5.Future<void>);
|
||||
@override
|
||||
_i5.Future<void> remove({required String? themeId}) => (super.noSuchMethod(
|
||||
Invocation.method(
|
||||
#remove,
|
||||
[],
|
||||
{#themeId: themeId},
|
||||
),
|
||||
returnValue: _i5.Future<void>.value(),
|
||||
returnValueForMissingStub: _i5.Future<void>.value(),
|
||||
) as _i5.Future<void>);
|
||||
@override
|
||||
_i5.Future<bool> verifyInstalled({required String? themeId}) =>
|
||||
(super.noSuchMethod(
|
||||
Invocation.method(
|
||||
#verifyInstalled,
|
||||
[],
|
||||
{#themeId: themeId},
|
||||
),
|
||||
returnValue: _i5.Future<bool>.value(false),
|
||||
) as _i5.Future<bool>);
|
||||
@override
|
||||
_i5.Future<List<_i3.StackThemeMetaData>> fetchThemes() => (super.noSuchMethod(
|
||||
Invocation.method(
|
||||
#fetchThemes,
|
||||
[],
|
||||
),
|
||||
returnValue: _i5.Future<List<_i3.StackThemeMetaData>>.value(
|
||||
<_i3.StackThemeMetaData>[]),
|
||||
) as _i5.Future<List<_i3.StackThemeMetaData>>);
|
||||
@override
|
||||
_i5.Future<_i6.Uint8List> fetchTheme(
|
||||
{required _i3.StackThemeMetaData? themeMetaData}) =>
|
||||
(super.noSuchMethod(
|
||||
Invocation.method(
|
||||
#fetchTheme,
|
||||
[],
|
||||
{#themeMetaData: themeMetaData},
|
||||
),
|
||||
returnValue: _i5.Future<_i6.Uint8List>.value(_i6.Uint8List(0)),
|
||||
) as _i5.Future<_i6.Uint8List>);
|
||||
@override
|
||||
_i4.StackTheme? getTheme({required String? themeId}) =>
|
||||
(super.noSuchMethod(Invocation.method(
|
||||
#getTheme,
|
||||
[],
|
||||
{#themeId: themeId},
|
||||
)) as _i4.StackTheme?);
|
||||
}
|
|
@ -1,12 +1,13 @@
|
|||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_svg/svg.dart';
|
||||
import 'package:flutter_test/flutter_test.dart';
|
||||
import 'package:stackwallet/models/isar/sw_theme.dart';
|
||||
import 'package:stackwallet/models/isar/stack_theme.dart';
|
||||
import 'package:stackwallet/themes/stack_colors.dart';
|
||||
import 'package:stackwallet/themes/defaults/dark.dart';
|
||||
import 'package:stackwallet/widgets/custom_pin_put/custom_pin_put.dart';
|
||||
import 'package:stackwallet/widgets/custom_pin_put/pin_keyboard.dart';
|
||||
|
||||
import '../sample_data/theme_json.dart';
|
||||
|
||||
void main() {
|
||||
group("CustomPinPut tests, non-random PIN", () {
|
||||
testWidgets("CustomPinPut with 4 fields builds correctly, non-random PIN",
|
||||
|
@ -22,8 +23,8 @@ void main() {
|
|||
extensions: [
|
||||
StackColors.fromStackColorTheme(
|
||||
StackTheme.fromJson(
|
||||
json: darkJson,
|
||||
applicationThemesDirectoryPath: "",
|
||||
json: lightThemeJsonMap,
|
||||
applicationThemesDirectoryPath: "test",
|
||||
),
|
||||
),
|
||||
],
|
||||
|
@ -60,8 +61,8 @@ void main() {
|
|||
extensions: [
|
||||
StackColors.fromStackColorTheme(
|
||||
StackTheme.fromJson(
|
||||
json: darkJson,
|
||||
applicationThemesDirectoryPath: "",
|
||||
json: lightThemeJsonMap,
|
||||
applicationThemesDirectoryPath: "test",
|
||||
),
|
||||
),
|
||||
],
|
||||
|
@ -111,8 +112,8 @@ void main() {
|
|||
extensions: [
|
||||
StackColors.fromStackColorTheme(
|
||||
StackTheme.fromJson(
|
||||
json: darkJson,
|
||||
applicationThemesDirectoryPath: "",
|
||||
json: lightThemeJsonMap,
|
||||
applicationThemesDirectoryPath: "test",
|
||||
),
|
||||
),
|
||||
],
|
||||
|
@ -149,8 +150,8 @@ void main() {
|
|||
extensions: [
|
||||
StackColors.fromStackColorTheme(
|
||||
StackTheme.fromJson(
|
||||
json: darkJson,
|
||||
applicationThemesDirectoryPath: "",
|
||||
json: lightThemeJsonMap,
|
||||
applicationThemesDirectoryPath: "test",
|
||||
),
|
||||
),
|
||||
],
|
||||
|
@ -187,8 +188,8 @@ void main() {
|
|||
extensions: [
|
||||
StackColors.fromStackColorTheme(
|
||||
StackTheme.fromJson(
|
||||
json: darkJson,
|
||||
applicationThemesDirectoryPath: "",
|
||||
json: lightThemeJsonMap,
|
||||
applicationThemesDirectoryPath: "test",
|
||||
),
|
||||
),
|
||||
],
|
||||
|
@ -224,8 +225,8 @@ void main() {
|
|||
extensions: [
|
||||
StackColors.fromStackColorTheme(
|
||||
StackTheme.fromJson(
|
||||
json: darkJson,
|
||||
applicationThemesDirectoryPath: "",
|
||||
json: lightThemeJsonMap,
|
||||
applicationThemesDirectoryPath: "test",
|
||||
),
|
||||
),
|
||||
],
|
||||
|
@ -266,8 +267,8 @@ void main() {
|
|||
extensions: [
|
||||
StackColors.fromStackColorTheme(
|
||||
StackTheme.fromJson(
|
||||
json: darkJson,
|
||||
applicationThemesDirectoryPath: "",
|
||||
json: lightThemeJsonMap,
|
||||
applicationThemesDirectoryPath: "test",
|
||||
),
|
||||
),
|
||||
],
|
||||
|
@ -304,8 +305,8 @@ void main() {
|
|||
extensions: [
|
||||
StackColors.fromStackColorTheme(
|
||||
StackTheme.fromJson(
|
||||
json: darkJson,
|
||||
applicationThemesDirectoryPath: "",
|
||||
json: lightThemeJsonMap,
|
||||
applicationThemesDirectoryPath: "test",
|
||||
),
|
||||
),
|
||||
],
|
||||
|
@ -355,8 +356,8 @@ void main() {
|
|||
extensions: [
|
||||
StackColors.fromStackColorTheme(
|
||||
StackTheme.fromJson(
|
||||
json: darkJson,
|
||||
applicationThemesDirectoryPath: "",
|
||||
json: lightThemeJsonMap,
|
||||
applicationThemesDirectoryPath: "test",
|
||||
),
|
||||
),
|
||||
],
|
||||
|
@ -393,8 +394,8 @@ void main() {
|
|||
extensions: [
|
||||
StackColors.fromStackColorTheme(
|
||||
StackTheme.fromJson(
|
||||
json: darkJson,
|
||||
applicationThemesDirectoryPath: "",
|
||||
json: lightThemeJsonMap,
|
||||
applicationThemesDirectoryPath: "test",
|
||||
),
|
||||
),
|
||||
],
|
||||
|
@ -431,8 +432,8 @@ void main() {
|
|||
extensions: [
|
||||
StackColors.fromStackColorTheme(
|
||||
StackTheme.fromJson(
|
||||
json: darkJson,
|
||||
applicationThemesDirectoryPath: "",
|
||||
json: lightThemeJsonMap,
|
||||
applicationThemesDirectoryPath: "test",
|
||||
),
|
||||
),
|
||||
],
|
||||
|
@ -468,8 +469,8 @@ void main() {
|
|||
extensions: [
|
||||
StackColors.fromStackColorTheme(
|
||||
StackTheme.fromJson(
|
||||
json: darkJson,
|
||||
applicationThemesDirectoryPath: "",
|
||||
json: lightThemeJsonMap,
|
||||
applicationThemesDirectoryPath: "test",
|
||||
),
|
||||
),
|
||||
],
|
||||
|
|
|
@ -1,10 +1,11 @@
|
|||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_test/flutter_test.dart';
|
||||
import 'package:stackwallet/models/isar/sw_theme.dart';
|
||||
import 'package:stackwallet/models/isar/stack_theme.dart';
|
||||
import 'package:stackwallet/themes/stack_colors.dart';
|
||||
import 'package:stackwallet/themes/defaults/dark.dart';
|
||||
import 'package:stackwallet/widgets/desktop/custom_text_button.dart';
|
||||
|
||||
import '../../sample_data/theme_json.dart';
|
||||
|
||||
void main() {
|
||||
testWidgets("Test text button ", (widgetTester) async {
|
||||
final key = UniqueKey();
|
||||
|
@ -15,8 +16,8 @@ void main() {
|
|||
extensions: [
|
||||
StackColors.fromStackColorTheme(
|
||||
StackTheme.fromJson(
|
||||
json: darkJson,
|
||||
applicationThemesDirectoryPath: "",
|
||||
json: lightThemeJsonMap,
|
||||
applicationThemesDirectoryPath: "test",
|
||||
),
|
||||
),
|
||||
],
|
||||
|
|
|
@ -1,12 +1,13 @@
|
|||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_test/flutter_test.dart';
|
||||
import 'package:stackwallet/models/isar/sw_theme.dart';
|
||||
import 'package:stackwallet/models/isar/stack_theme.dart';
|
||||
import 'package:stackwallet/pages_desktop_specific/my_stack_view/exit_to_my_stack_button.dart';
|
||||
import 'package:stackwallet/themes/stack_colors.dart';
|
||||
import 'package:stackwallet/themes/defaults/dark.dart';
|
||||
import 'package:stackwallet/widgets/custom_buttons/app_bar_icon_button.dart';
|
||||
import 'package:stackwallet/widgets/desktop/desktop_app_bar.dart';
|
||||
|
||||
import '../../sample_data/theme_json.dart';
|
||||
|
||||
void main() {
|
||||
testWidgets("Test DesktopAppBar widget", (widgetTester) async {
|
||||
final key = UniqueKey();
|
||||
|
@ -17,8 +18,8 @@ void main() {
|
|||
extensions: [
|
||||
StackColors.fromStackColorTheme(
|
||||
StackTheme.fromJson(
|
||||
json: darkJson,
|
||||
applicationThemesDirectoryPath: "",
|
||||
json: lightThemeJsonMap,
|
||||
applicationThemesDirectoryPath: "test",
|
||||
),
|
||||
),
|
||||
],
|
||||
|
|
|
@ -2,12 +2,13 @@ import 'package:flutter/material.dart';
|
|||
import 'package:flutter_riverpod/flutter_riverpod.dart';
|
||||
import 'package:flutter_test/flutter_test.dart';
|
||||
import 'package:mockingjay/mockingjay.dart' as mockingjay;
|
||||
import 'package:stackwallet/models/isar/sw_theme.dart';
|
||||
import 'package:stackwallet/models/isar/stack_theme.dart';
|
||||
import 'package:stackwallet/themes/stack_colors.dart';
|
||||
import 'package:stackwallet/themes/defaults/dark.dart';
|
||||
import 'package:stackwallet/widgets/custom_buttons/app_bar_icon_button.dart';
|
||||
import 'package:stackwallet/widgets/desktop/desktop_dialog_close_button.dart';
|
||||
|
||||
import '../../sample_data/theme_json.dart';
|
||||
|
||||
void main() {
|
||||
testWidgets("test DesktopDialog button pressed", (widgetTester) async {
|
||||
final key = UniqueKey();
|
||||
|
@ -22,8 +23,8 @@ void main() {
|
|||
extensions: [
|
||||
StackColors.fromStackColorTheme(
|
||||
StackTheme.fromJson(
|
||||
json: darkJson,
|
||||
applicationThemesDirectoryPath: "",
|
||||
json: lightThemeJsonMap,
|
||||
applicationThemesDirectoryPath: "test",
|
||||
),
|
||||
),
|
||||
],
|
||||
|
|
|
@ -1,11 +1,12 @@
|
|||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_test/flutter_test.dart';
|
||||
import 'package:stackwallet/models/isar/sw_theme.dart';
|
||||
import 'package:stackwallet/models/isar/stack_theme.dart';
|
||||
import 'package:stackwallet/themes/stack_colors.dart';
|
||||
import 'package:stackwallet/themes/defaults/dark.dart';
|
||||
import 'package:stackwallet/widgets/desktop/desktop_dialog.dart';
|
||||
import 'package:stackwallet/widgets/desktop/desktop_dialog_close_button.dart';
|
||||
|
||||
import '../../sample_data/theme_json.dart';
|
||||
|
||||
void main() {
|
||||
testWidgets("test DesktopDialog builds", (widgetTester) async {
|
||||
final key = UniqueKey();
|
||||
|
@ -16,8 +17,8 @@ void main() {
|
|||
extensions: [
|
||||
StackColors.fromStackColorTheme(
|
||||
StackTheme.fromJson(
|
||||
json: darkJson,
|
||||
applicationThemesDirectoryPath: "",
|
||||
json: lightThemeJsonMap,
|
||||
applicationThemesDirectoryPath: "test",
|
||||
),
|
||||
),
|
||||
],
|
||||
|
|
|
@ -1,29 +1,50 @@
|
|||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_riverpod/flutter_riverpod.dart';
|
||||
import 'package:flutter_test/flutter_test.dart';
|
||||
import 'package:stackwallet/models/isar/sw_theme.dart';
|
||||
import 'package:mockito/annotations.dart';
|
||||
import 'package:mockito/mockito.dart';
|
||||
import 'package:stackwallet/models/isar/stack_theme.dart';
|
||||
import 'package:stackwallet/themes/stack_colors.dart';
|
||||
import 'package:stackwallet/themes/defaults/dark.dart';
|
||||
import 'package:stackwallet/themes/theme_service.dart';
|
||||
import 'package:stackwallet/widgets/desktop/desktop_scaffold.dart';
|
||||
|
||||
import '../../sample_data/theme_json.dart';
|
||||
import 'desktop_scaffold_test.mocks.dart';
|
||||
|
||||
@GenerateMocks([
|
||||
ThemeService,
|
||||
])
|
||||
void main() {
|
||||
testWidgets("test DesktopScaffold", (widgetTester) async {
|
||||
final key = UniqueKey();
|
||||
final mockThemeService = MockThemeService();
|
||||
when(mockThemeService.getTheme(themeId: "light")).thenAnswer(
|
||||
(_) => StackTheme.fromJson(
|
||||
json: lightThemeJsonMap,
|
||||
applicationThemesDirectoryPath: "test",
|
||||
),
|
||||
);
|
||||
await widgetTester.pumpWidget(
|
||||
MaterialApp(
|
||||
theme: ThemeData(
|
||||
extensions: [
|
||||
StackColors.fromStackColorTheme(
|
||||
StackTheme.fromJson(
|
||||
json: darkJson,
|
||||
applicationThemesDirectoryPath: "",
|
||||
ProviderScope(
|
||||
overrides: [
|
||||
pThemeService.overrideWithValue(mockThemeService),
|
||||
],
|
||||
child: MaterialApp(
|
||||
theme: ThemeData(
|
||||
extensions: [
|
||||
StackColors.fromStackColorTheme(
|
||||
StackTheme.fromJson(
|
||||
json: lightThemeJsonMap,
|
||||
applicationThemesDirectoryPath: "test",
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
home: Material(
|
||||
child: DesktopScaffold(
|
||||
key: key,
|
||||
body: const SizedBox(),
|
||||
),
|
||||
],
|
||||
),
|
||||
home: Material(
|
||||
child: DesktopScaffold(
|
||||
key: key,
|
||||
body: const SizedBox(),
|
||||
),
|
||||
),
|
||||
),
|
||||
|
@ -32,25 +53,37 @@ void main() {
|
|||
|
||||
testWidgets("Test MasterScaffold for non desktop", (widgetTester) async {
|
||||
final key = UniqueKey();
|
||||
final mockThemeService = MockThemeService();
|
||||
when(mockThemeService.getTheme(themeId: "light")).thenAnswer(
|
||||
(_) => StackTheme.fromJson(
|
||||
json: lightThemeJsonMap,
|
||||
applicationThemesDirectoryPath: "test",
|
||||
),
|
||||
);
|
||||
|
||||
await widgetTester.pumpWidget(
|
||||
MaterialApp(
|
||||
theme: ThemeData(
|
||||
extensions: [
|
||||
StackColors.fromStackColorTheme(
|
||||
StackTheme.fromJson(
|
||||
json: darkJson,
|
||||
applicationThemesDirectoryPath: "",
|
||||
ProviderScope(
|
||||
overrides: [
|
||||
pThemeService.overrideWithValue(mockThemeService),
|
||||
],
|
||||
child: MaterialApp(
|
||||
theme: ThemeData(
|
||||
extensions: [
|
||||
StackColors.fromStackColorTheme(
|
||||
StackTheme.fromJson(
|
||||
json: lightThemeJsonMap,
|
||||
applicationThemesDirectoryPath: "test",
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
home: Material(
|
||||
child: MasterScaffold(
|
||||
key: key,
|
||||
body: const SizedBox(),
|
||||
appBar: AppBar(),
|
||||
isDesktop: false,
|
||||
),
|
||||
],
|
||||
),
|
||||
home: Material(
|
||||
child: MasterScaffold(
|
||||
key: key,
|
||||
body: const SizedBox(),
|
||||
appBar: AppBar(),
|
||||
isDesktop: false,
|
||||
),
|
||||
),
|
||||
),
|
||||
|
@ -59,25 +92,38 @@ void main() {
|
|||
|
||||
testWidgets("Test MasterScaffold for desktop", (widgetTester) async {
|
||||
final key = UniqueKey();
|
||||
final mockThemeService = MockThemeService();
|
||||
|
||||
when(mockThemeService.getTheme(themeId: "light")).thenAnswer(
|
||||
(_) => StackTheme.fromJson(
|
||||
json: lightThemeJsonMap,
|
||||
applicationThemesDirectoryPath: "test",
|
||||
),
|
||||
);
|
||||
|
||||
await widgetTester.pumpWidget(
|
||||
MaterialApp(
|
||||
theme: ThemeData(
|
||||
extensions: [
|
||||
StackColors.fromStackColorTheme(
|
||||
StackTheme.fromJson(
|
||||
json: darkJson,
|
||||
applicationThemesDirectoryPath: "",
|
||||
ProviderScope(
|
||||
overrides: [
|
||||
pThemeService.overrideWithValue(mockThemeService),
|
||||
],
|
||||
child: MaterialApp(
|
||||
theme: ThemeData(
|
||||
extensions: [
|
||||
StackColors.fromStackColorTheme(
|
||||
StackTheme.fromJson(
|
||||
json: lightThemeJsonMap,
|
||||
applicationThemesDirectoryPath: "test",
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
home: Material(
|
||||
child: MasterScaffold(
|
||||
key: key,
|
||||
body: const SizedBox(),
|
||||
appBar: AppBar(),
|
||||
isDesktop: true,
|
||||
),
|
||||
],
|
||||
),
|
||||
home: Material(
|
||||
child: MasterScaffold(
|
||||
key: key,
|
||||
body: const SizedBox(),
|
||||
appBar: AppBar(),
|
||||
isDesktop: true,
|
||||
),
|
||||
),
|
||||
),
|
||||
|
|
122
test/widget_tests/desktop/desktop_scaffold_test.mocks.dart
Normal file
122
test/widget_tests/desktop/desktop_scaffold_test.mocks.dart
Normal file
|
@ -0,0 +1,122 @@
|
|||
// Mocks generated by Mockito 5.3.2 from annotations
|
||||
// in stackwallet/test/widget_tests/desktop/desktop_scaffold_test.dart.
|
||||
// Do not manually edit this file.
|
||||
|
||||
// ignore_for_file: no_leading_underscores_for_library_prefixes
|
||||
import 'dart:async' as _i5;
|
||||
import 'dart:typed_data' as _i6;
|
||||
|
||||
import 'package:mockito/mockito.dart' as _i1;
|
||||
import 'package:stackwallet/db/isar/main_db.dart' as _i2;
|
||||
import 'package:stackwallet/models/isar/stack_theme.dart' as _i4;
|
||||
import 'package:stackwallet/themes/theme_service.dart' as _i3;
|
||||
|
||||
// ignore_for_file: type=lint
|
||||
// ignore_for_file: avoid_redundant_argument_values
|
||||
// ignore_for_file: avoid_setters_without_getters
|
||||
// ignore_for_file: comment_references
|
||||
// ignore_for_file: implementation_imports
|
||||
// ignore_for_file: invalid_use_of_visible_for_testing_member
|
||||
// ignore_for_file: prefer_const_constructors
|
||||
// ignore_for_file: unnecessary_parenthesis
|
||||
// ignore_for_file: camel_case_types
|
||||
// ignore_for_file: subtype_of_sealed_class
|
||||
|
||||
class _FakeMainDB_0 extends _i1.SmartFake implements _i2.MainDB {
|
||||
_FakeMainDB_0(
|
||||
Object parent,
|
||||
Invocation parentInvocation,
|
||||
) : super(
|
||||
parent,
|
||||
parentInvocation,
|
||||
);
|
||||
}
|
||||
|
||||
/// A class which mocks [ThemeService].
|
||||
///
|
||||
/// See the documentation for Mockito's code generation for more information.
|
||||
class MockThemeService extends _i1.Mock implements _i3.ThemeService {
|
||||
MockThemeService() {
|
||||
_i1.throwOnMissingStub(this);
|
||||
}
|
||||
|
||||
@override
|
||||
_i2.MainDB get db => (super.noSuchMethod(
|
||||
Invocation.getter(#db),
|
||||
returnValue: _FakeMainDB_0(
|
||||
this,
|
||||
Invocation.getter(#db),
|
||||
),
|
||||
) as _i2.MainDB);
|
||||
@override
|
||||
List<_i4.StackTheme> get installedThemes => (super.noSuchMethod(
|
||||
Invocation.getter(#installedThemes),
|
||||
returnValue: <_i4.StackTheme>[],
|
||||
) as List<_i4.StackTheme>);
|
||||
@override
|
||||
void init(_i2.MainDB? db) => super.noSuchMethod(
|
||||
Invocation.method(
|
||||
#init,
|
||||
[db],
|
||||
),
|
||||
returnValueForMissingStub: null,
|
||||
);
|
||||
@override
|
||||
_i5.Future<void> install({required _i6.Uint8List? themeArchiveData}) =>
|
||||
(super.noSuchMethod(
|
||||
Invocation.method(
|
||||
#install,
|
||||
[],
|
||||
{#themeArchiveData: themeArchiveData},
|
||||
),
|
||||
returnValue: _i5.Future<void>.value(),
|
||||
returnValueForMissingStub: _i5.Future<void>.value(),
|
||||
) as _i5.Future<void>);
|
||||
@override
|
||||
_i5.Future<void> remove({required String? themeId}) => (super.noSuchMethod(
|
||||
Invocation.method(
|
||||
#remove,
|
||||
[],
|
||||
{#themeId: themeId},
|
||||
),
|
||||
returnValue: _i5.Future<void>.value(),
|
||||
returnValueForMissingStub: _i5.Future<void>.value(),
|
||||
) as _i5.Future<void>);
|
||||
@override
|
||||
_i5.Future<bool> verifyInstalled({required String? themeId}) =>
|
||||
(super.noSuchMethod(
|
||||
Invocation.method(
|
||||
#verifyInstalled,
|
||||
[],
|
||||
{#themeId: themeId},
|
||||
),
|
||||
returnValue: _i5.Future<bool>.value(false),
|
||||
) as _i5.Future<bool>);
|
||||
@override
|
||||
_i5.Future<List<_i3.StackThemeMetaData>> fetchThemes() => (super.noSuchMethod(
|
||||
Invocation.method(
|
||||
#fetchThemes,
|
||||
[],
|
||||
),
|
||||
returnValue: _i5.Future<List<_i3.StackThemeMetaData>>.value(
|
||||
<_i3.StackThemeMetaData>[]),
|
||||
) as _i5.Future<List<_i3.StackThemeMetaData>>);
|
||||
@override
|
||||
_i5.Future<_i6.Uint8List> fetchTheme(
|
||||
{required _i3.StackThemeMetaData? themeMetaData}) =>
|
||||
(super.noSuchMethod(
|
||||
Invocation.method(
|
||||
#fetchTheme,
|
||||
[],
|
||||
{#themeMetaData: themeMetaData},
|
||||
),
|
||||
returnValue: _i5.Future<_i6.Uint8List>.value(_i6.Uint8List(0)),
|
||||
) as _i5.Future<_i6.Uint8List>);
|
||||
@override
|
||||
_i4.StackTheme? getTheme({required String? themeId}) =>
|
||||
(super.noSuchMethod(Invocation.method(
|
||||
#getTheme,
|
||||
[],
|
||||
{#themeId: themeId},
|
||||
)) as _i4.StackTheme?);
|
||||
}
|
|
@ -3,11 +3,12 @@ import 'package:flutter/material.dart';
|
|||
import 'package:flutter_riverpod/flutter_riverpod.dart';
|
||||
import 'package:flutter_test/flutter_test.dart';
|
||||
import 'package:mockingjay/mockingjay.dart' as mockingjay;
|
||||
import 'package:stackwallet/models/isar/sw_theme.dart';
|
||||
import 'package:stackwallet/models/isar/stack_theme.dart';
|
||||
import 'package:stackwallet/themes/stack_colors.dart';
|
||||
import 'package:stackwallet/themes/defaults/dark.dart';
|
||||
import 'package:stackwallet/widgets/emoji_select_sheet.dart';
|
||||
|
||||
import '../sample_data/theme_json.dart';
|
||||
|
||||
void main() {
|
||||
testWidgets("Widget displays correctly", (tester) async {
|
||||
const emojiSelectSheet = EmojiSelectSheet();
|
||||
|
@ -18,8 +19,8 @@ void main() {
|
|||
extensions: [
|
||||
StackColors.fromStackColorTheme(
|
||||
StackTheme.fromJson(
|
||||
json: darkJson,
|
||||
applicationThemesDirectoryPath: "",
|
||||
json: lightThemeJsonMap,
|
||||
applicationThemesDirectoryPath: "test",
|
||||
),
|
||||
),
|
||||
],
|
||||
|
@ -47,8 +48,8 @@ void main() {
|
|||
extensions: [
|
||||
StackColors.fromStackColorTheme(
|
||||
StackTheme.fromJson(
|
||||
json: darkJson,
|
||||
applicationThemesDirectoryPath: "",
|
||||
json: lightThemeJsonMap,
|
||||
applicationThemesDirectoryPath: "test",
|
||||
),
|
||||
),
|
||||
],
|
||||
|
|
|
@ -1,11 +1,12 @@
|
|||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_svg/svg.dart';
|
||||
import 'package:flutter_test/flutter_test.dart';
|
||||
import 'package:stackwallet/models/isar/sw_theme.dart';
|
||||
import 'package:stackwallet/models/isar/stack_theme.dart';
|
||||
import 'package:stackwallet/themes/stack_colors.dart';
|
||||
import 'package:stackwallet/themes/defaults/dark.dart';
|
||||
import 'package:stackwallet/widgets/icon_widgets/addressbook_icon.dart';
|
||||
|
||||
import '../../sample_data/theme_json.dart';
|
||||
|
||||
void main() {
|
||||
testWidgets("test address book icon widget", (widgetTester) async {
|
||||
final key = UniqueKey();
|
||||
|
@ -19,8 +20,8 @@ void main() {
|
|||
extensions: [
|
||||
StackColors.fromStackColorTheme(
|
||||
StackTheme.fromJson(
|
||||
json: darkJson,
|
||||
applicationThemesDirectoryPath: "",
|
||||
json: lightThemeJsonMap,
|
||||
applicationThemesDirectoryPath: "test",
|
||||
),
|
||||
),
|
||||
],
|
||||
|
|
|
@ -5,7 +5,7 @@ import 'package:flutter_test/flutter_test.dart';
|
|||
import 'package:mockito/annotations.dart';
|
||||
import 'package:mockito/mockito.dart';
|
||||
import 'package:stackwallet/models/balance.dart';
|
||||
import 'package:stackwallet/models/isar/sw_theme.dart';
|
||||
import 'package:stackwallet/models/isar/stack_theme.dart';
|
||||
import 'package:stackwallet/providers/providers.dart';
|
||||
import 'package:stackwallet/services/coins/bitcoin/bitcoin_wallet.dart';
|
||||
import 'package:stackwallet/services/coins/coin_service.dart';
|
||||
|
@ -15,12 +15,13 @@ import 'package:stackwallet/services/node_service.dart';
|
|||
import 'package:stackwallet/services/wallets.dart';
|
||||
import 'package:stackwallet/services/wallets_service.dart';
|
||||
import 'package:stackwallet/themes/stack_colors.dart';
|
||||
import 'package:stackwallet/themes/defaults/dark.dart';
|
||||
import 'package:stackwallet/themes/theme_service.dart';
|
||||
import 'package:stackwallet/utilities/amount/amount.dart';
|
||||
import 'package:stackwallet/utilities/enums/coin_enum.dart';
|
||||
import 'package:stackwallet/utilities/listenable_list.dart';
|
||||
import 'package:stackwallet/widgets/managed_favorite.dart';
|
||||
|
||||
import '../sample_data/theme_json.dart';
|
||||
import 'managed_favorite_test.mocks.dart';
|
||||
|
||||
/// quick amount constructor wrapper. Using an int is bad practice but for
|
||||
|
@ -34,6 +35,7 @@ Amount _a(int i) => Amount.fromDecimal(
|
|||
Wallets,
|
||||
WalletsService,
|
||||
BitcoinWallet,
|
||||
ThemeService,
|
||||
LocaleService
|
||||
], customMocks: [
|
||||
MockSpec<NodeService>(returnNullOnMissingStub: true),
|
||||
|
@ -44,7 +46,14 @@ void main() {
|
|||
testWidgets("Test wallet info row displays correctly", (widgetTester) async {
|
||||
final wallets = MockWallets();
|
||||
final CoinServiceAPI wallet = MockBitcoinWallet();
|
||||
final mockThemeService = MockThemeService();
|
||||
|
||||
when(mockThemeService.getTheme(themeId: "light")).thenAnswer(
|
||||
(_) => StackTheme.fromJson(
|
||||
json: lightThemeJsonMap,
|
||||
applicationThemesDirectoryPath: "test",
|
||||
),
|
||||
);
|
||||
when(wallet.coin).thenAnswer((_) => Coin.bitcoin);
|
||||
when(wallet.walletName).thenAnswer((_) => "some wallet");
|
||||
when(wallet.walletId).thenAnswer((_) => "some wallet id");
|
||||
|
@ -68,14 +77,15 @@ void main() {
|
|||
ProviderScope(
|
||||
overrides: [
|
||||
walletsChangeNotifierProvider.overrideWithValue(wallets),
|
||||
pThemeService.overrideWithValue(mockThemeService),
|
||||
],
|
||||
child: MaterialApp(
|
||||
theme: ThemeData(
|
||||
extensions: [
|
||||
StackColors.fromStackColorTheme(
|
||||
StackTheme.fromJson(
|
||||
json: darkJson,
|
||||
applicationThemesDirectoryPath: "",
|
||||
json: lightThemeJsonMap,
|
||||
applicationThemesDirectoryPath: "test",
|
||||
),
|
||||
),
|
||||
],
|
||||
|
@ -98,7 +108,14 @@ void main() {
|
|||
final CoinServiceAPI wallet = MockBitcoinWallet();
|
||||
final mockLocaleService = MockLocaleService();
|
||||
final mockWalletsService = MockWalletsService();
|
||||
final mockThemeService = MockThemeService();
|
||||
|
||||
when(mockThemeService.getTheme(themeId: "light")).thenAnswer(
|
||||
(_) => StackTheme.fromJson(
|
||||
json: lightThemeJsonMap,
|
||||
applicationThemesDirectoryPath: "test",
|
||||
),
|
||||
);
|
||||
when(wallet.coin).thenAnswer((_) => Coin.bitcoin);
|
||||
when(wallet.walletName).thenAnswer((_) => "some wallet");
|
||||
when(wallet.walletId).thenAnswer((_) => "some wallet id");
|
||||
|
@ -138,6 +155,7 @@ void main() {
|
|||
.overrideWithValue(mockLocaleService),
|
||||
favoritesProvider.overrideWithValue(favorites),
|
||||
nonFavoritesProvider.overrideWithValue(nonfavorites),
|
||||
pThemeService.overrideWithValue(mockThemeService),
|
||||
walletsServiceChangeNotifierProvider
|
||||
.overrideWithValue(mockWalletsService)
|
||||
],
|
||||
|
@ -146,8 +164,8 @@ void main() {
|
|||
extensions: [
|
||||
StackColors.fromStackColorTheme(
|
||||
StackTheme.fromJson(
|
||||
json: darkJson,
|
||||
applicationThemesDirectoryPath: "",
|
||||
json: lightThemeJsonMap,
|
||||
applicationThemesDirectoryPath: "test",
|
||||
),
|
||||
),
|
||||
],
|
||||
|
@ -169,7 +187,14 @@ void main() {
|
|||
final CoinServiceAPI wallet = MockBitcoinWallet();
|
||||
final mockLocaleService = MockLocaleService();
|
||||
final mockWalletsService = MockWalletsService();
|
||||
final mockThemeService = MockThemeService();
|
||||
|
||||
when(mockThemeService.getTheme(themeId: "light")).thenAnswer(
|
||||
(_) => StackTheme.fromJson(
|
||||
json: lightThemeJsonMap,
|
||||
applicationThemesDirectoryPath: "test",
|
||||
),
|
||||
);
|
||||
when(wallet.coin).thenAnswer((_) => Coin.bitcoin);
|
||||
when(wallet.walletName).thenAnswer((_) => "some wallet");
|
||||
when(wallet.walletId).thenAnswer((_) => "some wallet id");
|
||||
|
@ -209,6 +234,7 @@ void main() {
|
|||
.overrideWithValue(mockLocaleService),
|
||||
favoritesProvider.overrideWithValue(favorites),
|
||||
nonFavoritesProvider.overrideWithValue(nonfavorites),
|
||||
pThemeService.overrideWithValue(mockThemeService),
|
||||
walletsServiceChangeNotifierProvider
|
||||
.overrideWithValue(mockWalletsService)
|
||||
],
|
||||
|
@ -217,8 +243,8 @@ void main() {
|
|||
extensions: [
|
||||
StackColors.fromStackColorTheme(
|
||||
StackTheme.fromJson(
|
||||
json: darkJson,
|
||||
applicationThemesDirectoryPath: "",
|
||||
json: lightThemeJsonMap,
|
||||
applicationThemesDirectoryPath: "test",
|
||||
),
|
||||
),
|
||||
],
|
||||
|
|
|
@ -18,18 +18,20 @@ import 'package:stackwallet/electrumx_rpc/cached_electrumx.dart' as _i10;
|
|||
import 'package:stackwallet/electrumx_rpc/electrumx.dart' as _i9;
|
||||
import 'package:stackwallet/models/balance.dart' as _i11;
|
||||
import 'package:stackwallet/models/isar/models/isar_models.dart' as _i17;
|
||||
import 'package:stackwallet/models/node_model.dart' as _i31;
|
||||
import 'package:stackwallet/models/isar/stack_theme.dart' as _i31;
|
||||
import 'package:stackwallet/models/node_model.dart' as _i33;
|
||||
import 'package:stackwallet/models/paymint/fee_object_model.dart' as _i8;
|
||||
import 'package:stackwallet/models/signing_data.dart' as _i28;
|
||||
import 'package:stackwallet/services/coins/bitcoin/bitcoin_wallet.dart' as _i26;
|
||||
import 'package:stackwallet/services/coins/coin_service.dart' as _i20;
|
||||
import 'package:stackwallet/services/coins/manager.dart' as _i6;
|
||||
import 'package:stackwallet/services/locale_service.dart' as _i30;
|
||||
import 'package:stackwallet/services/locale_service.dart' as _i32;
|
||||
import 'package:stackwallet/services/node_service.dart' as _i3;
|
||||
import 'package:stackwallet/services/transaction_notification_tracker.dart'
|
||||
as _i7;
|
||||
import 'package:stackwallet/services/wallets.dart' as _i21;
|
||||
import 'package:stackwallet/services/wallets_service.dart' as _i2;
|
||||
import 'package:stackwallet/themes/theme_service.dart' as _i30;
|
||||
import 'package:stackwallet/utilities/amount/amount.dart' as _i14;
|
||||
import 'package:stackwallet/utilities/enums/coin_enum.dart' as _i22;
|
||||
import 'package:stackwallet/utilities/enums/derive_path_type_enum.dart' as _i27;
|
||||
|
@ -1955,10 +1957,100 @@ class MockBitcoinWallet extends _i1.Mock implements _i26.BitcoinWallet {
|
|||
) as _i23.Future<void>);
|
||||
}
|
||||
|
||||
/// A class which mocks [ThemeService].
|
||||
///
|
||||
/// See the documentation for Mockito's code generation for more information.
|
||||
class MockThemeService extends _i1.Mock implements _i30.ThemeService {
|
||||
MockThemeService() {
|
||||
_i1.throwOnMissingStub(this);
|
||||
}
|
||||
|
||||
@override
|
||||
_i12.MainDB get db => (super.noSuchMethod(
|
||||
Invocation.getter(#db),
|
||||
returnValue: _FakeMainDB_9(
|
||||
this,
|
||||
Invocation.getter(#db),
|
||||
),
|
||||
) as _i12.MainDB);
|
||||
@override
|
||||
List<_i31.StackTheme> get installedThemes => (super.noSuchMethod(
|
||||
Invocation.getter(#installedThemes),
|
||||
returnValue: <_i31.StackTheme>[],
|
||||
) as List<_i31.StackTheme>);
|
||||
@override
|
||||
void init(_i12.MainDB? db) => super.noSuchMethod(
|
||||
Invocation.method(
|
||||
#init,
|
||||
[db],
|
||||
),
|
||||
returnValueForMissingStub: null,
|
||||
);
|
||||
@override
|
||||
_i23.Future<void> install({required _i29.Uint8List? themeArchiveData}) =>
|
||||
(super.noSuchMethod(
|
||||
Invocation.method(
|
||||
#install,
|
||||
[],
|
||||
{#themeArchiveData: themeArchiveData},
|
||||
),
|
||||
returnValue: _i23.Future<void>.value(),
|
||||
returnValueForMissingStub: _i23.Future<void>.value(),
|
||||
) as _i23.Future<void>);
|
||||
@override
|
||||
_i23.Future<void> remove({required String? themeId}) => (super.noSuchMethod(
|
||||
Invocation.method(
|
||||
#remove,
|
||||
[],
|
||||
{#themeId: themeId},
|
||||
),
|
||||
returnValue: _i23.Future<void>.value(),
|
||||
returnValueForMissingStub: _i23.Future<void>.value(),
|
||||
) as _i23.Future<void>);
|
||||
@override
|
||||
_i23.Future<bool> verifyInstalled({required String? themeId}) =>
|
||||
(super.noSuchMethod(
|
||||
Invocation.method(
|
||||
#verifyInstalled,
|
||||
[],
|
||||
{#themeId: themeId},
|
||||
),
|
||||
returnValue: _i23.Future<bool>.value(false),
|
||||
) as _i23.Future<bool>);
|
||||
@override
|
||||
_i23.Future<List<_i30.StackThemeMetaData>> fetchThemes() =>
|
||||
(super.noSuchMethod(
|
||||
Invocation.method(
|
||||
#fetchThemes,
|
||||
[],
|
||||
),
|
||||
returnValue: _i23.Future<List<_i30.StackThemeMetaData>>.value(
|
||||
<_i30.StackThemeMetaData>[]),
|
||||
) as _i23.Future<List<_i30.StackThemeMetaData>>);
|
||||
@override
|
||||
_i23.Future<_i29.Uint8List> fetchTheme(
|
||||
{required _i30.StackThemeMetaData? themeMetaData}) =>
|
||||
(super.noSuchMethod(
|
||||
Invocation.method(
|
||||
#fetchTheme,
|
||||
[],
|
||||
{#themeMetaData: themeMetaData},
|
||||
),
|
||||
returnValue: _i23.Future<_i29.Uint8List>.value(_i29.Uint8List(0)),
|
||||
) as _i23.Future<_i29.Uint8List>);
|
||||
@override
|
||||
_i31.StackTheme? getTheme({required String? themeId}) =>
|
||||
(super.noSuchMethod(Invocation.method(
|
||||
#getTheme,
|
||||
[],
|
||||
{#themeId: themeId},
|
||||
)) as _i31.StackTheme?);
|
||||
}
|
||||
|
||||
/// A class which mocks [LocaleService].
|
||||
///
|
||||
/// See the documentation for Mockito's code generation for more information.
|
||||
class MockLocaleService extends _i1.Mock implements _i30.LocaleService {
|
||||
class MockLocaleService extends _i1.Mock implements _i32.LocaleService {
|
||||
MockLocaleService() {
|
||||
_i1.throwOnMissingStub(this);
|
||||
}
|
||||
|
@ -2030,15 +2122,15 @@ class MockNodeService extends _i1.Mock implements _i3.NodeService {
|
|||
),
|
||||
) as _i19.SecureStorageInterface);
|
||||
@override
|
||||
List<_i31.NodeModel> get primaryNodes => (super.noSuchMethod(
|
||||
List<_i33.NodeModel> get primaryNodes => (super.noSuchMethod(
|
||||
Invocation.getter(#primaryNodes),
|
||||
returnValue: <_i31.NodeModel>[],
|
||||
) as List<_i31.NodeModel>);
|
||||
returnValue: <_i33.NodeModel>[],
|
||||
) as List<_i33.NodeModel>);
|
||||
@override
|
||||
List<_i31.NodeModel> get nodes => (super.noSuchMethod(
|
||||
List<_i33.NodeModel> get nodes => (super.noSuchMethod(
|
||||
Invocation.getter(#nodes),
|
||||
returnValue: <_i31.NodeModel>[],
|
||||
) as List<_i31.NodeModel>);
|
||||
returnValue: <_i33.NodeModel>[],
|
||||
) as List<_i33.NodeModel>);
|
||||
@override
|
||||
bool get hasListeners => (super.noSuchMethod(
|
||||
Invocation.getter(#hasListeners),
|
||||
|
@ -2056,7 +2148,7 @@ class MockNodeService extends _i1.Mock implements _i3.NodeService {
|
|||
@override
|
||||
_i23.Future<void> setPrimaryNodeFor({
|
||||
required _i22.Coin? coin,
|
||||
required _i31.NodeModel? node,
|
||||
required _i33.NodeModel? node,
|
||||
bool? shouldNotifyListeners = false,
|
||||
}) =>
|
||||
(super.noSuchMethod(
|
||||
|
@ -2073,40 +2165,40 @@ class MockNodeService extends _i1.Mock implements _i3.NodeService {
|
|||
returnValueForMissingStub: _i23.Future<void>.value(),
|
||||
) as _i23.Future<void>);
|
||||
@override
|
||||
_i31.NodeModel? getPrimaryNodeFor({required _i22.Coin? coin}) =>
|
||||
_i33.NodeModel? getPrimaryNodeFor({required _i22.Coin? coin}) =>
|
||||
(super.noSuchMethod(Invocation.method(
|
||||
#getPrimaryNodeFor,
|
||||
[],
|
||||
{#coin: coin},
|
||||
)) as _i31.NodeModel?);
|
||||
)) as _i33.NodeModel?);
|
||||
@override
|
||||
List<_i31.NodeModel> getNodesFor(_i22.Coin? coin) => (super.noSuchMethod(
|
||||
List<_i33.NodeModel> getNodesFor(_i22.Coin? coin) => (super.noSuchMethod(
|
||||
Invocation.method(
|
||||
#getNodesFor,
|
||||
[coin],
|
||||
),
|
||||
returnValue: <_i31.NodeModel>[],
|
||||
) as List<_i31.NodeModel>);
|
||||
returnValue: <_i33.NodeModel>[],
|
||||
) as List<_i33.NodeModel>);
|
||||
@override
|
||||
_i31.NodeModel? getNodeById({required String? id}) =>
|
||||
_i33.NodeModel? getNodeById({required String? id}) =>
|
||||
(super.noSuchMethod(Invocation.method(
|
||||
#getNodeById,
|
||||
[],
|
||||
{#id: id},
|
||||
)) as _i31.NodeModel?);
|
||||
)) as _i33.NodeModel?);
|
||||
@override
|
||||
List<_i31.NodeModel> failoverNodesFor({required _i22.Coin? coin}) =>
|
||||
List<_i33.NodeModel> failoverNodesFor({required _i22.Coin? coin}) =>
|
||||
(super.noSuchMethod(
|
||||
Invocation.method(
|
||||
#failoverNodesFor,
|
||||
[],
|
||||
{#coin: coin},
|
||||
),
|
||||
returnValue: <_i31.NodeModel>[],
|
||||
) as List<_i31.NodeModel>);
|
||||
returnValue: <_i33.NodeModel>[],
|
||||
) as List<_i33.NodeModel>);
|
||||
@override
|
||||
_i23.Future<void> add(
|
||||
_i31.NodeModel? node,
|
||||
_i33.NodeModel? node,
|
||||
String? password,
|
||||
bool? shouldNotifyListeners,
|
||||
) =>
|
||||
|
@ -2158,7 +2250,7 @@ class MockNodeService extends _i1.Mock implements _i3.NodeService {
|
|||
) as _i23.Future<void>);
|
||||
@override
|
||||
_i23.Future<void> edit(
|
||||
_i31.NodeModel? editedNode,
|
||||
_i33.NodeModel? editedNode,
|
||||
String? password,
|
||||
bool? shouldNotifyListeners,
|
||||
) =>
|
||||
|
|
|
@ -4,17 +4,17 @@ import 'package:flutter_svg/svg.dart';
|
|||
import 'package:flutter_test/flutter_test.dart';
|
||||
import 'package:mockito/annotations.dart';
|
||||
import 'package:mockito/mockito.dart';
|
||||
import 'package:stackwallet/models/isar/sw_theme.dart';
|
||||
import 'package:stackwallet/models/isar/stack_theme.dart';
|
||||
import 'package:stackwallet/models/node_model.dart';
|
||||
import 'package:stackwallet/providers/providers.dart';
|
||||
import 'package:stackwallet/services/node_service.dart';
|
||||
import 'package:stackwallet/themes/stack_colors.dart';
|
||||
import 'package:stackwallet/themes/defaults/dark.dart';
|
||||
import 'package:stackwallet/utilities/enums/coin_enum.dart';
|
||||
import 'package:stackwallet/utilities/util.dart';
|
||||
import 'package:stackwallet/widgets/node_card.dart';
|
||||
import 'package:stackwallet/widgets/node_options_sheet.dart';
|
||||
|
||||
import '../sample_data/theme_json.dart';
|
||||
import 'node_card_test.mocks.dart';
|
||||
|
||||
@GenerateMocks([NodeService])
|
||||
|
@ -56,8 +56,8 @@ void main() {
|
|||
extensions: [
|
||||
StackColors.fromStackColorTheme(
|
||||
StackTheme.fromJson(
|
||||
json: darkJson,
|
||||
applicationThemesDirectoryPath: "",
|
||||
json: lightThemeJsonMap,
|
||||
applicationThemesDirectoryPath: "test",
|
||||
),
|
||||
),
|
||||
],
|
||||
|
@ -117,8 +117,8 @@ void main() {
|
|||
extensions: [
|
||||
StackColors.fromStackColorTheme(
|
||||
StackTheme.fromJson(
|
||||
json: darkJson,
|
||||
applicationThemesDirectoryPath: "",
|
||||
json: lightThemeJsonMap,
|
||||
applicationThemesDirectoryPath: "test",
|
||||
),
|
||||
),
|
||||
],
|
||||
|
@ -179,8 +179,8 @@ void main() {
|
|||
extensions: [
|
||||
StackColors.fromStackColorTheme(
|
||||
StackTheme.fromJson(
|
||||
json: darkJson,
|
||||
applicationThemesDirectoryPath: "",
|
||||
json: lightThemeJsonMap,
|
||||
applicationThemesDirectoryPath: "test",
|
||||
),
|
||||
),
|
||||
],
|
||||
|
|
|
@ -5,18 +5,18 @@ import 'package:flutter_test/flutter_test.dart';
|
|||
import 'package:mockingjay/mockingjay.dart' as mockingjay;
|
||||
import 'package:mockito/annotations.dart';
|
||||
import 'package:mockito/mockito.dart';
|
||||
import 'package:stackwallet/models/isar/sw_theme.dart';
|
||||
import 'package:stackwallet/models/isar/stack_theme.dart';
|
||||
import 'package:stackwallet/models/node_model.dart';
|
||||
import 'package:stackwallet/providers/providers.dart';
|
||||
import 'package:stackwallet/services/node_service.dart';
|
||||
import 'package:stackwallet/services/wallets.dart';
|
||||
import 'package:stackwallet/themes/stack_colors.dart';
|
||||
import 'package:stackwallet/themes/defaults/dark.dart';
|
||||
import 'package:stackwallet/utilities/enums/coin_enum.dart';
|
||||
import 'package:stackwallet/utilities/prefs.dart';
|
||||
import 'package:stackwallet/widgets/node_options_sheet.dart';
|
||||
import 'package:tuple/tuple.dart';
|
||||
|
||||
import '../sample_data/theme_json.dart';
|
||||
import 'node_options_sheet_test.mocks.dart';
|
||||
|
||||
@GenerateMocks([Wallets, Prefs, NodeService])
|
||||
|
@ -62,8 +62,8 @@ void main() {
|
|||
extensions: [
|
||||
StackColors.fromStackColorTheme(
|
||||
StackTheme.fromJson(
|
||||
json: darkJson,
|
||||
applicationThemesDirectoryPath: "",
|
||||
json: lightThemeJsonMap,
|
||||
applicationThemesDirectoryPath: "test",
|
||||
),
|
||||
),
|
||||
],
|
||||
|
@ -135,8 +135,8 @@ void main() {
|
|||
extensions: [
|
||||
StackColors.fromStackColorTheme(
|
||||
StackTheme.fromJson(
|
||||
json: darkJson,
|
||||
applicationThemesDirectoryPath: "",
|
||||
json: lightThemeJsonMap,
|
||||
applicationThemesDirectoryPath: "test",
|
||||
),
|
||||
),
|
||||
],
|
||||
|
@ -202,8 +202,8 @@ void main() {
|
|||
extensions: [
|
||||
StackColors.fromStackColorTheme(
|
||||
StackTheme.fromJson(
|
||||
json: darkJson,
|
||||
applicationThemesDirectoryPath: "",
|
||||
json: lightThemeJsonMap,
|
||||
applicationThemesDirectoryPath: "test",
|
||||
),
|
||||
),
|
||||
],
|
||||
|
|
|
@ -1,15 +1,16 @@
|
|||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_test/flutter_test.dart';
|
||||
import 'package:stackwallet/models/isar/sw_theme.dart';
|
||||
import 'package:stackwallet/models/isar/stack_theme.dart';
|
||||
import 'package:stackwallet/themes/stack_colors.dart';
|
||||
import 'package:stackwallet/themes/defaults/dark.dart';
|
||||
import 'package:stackwallet/widgets/progress_bar.dart';
|
||||
|
||||
import '../sample_data/theme_json.dart';
|
||||
|
||||
void main() {
|
||||
testWidgets("Widget build", (widgetTester) async {
|
||||
final theme = StackTheme.fromJson(
|
||||
json: darkJson,
|
||||
applicationThemesDirectoryPath: "",
|
||||
json: lightThemeJsonMap,
|
||||
applicationThemesDirectoryPath: "test",
|
||||
);
|
||||
await widgetTester.pumpWidget(
|
||||
MaterialApp(
|
||||
|
|
|
@ -1,10 +1,11 @@
|
|||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_test/flutter_test.dart';
|
||||
import 'package:stackwallet/models/isar/sw_theme.dart';
|
||||
import 'package:stackwallet/models/isar/stack_theme.dart';
|
||||
import 'package:stackwallet/themes/stack_colors.dart';
|
||||
import 'package:stackwallet/themes/defaults/dark.dart';
|
||||
import 'package:stackwallet/widgets/shake/shake.dart';
|
||||
|
||||
import '../../sample_data/theme_json.dart';
|
||||
|
||||
void main() {
|
||||
testWidgets("Widget build", (widgetTester) async {
|
||||
await widgetTester.pumpWidget(
|
||||
|
@ -13,8 +14,8 @@ void main() {
|
|||
extensions: [
|
||||
StackColors.fromStackColorTheme(
|
||||
StackTheme.fromJson(
|
||||
json: darkJson,
|
||||
applicationThemesDirectoryPath: "",
|
||||
json: lightThemeJsonMap,
|
||||
applicationThemesDirectoryPath: "test",
|
||||
),
|
||||
),
|
||||
],
|
||||
|
|
|
@ -2,11 +2,12 @@ import 'package:flutter/material.dart';
|
|||
import 'package:flutter_riverpod/flutter_riverpod.dart';
|
||||
import 'package:flutter_test/flutter_test.dart';
|
||||
import 'package:mockingjay/mockingjay.dart' as mockingjay;
|
||||
import 'package:stackwallet/models/isar/sw_theme.dart';
|
||||
import 'package:stackwallet/models/isar/stack_theme.dart';
|
||||
import 'package:stackwallet/themes/stack_colors.dart';
|
||||
import 'package:stackwallet/themes/defaults/dark.dart';
|
||||
import 'package:stackwallet/widgets/stack_dialog.dart';
|
||||
|
||||
import '../sample_data/theme_json.dart';
|
||||
|
||||
void main() {
|
||||
testWidgets("test StackDialogBase", (widgetTester) async {
|
||||
await widgetTester.pumpWidget(
|
||||
|
@ -15,8 +16,8 @@ void main() {
|
|||
extensions: [
|
||||
StackColors.fromStackColorTheme(
|
||||
StackTheme.fromJson(
|
||||
json: darkJson,
|
||||
applicationThemesDirectoryPath: "",
|
||||
json: lightThemeJsonMap,
|
||||
applicationThemesDirectoryPath: "test",
|
||||
),
|
||||
),
|
||||
],
|
||||
|
@ -37,8 +38,8 @@ void main() {
|
|||
extensions: [
|
||||
StackColors.fromStackColorTheme(
|
||||
StackTheme.fromJson(
|
||||
json: darkJson,
|
||||
applicationThemesDirectoryPath: "",
|
||||
json: lightThemeJsonMap,
|
||||
applicationThemesDirectoryPath: "test",
|
||||
),
|
||||
),
|
||||
],
|
||||
|
@ -73,8 +74,8 @@ void main() {
|
|||
extensions: [
|
||||
StackColors.fromStackColorTheme(
|
||||
StackTheme.fromJson(
|
||||
json: darkJson,
|
||||
applicationThemesDirectoryPath: "",
|
||||
json: lightThemeJsonMap,
|
||||
applicationThemesDirectoryPath: "test",
|
||||
),
|
||||
),
|
||||
],
|
||||
|
|
|
@ -1,10 +1,11 @@
|
|||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_test/flutter_test.dart';
|
||||
import 'package:stackwallet/models/isar/sw_theme.dart';
|
||||
import 'package:stackwallet/models/isar/stack_theme.dart';
|
||||
import 'package:stackwallet/themes/stack_colors.dart';
|
||||
import 'package:stackwallet/themes/defaults/dark.dart';
|
||||
import 'package:stackwallet/widgets/table_view/table_view_cell.dart';
|
||||
|
||||
import '../../sample_data/theme_json.dart';
|
||||
|
||||
void main() {
|
||||
testWidgets("Widget build correctly", (widgetTester) async {
|
||||
const tableViewCell = TableViewCell(flex: 16, child: Text("data"));
|
||||
|
@ -14,8 +15,8 @@ void main() {
|
|||
extensions: [
|
||||
StackColors.fromStackColorTheme(
|
||||
StackTheme.fromJson(
|
||||
json: darkJson,
|
||||
applicationThemesDirectoryPath: "",
|
||||
json: lightThemeJsonMap,
|
||||
applicationThemesDirectoryPath: "test",
|
||||
),
|
||||
),
|
||||
],
|
||||
|
|
|
@ -4,7 +4,7 @@ import 'package:flutter_test/flutter_test.dart';
|
|||
import 'package:mockito/annotations.dart';
|
||||
import 'package:mockito/mockito.dart';
|
||||
import 'package:stackwallet/models/balance.dart';
|
||||
import 'package:stackwallet/models/isar/sw_theme.dart';
|
||||
import 'package:stackwallet/models/isar/stack_theme.dart';
|
||||
import 'package:stackwallet/pages_desktop_specific/my_stack_view/coin_wallets_table.dart';
|
||||
import 'package:stackwallet/providers/providers.dart';
|
||||
import 'package:stackwallet/services/coins/bitcoin/bitcoin_wallet.dart';
|
||||
|
@ -13,17 +13,19 @@ import 'package:stackwallet/services/coins/manager.dart';
|
|||
import 'package:stackwallet/services/wallets.dart';
|
||||
import 'package:stackwallet/services/wallets_service.dart';
|
||||
import 'package:stackwallet/themes/stack_colors.dart';
|
||||
import 'package:stackwallet/themes/defaults/dark.dart';
|
||||
import 'package:stackwallet/themes/theme_service.dart';
|
||||
import 'package:stackwallet/utilities/amount/amount.dart';
|
||||
import 'package:stackwallet/utilities/enums/coin_enum.dart';
|
||||
import 'package:stackwallet/widgets/table_view/table_view_cell.dart';
|
||||
import 'package:stackwallet/widgets/table_view/table_view_row.dart';
|
||||
|
||||
import '../../sample_data/theme_json.dart';
|
||||
import 'table_view_row_test.mocks.dart';
|
||||
|
||||
@GenerateMocks([
|
||||
Wallets,
|
||||
WalletsService,
|
||||
ThemeService,
|
||||
BitcoinWallet
|
||||
], customMocks: [
|
||||
MockSpec<Manager>(returnNullOnMissingStub: true),
|
||||
|
@ -34,8 +36,15 @@ void main() {
|
|||
widgetTester.binding.window.physicalSizeTestValue = const Size(2500, 1800);
|
||||
|
||||
final mockWallet = MockWallets();
|
||||
final mockThemeService = MockThemeService();
|
||||
final CoinServiceAPI wallet = MockBitcoinWallet();
|
||||
when(wallet.coin).thenAnswer((_) => Coin.bitcoin);
|
||||
when(mockThemeService.getTheme(themeId: "light")).thenAnswer(
|
||||
(_) => StackTheme.fromJson(
|
||||
json: lightThemeJsonMap,
|
||||
applicationThemesDirectoryPath: "test",
|
||||
),
|
||||
);
|
||||
|
||||
when(wallet.walletName).thenAnswer((_) => "some wallet");
|
||||
when(wallet.walletId).thenAnswer((_) => "Wallet id 1");
|
||||
|
@ -63,14 +72,15 @@ void main() {
|
|||
ProviderScope(
|
||||
overrides: [
|
||||
walletsChangeNotifierProvider.overrideWithValue(mockWallet),
|
||||
pThemeService.overrideWithValue(mockThemeService),
|
||||
],
|
||||
child: MaterialApp(
|
||||
theme: ThemeData(
|
||||
extensions: [
|
||||
StackColors.fromStackColorTheme(
|
||||
StackTheme.fromJson(
|
||||
json: darkJson,
|
||||
applicationThemesDirectoryPath: "",
|
||||
json: lightThemeJsonMap,
|
||||
applicationThemesDirectoryPath: "test",
|
||||
),
|
||||
),
|
||||
],
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
|
||||
// ignore_for_file: no_leading_underscores_for_library_prefixes
|
||||
import 'dart:async' as _i22;
|
||||
import 'dart:typed_data' as _i29;
|
||||
import 'dart:typed_data' as _i27;
|
||||
import 'dart:ui' as _i24;
|
||||
|
||||
import 'package:bip32/bip32.dart' as _i16;
|
||||
|
@ -13,26 +13,28 @@ import 'package:bitcoindart/bitcoindart.dart' as _i13;
|
|||
import 'package:flutter/foundation.dart' as _i4;
|
||||
import 'package:flutter_riverpod/flutter_riverpod.dart' as _i5;
|
||||
import 'package:mockito/mockito.dart' as _i1;
|
||||
import 'package:stackwallet/db/isar/main_db.dart' as _i12;
|
||||
import 'package:stackwallet/electrumx_rpc/cached_electrumx.dart' as _i10;
|
||||
import 'package:stackwallet/electrumx_rpc/electrumx.dart' as _i9;
|
||||
import 'package:stackwallet/models/balance.dart' as _i11;
|
||||
import 'package:stackwallet/db/isar/main_db.dart' as _i7;
|
||||
import 'package:stackwallet/electrumx_rpc/cached_electrumx.dart' as _i11;
|
||||
import 'package:stackwallet/electrumx_rpc/electrumx.dart' as _i10;
|
||||
import 'package:stackwallet/models/balance.dart' as _i12;
|
||||
import 'package:stackwallet/models/isar/models/isar_models.dart' as _i17;
|
||||
import 'package:stackwallet/models/paymint/fee_object_model.dart' as _i8;
|
||||
import 'package:stackwallet/models/signing_data.dart' as _i27;
|
||||
import 'package:stackwallet/services/coins/bitcoin/bitcoin_wallet.dart' as _i25;
|
||||
import 'package:stackwallet/models/isar/stack_theme.dart' as _i26;
|
||||
import 'package:stackwallet/models/paymint/fee_object_model.dart' as _i9;
|
||||
import 'package:stackwallet/models/signing_data.dart' as _i30;
|
||||
import 'package:stackwallet/services/coins/bitcoin/bitcoin_wallet.dart' as _i28;
|
||||
import 'package:stackwallet/services/coins/coin_service.dart' as _i19;
|
||||
import 'package:stackwallet/services/coins/manager.dart' as _i6;
|
||||
import 'package:stackwallet/services/node_service.dart' as _i3;
|
||||
import 'package:stackwallet/services/transaction_notification_tracker.dart'
|
||||
as _i7;
|
||||
as _i8;
|
||||
import 'package:stackwallet/services/wallets.dart' as _i20;
|
||||
import 'package:stackwallet/services/wallets_service.dart' as _i2;
|
||||
import 'package:stackwallet/themes/theme_service.dart' as _i25;
|
||||
import 'package:stackwallet/utilities/amount/amount.dart' as _i14;
|
||||
import 'package:stackwallet/utilities/enums/coin_enum.dart' as _i21;
|
||||
import 'package:stackwallet/utilities/enums/derive_path_type_enum.dart' as _i26;
|
||||
import 'package:stackwallet/utilities/enums/derive_path_type_enum.dart' as _i29;
|
||||
import 'package:stackwallet/utilities/flutter_secure_storage_interface.dart'
|
||||
as _i28;
|
||||
as _i31;
|
||||
import 'package:stackwallet/utilities/prefs.dart' as _i23;
|
||||
import 'package:tuple/tuple.dart' as _i15;
|
||||
|
||||
|
@ -89,9 +91,8 @@ class _FakeManager_3 extends _i1.SmartFake implements _i6.Manager {
|
|||
);
|
||||
}
|
||||
|
||||
class _FakeTransactionNotificationTracker_4 extends _i1.SmartFake
|
||||
implements _i7.TransactionNotificationTracker {
|
||||
_FakeTransactionNotificationTracker_4(
|
||||
class _FakeMainDB_4 extends _i1.SmartFake implements _i7.MainDB {
|
||||
_FakeMainDB_4(
|
||||
Object parent,
|
||||
Invocation parentInvocation,
|
||||
) : super(
|
||||
|
@ -100,8 +101,9 @@ class _FakeTransactionNotificationTracker_4 extends _i1.SmartFake
|
|||
);
|
||||
}
|
||||
|
||||
class _FakeFeeObject_5 extends _i1.SmartFake implements _i8.FeeObject {
|
||||
_FakeFeeObject_5(
|
||||
class _FakeTransactionNotificationTracker_5 extends _i1.SmartFake
|
||||
implements _i8.TransactionNotificationTracker {
|
||||
_FakeTransactionNotificationTracker_5(
|
||||
Object parent,
|
||||
Invocation parentInvocation,
|
||||
) : super(
|
||||
|
@ -110,8 +112,8 @@ class _FakeFeeObject_5 extends _i1.SmartFake implements _i8.FeeObject {
|
|||
);
|
||||
}
|
||||
|
||||
class _FakeElectrumX_6 extends _i1.SmartFake implements _i9.ElectrumX {
|
||||
_FakeElectrumX_6(
|
||||
class _FakeFeeObject_6 extends _i1.SmartFake implements _i9.FeeObject {
|
||||
_FakeFeeObject_6(
|
||||
Object parent,
|
||||
Invocation parentInvocation,
|
||||
) : super(
|
||||
|
@ -120,9 +122,8 @@ class _FakeElectrumX_6 extends _i1.SmartFake implements _i9.ElectrumX {
|
|||
);
|
||||
}
|
||||
|
||||
class _FakeCachedElectrumX_7 extends _i1.SmartFake
|
||||
implements _i10.CachedElectrumX {
|
||||
_FakeCachedElectrumX_7(
|
||||
class _FakeElectrumX_7 extends _i1.SmartFake implements _i10.ElectrumX {
|
||||
_FakeElectrumX_7(
|
||||
Object parent,
|
||||
Invocation parentInvocation,
|
||||
) : super(
|
||||
|
@ -131,8 +132,9 @@ class _FakeCachedElectrumX_7 extends _i1.SmartFake
|
|||
);
|
||||
}
|
||||
|
||||
class _FakeBalance_8 extends _i1.SmartFake implements _i11.Balance {
|
||||
_FakeBalance_8(
|
||||
class _FakeCachedElectrumX_8 extends _i1.SmartFake
|
||||
implements _i11.CachedElectrumX {
|
||||
_FakeCachedElectrumX_8(
|
||||
Object parent,
|
||||
Invocation parentInvocation,
|
||||
) : super(
|
||||
|
@ -141,8 +143,8 @@ class _FakeBalance_8 extends _i1.SmartFake implements _i11.Balance {
|
|||
);
|
||||
}
|
||||
|
||||
class _FakeMainDB_9 extends _i1.SmartFake implements _i12.MainDB {
|
||||
_FakeMainDB_9(
|
||||
class _FakeBalance_9 extends _i1.SmartFake implements _i12.Balance {
|
||||
_FakeBalance_9(
|
||||
Object parent,
|
||||
Invocation parentInvocation,
|
||||
) : super(
|
||||
|
@ -161,7 +163,8 @@ class _FakeNetworkType_10 extends _i1.SmartFake implements _i13.NetworkType {
|
|||
);
|
||||
}
|
||||
|
||||
class _FakeElectrumXNode_11 extends _i1.SmartFake implements _i9.ElectrumXNode {
|
||||
class _FakeElectrumXNode_11 extends _i1.SmartFake
|
||||
implements _i10.ElectrumXNode {
|
||||
_FakeElectrumXNode_11(
|
||||
Object parent,
|
||||
Invocation parentInvocation,
|
||||
|
@ -675,10 +678,100 @@ class MockWalletsService extends _i1.Mock implements _i2.WalletsService {
|
|||
);
|
||||
}
|
||||
|
||||
/// A class which mocks [ThemeService].
|
||||
///
|
||||
/// See the documentation for Mockito's code generation for more information.
|
||||
class MockThemeService extends _i1.Mock implements _i25.ThemeService {
|
||||
MockThemeService() {
|
||||
_i1.throwOnMissingStub(this);
|
||||
}
|
||||
|
||||
@override
|
||||
_i7.MainDB get db => (super.noSuchMethod(
|
||||
Invocation.getter(#db),
|
||||
returnValue: _FakeMainDB_4(
|
||||
this,
|
||||
Invocation.getter(#db),
|
||||
),
|
||||
) as _i7.MainDB);
|
||||
@override
|
||||
List<_i26.StackTheme> get installedThemes => (super.noSuchMethod(
|
||||
Invocation.getter(#installedThemes),
|
||||
returnValue: <_i26.StackTheme>[],
|
||||
) as List<_i26.StackTheme>);
|
||||
@override
|
||||
void init(_i7.MainDB? db) => super.noSuchMethod(
|
||||
Invocation.method(
|
||||
#init,
|
||||
[db],
|
||||
),
|
||||
returnValueForMissingStub: null,
|
||||
);
|
||||
@override
|
||||
_i22.Future<void> install({required _i27.Uint8List? themeArchiveData}) =>
|
||||
(super.noSuchMethod(
|
||||
Invocation.method(
|
||||
#install,
|
||||
[],
|
||||
{#themeArchiveData: themeArchiveData},
|
||||
),
|
||||
returnValue: _i22.Future<void>.value(),
|
||||
returnValueForMissingStub: _i22.Future<void>.value(),
|
||||
) as _i22.Future<void>);
|
||||
@override
|
||||
_i22.Future<void> remove({required String? themeId}) => (super.noSuchMethod(
|
||||
Invocation.method(
|
||||
#remove,
|
||||
[],
|
||||
{#themeId: themeId},
|
||||
),
|
||||
returnValue: _i22.Future<void>.value(),
|
||||
returnValueForMissingStub: _i22.Future<void>.value(),
|
||||
) as _i22.Future<void>);
|
||||
@override
|
||||
_i22.Future<bool> verifyInstalled({required String? themeId}) =>
|
||||
(super.noSuchMethod(
|
||||
Invocation.method(
|
||||
#verifyInstalled,
|
||||
[],
|
||||
{#themeId: themeId},
|
||||
),
|
||||
returnValue: _i22.Future<bool>.value(false),
|
||||
) as _i22.Future<bool>);
|
||||
@override
|
||||
_i22.Future<List<_i25.StackThemeMetaData>> fetchThemes() =>
|
||||
(super.noSuchMethod(
|
||||
Invocation.method(
|
||||
#fetchThemes,
|
||||
[],
|
||||
),
|
||||
returnValue: _i22.Future<List<_i25.StackThemeMetaData>>.value(
|
||||
<_i25.StackThemeMetaData>[]),
|
||||
) as _i22.Future<List<_i25.StackThemeMetaData>>);
|
||||
@override
|
||||
_i22.Future<_i27.Uint8List> fetchTheme(
|
||||
{required _i25.StackThemeMetaData? themeMetaData}) =>
|
||||
(super.noSuchMethod(
|
||||
Invocation.method(
|
||||
#fetchTheme,
|
||||
[],
|
||||
{#themeMetaData: themeMetaData},
|
||||
),
|
||||
returnValue: _i22.Future<_i27.Uint8List>.value(_i27.Uint8List(0)),
|
||||
) as _i22.Future<_i27.Uint8List>);
|
||||
@override
|
||||
_i26.StackTheme? getTheme({required String? themeId}) =>
|
||||
(super.noSuchMethod(Invocation.method(
|
||||
#getTheme,
|
||||
[],
|
||||
{#themeId: themeId},
|
||||
)) as _i26.StackTheme?);
|
||||
}
|
||||
|
||||
/// A class which mocks [BitcoinWallet].
|
||||
///
|
||||
/// See the documentation for Mockito's code generation for more information.
|
||||
class MockBitcoinWallet extends _i1.Mock implements _i25.BitcoinWallet {
|
||||
class MockBitcoinWallet extends _i1.Mock implements _i28.BitcoinWallet {
|
||||
MockBitcoinWallet() {
|
||||
_i1.throwOnMissingStub(this);
|
||||
}
|
||||
|
@ -692,15 +785,15 @@ class MockBitcoinWallet extends _i1.Mock implements _i25.BitcoinWallet {
|
|||
returnValueForMissingStub: null,
|
||||
);
|
||||
@override
|
||||
_i7.TransactionNotificationTracker get txTracker => (super.noSuchMethod(
|
||||
_i8.TransactionNotificationTracker get txTracker => (super.noSuchMethod(
|
||||
Invocation.getter(#txTracker),
|
||||
returnValue: _FakeTransactionNotificationTracker_4(
|
||||
returnValue: _FakeTransactionNotificationTracker_5(
|
||||
this,
|
||||
Invocation.getter(#txTracker),
|
||||
),
|
||||
) as _i7.TransactionNotificationTracker);
|
||||
) as _i8.TransactionNotificationTracker);
|
||||
@override
|
||||
set txTracker(_i7.TransactionNotificationTracker? _txTracker) =>
|
||||
set txTracker(_i8.TransactionNotificationTracker? _txTracker) =>
|
||||
super.noSuchMethod(
|
||||
Invocation.setter(
|
||||
#txTracker,
|
||||
|
@ -797,13 +890,13 @@ class MockBitcoinWallet extends _i1.Mock implements _i25.BitcoinWallet {
|
|||
returnValue: false,
|
||||
) as bool);
|
||||
@override
|
||||
_i22.Future<_i8.FeeObject> get fees => (super.noSuchMethod(
|
||||
_i22.Future<_i9.FeeObject> get fees => (super.noSuchMethod(
|
||||
Invocation.getter(#fees),
|
||||
returnValue: _i22.Future<_i8.FeeObject>.value(_FakeFeeObject_5(
|
||||
returnValue: _i22.Future<_i9.FeeObject>.value(_FakeFeeObject_6(
|
||||
this,
|
||||
Invocation.getter(#fees),
|
||||
)),
|
||||
) as _i22.Future<_i8.FeeObject>);
|
||||
) as _i22.Future<_i9.FeeObject>);
|
||||
@override
|
||||
_i22.Future<int> get maxFee => (super.noSuchMethod(
|
||||
Invocation.getter(#maxFee),
|
||||
|
@ -876,29 +969,29 @@ class MockBitcoinWallet extends _i1.Mock implements _i25.BitcoinWallet {
|
|||
returnValueForMissingStub: null,
|
||||
);
|
||||
@override
|
||||
_i9.ElectrumX get electrumXClient => (super.noSuchMethod(
|
||||
_i10.ElectrumX get electrumXClient => (super.noSuchMethod(
|
||||
Invocation.getter(#electrumXClient),
|
||||
returnValue: _FakeElectrumX_6(
|
||||
returnValue: _FakeElectrumX_7(
|
||||
this,
|
||||
Invocation.getter(#electrumXClient),
|
||||
),
|
||||
) as _i9.ElectrumX);
|
||||
) as _i10.ElectrumX);
|
||||
@override
|
||||
_i10.CachedElectrumX get cachedElectrumXClient => (super.noSuchMethod(
|
||||
_i11.CachedElectrumX get cachedElectrumXClient => (super.noSuchMethod(
|
||||
Invocation.getter(#cachedElectrumXClient),
|
||||
returnValue: _FakeCachedElectrumX_7(
|
||||
returnValue: _FakeCachedElectrumX_8(
|
||||
this,
|
||||
Invocation.getter(#cachedElectrumXClient),
|
||||
),
|
||||
) as _i10.CachedElectrumX);
|
||||
) as _i11.CachedElectrumX);
|
||||
@override
|
||||
_i11.Balance get balance => (super.noSuchMethod(
|
||||
_i12.Balance get balance => (super.noSuchMethod(
|
||||
Invocation.getter(#balance),
|
||||
returnValue: _FakeBalance_8(
|
||||
returnValue: _FakeBalance_9(
|
||||
this,
|
||||
Invocation.getter(#balance),
|
||||
),
|
||||
) as _i11.Balance);
|
||||
) as _i12.Balance);
|
||||
@override
|
||||
_i22.Future<String> get xpub => (super.noSuchMethod(
|
||||
Invocation.getter(#xpub),
|
||||
|
@ -914,13 +1007,13 @@ class MockBitcoinWallet extends _i1.Mock implements _i25.BitcoinWallet {
|
|||
returnValueForMissingStub: null,
|
||||
);
|
||||
@override
|
||||
_i12.MainDB get db => (super.noSuchMethod(
|
||||
_i7.MainDB get db => (super.noSuchMethod(
|
||||
Invocation.getter(#db),
|
||||
returnValue: _FakeMainDB_9(
|
||||
returnValue: _FakeMainDB_4(
|
||||
this,
|
||||
Invocation.getter(#db),
|
||||
),
|
||||
) as _i12.MainDB);
|
||||
) as _i7.MainDB);
|
||||
@override
|
||||
_i13.NetworkType get networkType => (super.noSuchMethod(
|
||||
Invocation.getter(#networkType),
|
||||
|
@ -939,15 +1032,15 @@ class MockBitcoinWallet extends _i1.Mock implements _i25.BitcoinWallet {
|
|||
returnValueForMissingStub: _i22.Future<void>.value(),
|
||||
) as _i22.Future<void>);
|
||||
@override
|
||||
_i26.DerivePathType addressType({required String? address}) =>
|
||||
_i29.DerivePathType addressType({required String? address}) =>
|
||||
(super.noSuchMethod(
|
||||
Invocation.method(
|
||||
#addressType,
|
||||
[],
|
||||
{#address: address},
|
||||
),
|
||||
returnValue: _i26.DerivePathType.bip44,
|
||||
) as _i26.DerivePathType);
|
||||
returnValue: _i29.DerivePathType.bip44,
|
||||
) as _i29.DerivePathType);
|
||||
@override
|
||||
_i22.Future<void> recoverFromMnemonic({
|
||||
required String? mnemonic,
|
||||
|
@ -1106,19 +1199,20 @@ class MockBitcoinWallet extends _i1.Mock implements _i25.BitcoinWallet {
|
|||
returnValueForMissingStub: _i22.Future<void>.value(),
|
||||
) as _i22.Future<void>);
|
||||
@override
|
||||
_i22.Future<_i9.ElectrumXNode> getCurrentNode() => (super.noSuchMethod(
|
||||
_i22.Future<_i10.ElectrumXNode> getCurrentNode() => (super.noSuchMethod(
|
||||
Invocation.method(
|
||||
#getCurrentNode,
|
||||
[],
|
||||
),
|
||||
returnValue: _i22.Future<_i9.ElectrumXNode>.value(_FakeElectrumXNode_11(
|
||||
returnValue:
|
||||
_i22.Future<_i10.ElectrumXNode>.value(_FakeElectrumXNode_11(
|
||||
this,
|
||||
Invocation.method(
|
||||
#getCurrentNode,
|
||||
[],
|
||||
),
|
||||
)),
|
||||
) as _i22.Future<_i9.ElectrumXNode>);
|
||||
) as _i22.Future<_i10.ElectrumXNode>);
|
||||
@override
|
||||
_i22.Future<List<Map<String, dynamic>>> fastFetch(
|
||||
List<String>? allTxHashes) =>
|
||||
|
@ -1200,7 +1294,7 @@ class MockBitcoinWallet extends _i1.Mock implements _i25.BitcoinWallet {
|
|||
},
|
||||
));
|
||||
@override
|
||||
_i22.Future<List<_i27.SigningData>> fetchBuildTxData(
|
||||
_i22.Future<List<_i30.SigningData>> fetchBuildTxData(
|
||||
List<_i17.UTXO>? utxosToUse) =>
|
||||
(super.noSuchMethod(
|
||||
Invocation.method(
|
||||
|
@ -1208,11 +1302,11 @@ class MockBitcoinWallet extends _i1.Mock implements _i25.BitcoinWallet {
|
|||
[utxosToUse],
|
||||
),
|
||||
returnValue:
|
||||
_i22.Future<List<_i27.SigningData>>.value(<_i27.SigningData>[]),
|
||||
) as _i22.Future<List<_i27.SigningData>>);
|
||||
_i22.Future<List<_i30.SigningData>>.value(<_i30.SigningData>[]),
|
||||
) as _i22.Future<List<_i30.SigningData>>);
|
||||
@override
|
||||
_i22.Future<Map<String, dynamic>> buildTransaction({
|
||||
required List<_i27.SigningData>? utxoSigningData,
|
||||
required List<_i30.SigningData>? utxoSigningData,
|
||||
required List<String>? recipients,
|
||||
required List<int>? satoshiAmounts,
|
||||
}) =>
|
||||
|
@ -1379,21 +1473,21 @@ class MockBitcoinWallet extends _i1.Mock implements _i25.BitcoinWallet {
|
|||
returnValueForMissingStub: _i22.Future<void>.value(),
|
||||
) as _i22.Future<void>);
|
||||
@override
|
||||
_i11.Balance getCachedBalance() => (super.noSuchMethod(
|
||||
_i12.Balance getCachedBalance() => (super.noSuchMethod(
|
||||
Invocation.method(
|
||||
#getCachedBalance,
|
||||
[],
|
||||
),
|
||||
returnValue: _FakeBalance_8(
|
||||
returnValue: _FakeBalance_9(
|
||||
this,
|
||||
Invocation.method(
|
||||
#getCachedBalance,
|
||||
[],
|
||||
),
|
||||
),
|
||||
) as _i11.Balance);
|
||||
) as _i12.Balance);
|
||||
@override
|
||||
_i22.Future<void> updateCachedBalance(_i11.Balance? balance) =>
|
||||
_i22.Future<void> updateCachedBalance(_i12.Balance? balance) =>
|
||||
(super.noSuchMethod(
|
||||
Invocation.method(
|
||||
#updateCachedBalance,
|
||||
|
@ -1403,21 +1497,21 @@ class MockBitcoinWallet extends _i1.Mock implements _i25.BitcoinWallet {
|
|||
returnValueForMissingStub: _i22.Future<void>.value(),
|
||||
) as _i22.Future<void>);
|
||||
@override
|
||||
_i11.Balance getCachedBalanceSecondary() => (super.noSuchMethod(
|
||||
_i12.Balance getCachedBalanceSecondary() => (super.noSuchMethod(
|
||||
Invocation.method(
|
||||
#getCachedBalanceSecondary,
|
||||
[],
|
||||
),
|
||||
returnValue: _FakeBalance_8(
|
||||
returnValue: _FakeBalance_9(
|
||||
this,
|
||||
Invocation.method(
|
||||
#getCachedBalanceSecondary,
|
||||
[],
|
||||
),
|
||||
),
|
||||
) as _i11.Balance);
|
||||
) as _i12.Balance);
|
||||
@override
|
||||
_i22.Future<void> updateCachedBalanceSecondary(_i11.Balance? balance) =>
|
||||
_i22.Future<void> updateCachedBalanceSecondary(_i12.Balance? balance) =>
|
||||
(super.noSuchMethod(
|
||||
Invocation.method(
|
||||
#updateCachedBalanceSecondary,
|
||||
|
@ -1446,7 +1540,7 @@ class MockBitcoinWallet extends _i1.Mock implements _i25.BitcoinWallet {
|
|||
returnValueForMissingStub: _i22.Future<void>.value(),
|
||||
) as _i22.Future<void>);
|
||||
@override
|
||||
void initWalletDB({_i12.MainDB? mockableOverride}) => super.noSuchMethod(
|
||||
void initWalletDB({_i7.MainDB? mockableOverride}) => super.noSuchMethod(
|
||||
Invocation.method(
|
||||
#initWalletDB,
|
||||
[],
|
||||
|
@ -1498,9 +1592,9 @@ class MockBitcoinWallet extends _i1.Mock implements _i25.BitcoinWallet {
|
|||
required String? walletName,
|
||||
required _i13.NetworkType? network,
|
||||
required _i21.Coin? coin,
|
||||
required _i12.MainDB? db,
|
||||
required _i9.ElectrumX? electrumXClient,
|
||||
required _i28.SecureStorageInterface? secureStorage,
|
||||
required _i7.MainDB? db,
|
||||
required _i10.ElectrumX? electrumXClient,
|
||||
required _i31.SecureStorageInterface? secureStorage,
|
||||
required int? dustLimit,
|
||||
required int? dustLimitP2PKH,
|
||||
required int? minConfirms,
|
||||
|
@ -1520,7 +1614,7 @@ class MockBitcoinWallet extends _i1.Mock implements _i25.BitcoinWallet {
|
|||
})?
|
||||
prepareSend,
|
||||
required _i22.Future<int> Function({required String address})? getTxCount,
|
||||
required _i22.Future<List<_i27.SigningData>> Function(List<_i17.UTXO>)?
|
||||
required _i22.Future<List<_i30.SigningData>> Function(List<_i17.UTXO>)?
|
||||
fetchBuildTxData,
|
||||
required _i22.Future<void> Function()? refresh,
|
||||
required _i22.Future<void> Function()? checkChangeAddressForTransactions,
|
||||
|
@ -1570,7 +1664,7 @@ class MockBitcoinWallet extends _i1.Mock implements _i25.BitcoinWallet {
|
|||
)),
|
||||
) as _i22.Future<_i16.BIP32>);
|
||||
@override
|
||||
_i22.Future<_i29.Uint8List> getPrivateKeyForPaynymReceivingAddress({
|
||||
_i22.Future<_i27.Uint8List> getPrivateKeyForPaynymReceivingAddress({
|
||||
required String? paymentCodeString,
|
||||
required int? index,
|
||||
}) =>
|
||||
|
@ -1583,8 +1677,8 @@ class MockBitcoinWallet extends _i1.Mock implements _i25.BitcoinWallet {
|
|||
#index: index,
|
||||
},
|
||||
),
|
||||
returnValue: _i22.Future<_i29.Uint8List>.value(_i29.Uint8List(0)),
|
||||
) as _i22.Future<_i29.Uint8List>);
|
||||
returnValue: _i22.Future<_i27.Uint8List>.value(_i27.Uint8List(0)),
|
||||
) as _i22.Future<_i27.Uint8List>);
|
||||
@override
|
||||
_i22.Future<_i17.Address> currentReceivingPaynymAddress({
|
||||
required _i18.PaymentCode? sender,
|
||||
|
@ -1670,14 +1764,14 @@ class MockBitcoinWallet extends _i1.Mock implements _i25.BitcoinWallet {
|
|||
)),
|
||||
) as _i22.Future<_i18.PaymentCode>);
|
||||
@override
|
||||
_i22.Future<_i29.Uint8List> signWithNotificationKey(_i29.Uint8List? data) =>
|
||||
_i22.Future<_i27.Uint8List> signWithNotificationKey(_i27.Uint8List? data) =>
|
||||
(super.noSuchMethod(
|
||||
Invocation.method(
|
||||
#signWithNotificationKey,
|
||||
[data],
|
||||
),
|
||||
returnValue: _i22.Future<_i29.Uint8List>.value(_i29.Uint8List(0)),
|
||||
) as _i22.Future<_i29.Uint8List>);
|
||||
returnValue: _i22.Future<_i27.Uint8List>.value(_i27.Uint8List(0)),
|
||||
) as _i22.Future<_i27.Uint8List>);
|
||||
@override
|
||||
_i22.Future<String> signStringWithNotificationKey(String? data) =>
|
||||
(super.noSuchMethod(
|
||||
|
@ -1910,9 +2004,9 @@ class MockBitcoinWallet extends _i1.Mock implements _i25.BitcoinWallet {
|
|||
required String? walletId,
|
||||
required String? walletName,
|
||||
required _i21.Coin? coin,
|
||||
required _i12.MainDB? db,
|
||||
required _i7.MainDB? db,
|
||||
required _i22.Future<int> Function()? getChainHeight,
|
||||
required _i22.Future<void> Function(_i11.Balance)? refreshedBalanceCallback,
|
||||
required _i22.Future<void> Function(_i12.Balance)? refreshedBalanceCallback,
|
||||
}) =>
|
||||
super.noSuchMethod(
|
||||
Invocation.method(
|
||||
|
@ -2009,13 +2103,13 @@ class MockManager extends _i1.Mock implements _i6.Manager {
|
|||
returnValueForMissingStub: null,
|
||||
);
|
||||
@override
|
||||
_i22.Future<_i8.FeeObject> get fees => (super.noSuchMethod(
|
||||
_i22.Future<_i9.FeeObject> get fees => (super.noSuchMethod(
|
||||
Invocation.getter(#fees),
|
||||
returnValue: _i22.Future<_i8.FeeObject>.value(_FakeFeeObject_5(
|
||||
returnValue: _i22.Future<_i9.FeeObject>.value(_FakeFeeObject_6(
|
||||
this,
|
||||
Invocation.getter(#fees),
|
||||
)),
|
||||
) as _i22.Future<_i8.FeeObject>);
|
||||
) as _i22.Future<_i9.FeeObject>);
|
||||
@override
|
||||
_i22.Future<int> get maxFee => (super.noSuchMethod(
|
||||
Invocation.getter(#maxFee),
|
||||
|
@ -2027,13 +2121,13 @@ class MockManager extends _i1.Mock implements _i6.Manager {
|
|||
returnValue: _i22.Future<String>.value(''),
|
||||
) as _i22.Future<String>);
|
||||
@override
|
||||
_i11.Balance get balance => (super.noSuchMethod(
|
||||
_i12.Balance get balance => (super.noSuchMethod(
|
||||
Invocation.getter(#balance),
|
||||
returnValue: _FakeBalance_8(
|
||||
returnValue: _FakeBalance_9(
|
||||
this,
|
||||
Invocation.getter(#balance),
|
||||
),
|
||||
) as _i11.Balance);
|
||||
) as _i12.Balance);
|
||||
@override
|
||||
_i22.Future<List<_i17.Transaction>> get transactions => (super.noSuchMethod(
|
||||
Invocation.getter(#transactions),
|
||||
|
@ -2377,13 +2471,13 @@ class MockCoinServiceAPI extends _i1.Mock implements _i19.CoinServiceAPI {
|
|||
returnValueForMissingStub: null,
|
||||
);
|
||||
@override
|
||||
_i22.Future<_i8.FeeObject> get fees => (super.noSuchMethod(
|
||||
_i22.Future<_i9.FeeObject> get fees => (super.noSuchMethod(
|
||||
Invocation.getter(#fees),
|
||||
returnValue: _i22.Future<_i8.FeeObject>.value(_FakeFeeObject_5(
|
||||
returnValue: _i22.Future<_i9.FeeObject>.value(_FakeFeeObject_6(
|
||||
this,
|
||||
Invocation.getter(#fees),
|
||||
)),
|
||||
) as _i22.Future<_i8.FeeObject>);
|
||||
) as _i22.Future<_i9.FeeObject>);
|
||||
@override
|
||||
_i22.Future<int> get maxFee => (super.noSuchMethod(
|
||||
Invocation.getter(#maxFee),
|
||||
|
@ -2395,13 +2489,13 @@ class MockCoinServiceAPI extends _i1.Mock implements _i19.CoinServiceAPI {
|
|||
returnValue: _i22.Future<String>.value(''),
|
||||
) as _i22.Future<String>);
|
||||
@override
|
||||
_i11.Balance get balance => (super.noSuchMethod(
|
||||
_i12.Balance get balance => (super.noSuchMethod(
|
||||
Invocation.getter(#balance),
|
||||
returnValue: _FakeBalance_8(
|
||||
returnValue: _FakeBalance_9(
|
||||
this,
|
||||
Invocation.getter(#balance),
|
||||
),
|
||||
) as _i11.Balance);
|
||||
) as _i12.Balance);
|
||||
@override
|
||||
_i22.Future<List<_i17.Transaction>> get transactions => (super.noSuchMethod(
|
||||
Invocation.getter(#transactions),
|
||||
|
|
|
@ -1,12 +1,13 @@
|
|||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_test/flutter_test.dart';
|
||||
import 'package:stackwallet/models/isar/sw_theme.dart';
|
||||
import 'package:stackwallet/models/isar/stack_theme.dart';
|
||||
import 'package:stackwallet/themes/stack_colors.dart';
|
||||
import 'package:stackwallet/themes/defaults/dark.dart';
|
||||
import 'package:stackwallet/widgets/table_view/table_view.dart';
|
||||
import 'package:stackwallet/widgets/table_view/table_view_cell.dart';
|
||||
import 'package:stackwallet/widgets/table_view/table_view_row.dart';
|
||||
|
||||
import '../../sample_data/theme_json.dart';
|
||||
|
||||
void main() {
|
||||
testWidgets("Test create table row widget ", (widgetTester) async {
|
||||
await widgetTester.pumpWidget(
|
||||
|
@ -15,8 +16,8 @@ void main() {
|
|||
extensions: [
|
||||
StackColors.fromStackColorTheme(
|
||||
StackTheme.fromJson(
|
||||
json: darkJson,
|
||||
applicationThemesDirectoryPath: "",
|
||||
json: lightThemeJsonMap,
|
||||
applicationThemesDirectoryPath: "test",
|
||||
),
|
||||
),
|
||||
],
|
||||
|
|
|
@ -1,11 +1,12 @@
|
|||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_test/flutter_test.dart';
|
||||
import 'package:stackwallet/models/isar/sw_theme.dart';
|
||||
import 'package:stackwallet/models/isar/stack_theme.dart';
|
||||
import 'package:stackwallet/themes/stack_colors.dart';
|
||||
import 'package:stackwallet/themes/defaults/dark.dart';
|
||||
import 'package:stackwallet/widgets/icon_widgets/x_icon.dart';
|
||||
import 'package:stackwallet/widgets/textfield_icon_button.dart';
|
||||
|
||||
import '../sample_data/theme_json.dart';
|
||||
|
||||
void main() {
|
||||
testWidgets("test", (widgetTester) async {
|
||||
await widgetTester.pumpWidget(
|
||||
|
@ -14,8 +15,8 @@ void main() {
|
|||
extensions: [
|
||||
StackColors.fromStackColorTheme(
|
||||
StackTheme.fromJson(
|
||||
json: darkJson,
|
||||
applicationThemesDirectoryPath: "",
|
||||
json: lightThemeJsonMap,
|
||||
applicationThemesDirectoryPath: "test",
|
||||
),
|
||||
),
|
||||
],
|
||||
|
|
|
@ -1,14 +1,29 @@
|
|||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_riverpod/flutter_riverpod.dart';
|
||||
import 'package:flutter_test/flutter_test.dart';
|
||||
import 'package:mockito/annotations.dart';
|
||||
import 'package:mockito/mockito.dart';
|
||||
import 'package:stackwallet/models/exchange/response_objects/trade.dart';
|
||||
import 'package:stackwallet/models/isar/sw_theme.dart';
|
||||
import 'package:stackwallet/models/isar/stack_theme.dart';
|
||||
import 'package:stackwallet/themes/stack_colors.dart';
|
||||
import 'package:stackwallet/themes/defaults/dark.dart';
|
||||
import 'package:stackwallet/themes/theme_service.dart';
|
||||
import 'package:stackwallet/widgets/trade_card.dart';
|
||||
|
||||
import '../sample_data/theme_json.dart';
|
||||
import 'trade_card_test.mocks.dart';
|
||||
|
||||
@GenerateMocks([
|
||||
ThemeService,
|
||||
])
|
||||
void main() {
|
||||
testWidgets("Test Trade card builds", (widgetTester) async {
|
||||
final mockThemeService = MockThemeService();
|
||||
when(mockThemeService.getTheme(themeId: "light")).thenAnswer(
|
||||
(_) => StackTheme.fromJson(
|
||||
json: lightThemeJsonMap,
|
||||
applicationThemesDirectoryPath: "test",
|
||||
),
|
||||
);
|
||||
final trade = Trade(
|
||||
uuid: "uuid",
|
||||
tradeId: "trade id",
|
||||
|
@ -35,14 +50,16 @@ void main() {
|
|||
|
||||
await widgetTester.pumpWidget(
|
||||
ProviderScope(
|
||||
overrides: [],
|
||||
overrides: [
|
||||
pThemeService.overrideWithValue(mockThemeService),
|
||||
],
|
||||
child: MaterialApp(
|
||||
theme: ThemeData(
|
||||
extensions: [
|
||||
StackColors.fromStackColorTheme(
|
||||
StackTheme.fromJson(
|
||||
json: darkJson,
|
||||
applicationThemesDirectoryPath: "",
|
||||
json: lightThemeJsonMap,
|
||||
applicationThemesDirectoryPath: "test/sample_data",
|
||||
),
|
||||
),
|
||||
],
|
||||
|
|
122
test/widget_tests/trade_card_test.mocks.dart
Normal file
122
test/widget_tests/trade_card_test.mocks.dart
Normal file
|
@ -0,0 +1,122 @@
|
|||
// Mocks generated by Mockito 5.3.2 from annotations
|
||||
// in stackwallet/test/widget_tests/trade_card_test.dart.
|
||||
// Do not manually edit this file.
|
||||
|
||||
// ignore_for_file: no_leading_underscores_for_library_prefixes
|
||||
import 'dart:async' as _i5;
|
||||
import 'dart:typed_data' as _i6;
|
||||
|
||||
import 'package:mockito/mockito.dart' as _i1;
|
||||
import 'package:stackwallet/db/isar/main_db.dart' as _i2;
|
||||
import 'package:stackwallet/models/isar/stack_theme.dart' as _i4;
|
||||
import 'package:stackwallet/themes/theme_service.dart' as _i3;
|
||||
|
||||
// ignore_for_file: type=lint
|
||||
// ignore_for_file: avoid_redundant_argument_values
|
||||
// ignore_for_file: avoid_setters_without_getters
|
||||
// ignore_for_file: comment_references
|
||||
// ignore_for_file: implementation_imports
|
||||
// ignore_for_file: invalid_use_of_visible_for_testing_member
|
||||
// ignore_for_file: prefer_const_constructors
|
||||
// ignore_for_file: unnecessary_parenthesis
|
||||
// ignore_for_file: camel_case_types
|
||||
// ignore_for_file: subtype_of_sealed_class
|
||||
|
||||
class _FakeMainDB_0 extends _i1.SmartFake implements _i2.MainDB {
|
||||
_FakeMainDB_0(
|
||||
Object parent,
|
||||
Invocation parentInvocation,
|
||||
) : super(
|
||||
parent,
|
||||
parentInvocation,
|
||||
);
|
||||
}
|
||||
|
||||
/// A class which mocks [ThemeService].
|
||||
///
|
||||
/// See the documentation for Mockito's code generation for more information.
|
||||
class MockThemeService extends _i1.Mock implements _i3.ThemeService {
|
||||
MockThemeService() {
|
||||
_i1.throwOnMissingStub(this);
|
||||
}
|
||||
|
||||
@override
|
||||
_i2.MainDB get db => (super.noSuchMethod(
|
||||
Invocation.getter(#db),
|
||||
returnValue: _FakeMainDB_0(
|
||||
this,
|
||||
Invocation.getter(#db),
|
||||
),
|
||||
) as _i2.MainDB);
|
||||
@override
|
||||
List<_i4.StackTheme> get installedThemes => (super.noSuchMethod(
|
||||
Invocation.getter(#installedThemes),
|
||||
returnValue: <_i4.StackTheme>[],
|
||||
) as List<_i4.StackTheme>);
|
||||
@override
|
||||
void init(_i2.MainDB? db) => super.noSuchMethod(
|
||||
Invocation.method(
|
||||
#init,
|
||||
[db],
|
||||
),
|
||||
returnValueForMissingStub: null,
|
||||
);
|
||||
@override
|
||||
_i5.Future<void> install({required _i6.Uint8List? themeArchiveData}) =>
|
||||
(super.noSuchMethod(
|
||||
Invocation.method(
|
||||
#install,
|
||||
[],
|
||||
{#themeArchiveData: themeArchiveData},
|
||||
),
|
||||
returnValue: _i5.Future<void>.value(),
|
||||
returnValueForMissingStub: _i5.Future<void>.value(),
|
||||
) as _i5.Future<void>);
|
||||
@override
|
||||
_i5.Future<void> remove({required String? themeId}) => (super.noSuchMethod(
|
||||
Invocation.method(
|
||||
#remove,
|
||||
[],
|
||||
{#themeId: themeId},
|
||||
),
|
||||
returnValue: _i5.Future<void>.value(),
|
||||
returnValueForMissingStub: _i5.Future<void>.value(),
|
||||
) as _i5.Future<void>);
|
||||
@override
|
||||
_i5.Future<bool> verifyInstalled({required String? themeId}) =>
|
||||
(super.noSuchMethod(
|
||||
Invocation.method(
|
||||
#verifyInstalled,
|
||||
[],
|
||||
{#themeId: themeId},
|
||||
),
|
||||
returnValue: _i5.Future<bool>.value(false),
|
||||
) as _i5.Future<bool>);
|
||||
@override
|
||||
_i5.Future<List<_i3.StackThemeMetaData>> fetchThemes() => (super.noSuchMethod(
|
||||
Invocation.method(
|
||||
#fetchThemes,
|
||||
[],
|
||||
),
|
||||
returnValue: _i5.Future<List<_i3.StackThemeMetaData>>.value(
|
||||
<_i3.StackThemeMetaData>[]),
|
||||
) as _i5.Future<List<_i3.StackThemeMetaData>>);
|
||||
@override
|
||||
_i5.Future<_i6.Uint8List> fetchTheme(
|
||||
{required _i3.StackThemeMetaData? themeMetaData}) =>
|
||||
(super.noSuchMethod(
|
||||
Invocation.method(
|
||||
#fetchTheme,
|
||||
[],
|
||||
{#themeMetaData: themeMetaData},
|
||||
),
|
||||
returnValue: _i5.Future<_i6.Uint8List>.value(_i6.Uint8List(0)),
|
||||
) as _i5.Future<_i6.Uint8List>);
|
||||
@override
|
||||
_i4.StackTheme? getTheme({required String? themeId}) =>
|
||||
(super.noSuchMethod(Invocation.method(
|
||||
#getTheme,
|
||||
[],
|
||||
{#themeId: themeId},
|
||||
)) as _i4.StackTheme?);
|
||||
}
|
|
@ -8,7 +8,7 @@ import 'package:mockito/annotations.dart';
|
|||
import 'package:mockito/mockito.dart';
|
||||
import 'package:stackwallet/models/isar/models/blockchain_data/address.dart';
|
||||
import 'package:stackwallet/models/isar/models/blockchain_data/transaction.dart';
|
||||
import 'package:stackwallet/models/isar/sw_theme.dart';
|
||||
import 'package:stackwallet/models/isar/stack_theme.dart';
|
||||
import 'package:stackwallet/pages/wallet_view/transaction_views/transaction_details_view.dart';
|
||||
import 'package:stackwallet/providers/providers.dart';
|
||||
import 'package:stackwallet/services/coins/coin_service.dart';
|
||||
|
@ -19,7 +19,7 @@ import 'package:stackwallet/services/notes_service.dart';
|
|||
import 'package:stackwallet/services/price_service.dart';
|
||||
import 'package:stackwallet/services/wallets.dart';
|
||||
import 'package:stackwallet/themes/stack_colors.dart';
|
||||
import 'package:stackwallet/themes/defaults/dark.dart';
|
||||
import 'package:stackwallet/themes/theme_service.dart';
|
||||
import 'package:stackwallet/utilities/amount/amount.dart';
|
||||
import 'package:stackwallet/utilities/enums/coin_enum.dart';
|
||||
import 'package:stackwallet/utilities/prefs.dart';
|
||||
|
@ -27,6 +27,7 @@ import 'package:stackwallet/utilities/util.dart';
|
|||
import 'package:stackwallet/widgets/transaction_card.dart';
|
||||
import 'package:tuple/tuple.dart';
|
||||
|
||||
import '../sample_data/theme_json.dart';
|
||||
import 'transaction_card_test.mocks.dart';
|
||||
|
||||
@GenerateMocks([
|
||||
|
@ -37,7 +38,8 @@ import 'transaction_card_test.mocks.dart';
|
|||
LocaleService,
|
||||
Prefs,
|
||||
PriceService,
|
||||
NotesService
|
||||
NotesService,
|
||||
ThemeService,
|
||||
], customMocks: [])
|
||||
void main() {
|
||||
TestWidgetsFlutterBinding.ensureInitialized();
|
||||
|
@ -47,6 +49,7 @@ void main() {
|
|||
final wallets = MockWallets();
|
||||
final mockPrefs = MockPrefs();
|
||||
final mockPriceService = MockPriceService();
|
||||
final mockThemeService = MockThemeService();
|
||||
|
||||
final tx = Transaction(
|
||||
txid: "some txid",
|
||||
|
@ -79,6 +82,12 @@ void main() {
|
|||
|
||||
final CoinServiceAPI wallet = MockFiroWallet();
|
||||
|
||||
when(mockThemeService.getTheme(themeId: "light")).thenAnswer(
|
||||
(_) => StackTheme.fromJson(
|
||||
json: lightThemeJsonMap,
|
||||
applicationThemesDirectoryPath: "test",
|
||||
),
|
||||
);
|
||||
when(wallet.coin.ticker).thenAnswer((_) => "FIRO");
|
||||
when(mockLocaleService.locale).thenAnswer((_) => "en_US");
|
||||
when(mockPrefs.currency).thenAnswer((_) => "USD");
|
||||
|
@ -99,6 +108,7 @@ void main() {
|
|||
walletsChangeNotifierProvider.overrideWithValue(wallets),
|
||||
localeServiceChangeNotifierProvider
|
||||
.overrideWithValue(mockLocaleService),
|
||||
pThemeService.overrideWithValue(mockThemeService),
|
||||
prefsChangeNotifierProvider.overrideWithValue(mockPrefs),
|
||||
priceAnd24hChangeNotifierProvider.overrideWithValue(mockPriceService)
|
||||
],
|
||||
|
@ -107,8 +117,8 @@ void main() {
|
|||
extensions: [
|
||||
StackColors.fromStackColorTheme(
|
||||
StackTheme.fromJson(
|
||||
json: darkJson,
|
||||
applicationThemesDirectoryPath: "",
|
||||
json: lightThemeJsonMap,
|
||||
applicationThemesDirectoryPath: "test",
|
||||
),
|
||||
),
|
||||
],
|
||||
|
@ -156,6 +166,7 @@ void main() {
|
|||
final wallets = MockWallets();
|
||||
final mockPrefs = MockPrefs();
|
||||
final mockPriceService = MockPriceService();
|
||||
final mockThemeService = MockThemeService();
|
||||
|
||||
final tx = Transaction(
|
||||
txid: "some txid",
|
||||
|
@ -188,6 +199,12 @@ void main() {
|
|||
|
||||
final CoinServiceAPI wallet = MockFiroWallet();
|
||||
|
||||
when(mockThemeService.getTheme(themeId: "light")).thenAnswer(
|
||||
(_) => StackTheme.fromJson(
|
||||
json: lightThemeJsonMap,
|
||||
applicationThemesDirectoryPath: "test",
|
||||
),
|
||||
);
|
||||
when(wallet.coin.ticker).thenAnswer((_) => "FIRO");
|
||||
when(mockLocaleService.locale).thenAnswer((_) => "en_US");
|
||||
when(mockPrefs.currency).thenAnswer((_) => "USD");
|
||||
|
@ -208,6 +225,7 @@ void main() {
|
|||
localeServiceChangeNotifierProvider
|
||||
.overrideWithValue(mockLocaleService),
|
||||
prefsChangeNotifierProvider.overrideWithValue(mockPrefs),
|
||||
pThemeService.overrideWithValue(mockThemeService),
|
||||
priceAnd24hChangeNotifierProvider.overrideWithValue(mockPriceService)
|
||||
],
|
||||
child: MaterialApp(
|
||||
|
@ -215,8 +233,8 @@ void main() {
|
|||
extensions: [
|
||||
StackColors.fromStackColorTheme(
|
||||
StackTheme.fromJson(
|
||||
json: darkJson,
|
||||
applicationThemesDirectoryPath: "",
|
||||
json: lightThemeJsonMap,
|
||||
applicationThemesDirectoryPath: "test",
|
||||
),
|
||||
),
|
||||
],
|
||||
|
@ -262,6 +280,7 @@ void main() {
|
|||
final wallets = MockWallets();
|
||||
final mockPrefs = MockPrefs();
|
||||
final mockPriceService = MockPriceService();
|
||||
final mockThemeService = MockThemeService();
|
||||
|
||||
final tx = Transaction(
|
||||
txid: "some txid",
|
||||
|
@ -294,6 +313,12 @@ void main() {
|
|||
|
||||
final CoinServiceAPI wallet = MockFiroWallet();
|
||||
|
||||
when(mockThemeService.getTheme(themeId: "light")).thenAnswer(
|
||||
(_) => StackTheme.fromJson(
|
||||
json: lightThemeJsonMap,
|
||||
applicationThemesDirectoryPath: "test",
|
||||
),
|
||||
);
|
||||
when(wallet.coin.ticker).thenAnswer((_) => "FIRO");
|
||||
when(mockLocaleService.locale).thenAnswer((_) => "en_US");
|
||||
when(mockPrefs.currency).thenAnswer((_) => "USD");
|
||||
|
@ -315,6 +340,7 @@ void main() {
|
|||
localeServiceChangeNotifierProvider
|
||||
.overrideWithValue(mockLocaleService),
|
||||
prefsChangeNotifierProvider.overrideWithValue(mockPrefs),
|
||||
pThemeService.overrideWithValue(mockThemeService),
|
||||
priceAnd24hChangeNotifierProvider.overrideWithValue(mockPriceService)
|
||||
],
|
||||
child: MaterialApp(
|
||||
|
@ -322,8 +348,8 @@ void main() {
|
|||
extensions: [
|
||||
StackColors.fromStackColorTheme(
|
||||
StackTheme.fromJson(
|
||||
json: darkJson,
|
||||
applicationThemesDirectoryPath: "",
|
||||
json: lightThemeJsonMap,
|
||||
applicationThemesDirectoryPath: "test",
|
||||
),
|
||||
),
|
||||
],
|
||||
|
@ -361,6 +387,7 @@ void main() {
|
|||
final wallets = MockWallets();
|
||||
final mockPrefs = MockPrefs();
|
||||
final mockPriceService = MockPriceService();
|
||||
final mockThemeService = MockThemeService();
|
||||
final navigator = mockingjay.MockNavigator();
|
||||
|
||||
final tx = Transaction(
|
||||
|
@ -394,6 +421,12 @@ void main() {
|
|||
|
||||
final CoinServiceAPI wallet = MockFiroWallet();
|
||||
|
||||
when(mockThemeService.getTheme(themeId: "light")).thenAnswer(
|
||||
(_) => StackTheme.fromJson(
|
||||
json: lightThemeJsonMap,
|
||||
applicationThemesDirectoryPath: "test",
|
||||
),
|
||||
);
|
||||
when(wallet.coin.ticker).thenAnswer((_) => "FIRO");
|
||||
when(mockLocaleService.locale).thenAnswer((_) => "en_US");
|
||||
when(mockPrefs.currency).thenAnswer((_) => "USD");
|
||||
|
@ -420,6 +453,7 @@ void main() {
|
|||
localeServiceChangeNotifierProvider
|
||||
.overrideWithValue(mockLocaleService),
|
||||
prefsChangeNotifierProvider.overrideWithValue(mockPrefs),
|
||||
pThemeService.overrideWithValue(mockThemeService),
|
||||
priceAnd24hChangeNotifierProvider.overrideWithValue(mockPriceService)
|
||||
],
|
||||
child: MaterialApp(
|
||||
|
@ -427,8 +461,8 @@ void main() {
|
|||
extensions: [
|
||||
StackColors.fromStackColorTheme(
|
||||
StackTheme.fromJson(
|
||||
json: darkJson,
|
||||
applicationThemesDirectoryPath: "",
|
||||
json: lightThemeJsonMap,
|
||||
applicationThemesDirectoryPath: "test",
|
||||
),
|
||||
),
|
||||
],
|
||||
|
|
|
@ -4,6 +4,7 @@
|
|||
|
||||
// ignore_for_file: no_leading_underscores_for_library_prefixes
|
||||
import 'dart:async' as _i18;
|
||||
import 'dart:typed_data' as _i32;
|
||||
import 'dart:ui' as _i20;
|
||||
|
||||
import 'package:decimal/decimal.dart' as _i28;
|
||||
|
@ -15,6 +16,7 @@ import 'package:stackwallet/electrumx_rpc/cached_electrumx.dart' as _i13;
|
|||
import 'package:stackwallet/electrumx_rpc/electrumx.dart' as _i12;
|
||||
import 'package:stackwallet/models/balance.dart' as _i9;
|
||||
import 'package:stackwallet/models/isar/models/isar_models.dart' as _i21;
|
||||
import 'package:stackwallet/models/isar/stack_theme.dart' as _i31;
|
||||
import 'package:stackwallet/models/models.dart' as _i8;
|
||||
import 'package:stackwallet/models/signing_data.dart' as _i23;
|
||||
import 'package:stackwallet/services/coins/coin_service.dart' as _i7;
|
||||
|
@ -28,6 +30,7 @@ import 'package:stackwallet/services/transaction_notification_tracker.dart'
|
|||
as _i11;
|
||||
import 'package:stackwallet/services/wallets.dart' as _i16;
|
||||
import 'package:stackwallet/services/wallets_service.dart' as _i2;
|
||||
import 'package:stackwallet/themes/theme_service.dart' as _i30;
|
||||
import 'package:stackwallet/utilities/amount/amount.dart' as _i10;
|
||||
import 'package:stackwallet/utilities/enums/backup_frequency_type.dart' as _i26;
|
||||
import 'package:stackwallet/utilities/enums/coin_enum.dart' as _i17;
|
||||
|
@ -2821,3 +2824,93 @@ class MockNotesService extends _i1.Mock implements _i29.NotesService {
|
|||
returnValueForMissingStub: null,
|
||||
);
|
||||
}
|
||||
|
||||
/// A class which mocks [ThemeService].
|
||||
///
|
||||
/// See the documentation for Mockito's code generation for more information.
|
||||
class MockThemeService extends _i1.Mock implements _i30.ThemeService {
|
||||
MockThemeService() {
|
||||
_i1.throwOnMissingStub(this);
|
||||
}
|
||||
|
||||
@override
|
||||
_i14.MainDB get db => (super.noSuchMethod(
|
||||
Invocation.getter(#db),
|
||||
returnValue: _FakeMainDB_11(
|
||||
this,
|
||||
Invocation.getter(#db),
|
||||
),
|
||||
) as _i14.MainDB);
|
||||
@override
|
||||
List<_i31.StackTheme> get installedThemes => (super.noSuchMethod(
|
||||
Invocation.getter(#installedThemes),
|
||||
returnValue: <_i31.StackTheme>[],
|
||||
) as List<_i31.StackTheme>);
|
||||
@override
|
||||
void init(_i14.MainDB? db) => super.noSuchMethod(
|
||||
Invocation.method(
|
||||
#init,
|
||||
[db],
|
||||
),
|
||||
returnValueForMissingStub: null,
|
||||
);
|
||||
@override
|
||||
_i18.Future<void> install({required _i32.Uint8List? themeArchiveData}) =>
|
||||
(super.noSuchMethod(
|
||||
Invocation.method(
|
||||
#install,
|
||||
[],
|
||||
{#themeArchiveData: themeArchiveData},
|
||||
),
|
||||
returnValue: _i18.Future<void>.value(),
|
||||
returnValueForMissingStub: _i18.Future<void>.value(),
|
||||
) as _i18.Future<void>);
|
||||
@override
|
||||
_i18.Future<void> remove({required String? themeId}) => (super.noSuchMethod(
|
||||
Invocation.method(
|
||||
#remove,
|
||||
[],
|
||||
{#themeId: themeId},
|
||||
),
|
||||
returnValue: _i18.Future<void>.value(),
|
||||
returnValueForMissingStub: _i18.Future<void>.value(),
|
||||
) as _i18.Future<void>);
|
||||
@override
|
||||
_i18.Future<bool> verifyInstalled({required String? themeId}) =>
|
||||
(super.noSuchMethod(
|
||||
Invocation.method(
|
||||
#verifyInstalled,
|
||||
[],
|
||||
{#themeId: themeId},
|
||||
),
|
||||
returnValue: _i18.Future<bool>.value(false),
|
||||
) as _i18.Future<bool>);
|
||||
@override
|
||||
_i18.Future<List<_i30.StackThemeMetaData>> fetchThemes() =>
|
||||
(super.noSuchMethod(
|
||||
Invocation.method(
|
||||
#fetchThemes,
|
||||
[],
|
||||
),
|
||||
returnValue: _i18.Future<List<_i30.StackThemeMetaData>>.value(
|
||||
<_i30.StackThemeMetaData>[]),
|
||||
) as _i18.Future<List<_i30.StackThemeMetaData>>);
|
||||
@override
|
||||
_i18.Future<_i32.Uint8List> fetchTheme(
|
||||
{required _i30.StackThemeMetaData? themeMetaData}) =>
|
||||
(super.noSuchMethod(
|
||||
Invocation.method(
|
||||
#fetchTheme,
|
||||
[],
|
||||
{#themeMetaData: themeMetaData},
|
||||
),
|
||||
returnValue: _i18.Future<_i32.Uint8List>.value(_i32.Uint8List(0)),
|
||||
) as _i18.Future<_i32.Uint8List>);
|
||||
@override
|
||||
_i31.StackTheme? getTheme({required String? themeId}) =>
|
||||
(super.noSuchMethod(Invocation.method(
|
||||
#getTheme,
|
||||
[],
|
||||
{#themeId: themeId},
|
||||
)) as _i31.StackTheme?);
|
||||
}
|
||||
|
|
|
@ -5,7 +5,7 @@ import 'package:flutter_test/flutter_test.dart';
|
|||
import 'package:mockito/annotations.dart';
|
||||
import 'package:mockito/mockito.dart' as mockito;
|
||||
import 'package:stackwallet/models/balance.dart';
|
||||
import 'package:stackwallet/models/isar/sw_theme.dart';
|
||||
import 'package:stackwallet/models/isar/stack_theme.dart';
|
||||
import 'package:stackwallet/providers/providers.dart';
|
||||
import 'package:stackwallet/services/coins/bitcoin/bitcoin_wallet.dart';
|
||||
import 'package:stackwallet/services/coins/coin_service.dart';
|
||||
|
@ -13,11 +13,12 @@ import 'package:stackwallet/services/coins/manager.dart';
|
|||
import 'package:stackwallet/services/locale_service.dart';
|
||||
import 'package:stackwallet/services/wallets.dart';
|
||||
import 'package:stackwallet/themes/stack_colors.dart';
|
||||
import 'package:stackwallet/themes/defaults/dark.dart';
|
||||
import 'package:stackwallet/themes/theme_service.dart';
|
||||
import 'package:stackwallet/utilities/amount/amount.dart';
|
||||
import 'package:stackwallet/utilities/enums/coin_enum.dart';
|
||||
import 'package:stackwallet/widgets/wallet_card.dart';
|
||||
|
||||
import '../sample_data/theme_json.dart';
|
||||
import 'wallet_card_test.mocks.dart';
|
||||
|
||||
/// quick amount constructor wrapper. Using an int is bad practice but for
|
||||
|
@ -27,10 +28,23 @@ Amount _a(int i) => Amount.fromDecimal(
|
|||
fractionDigits: 8,
|
||||
);
|
||||
|
||||
@GenerateMocks([Wallets, BitcoinWallet, LocaleService])
|
||||
@GenerateMocks([
|
||||
Wallets,
|
||||
BitcoinWallet,
|
||||
LocaleService,
|
||||
ThemeService,
|
||||
])
|
||||
void main() {
|
||||
testWidgets('test widget loads correctly', (widgetTester) async {
|
||||
final CoinServiceAPI wallet = MockBitcoinWallet();
|
||||
final mockThemeService = MockThemeService();
|
||||
|
||||
mockito.when(mockThemeService.getTheme(themeId: "light")).thenAnswer(
|
||||
(_) => StackTheme.fromJson(
|
||||
json: lightThemeJsonMap,
|
||||
applicationThemesDirectoryPath: "test",
|
||||
),
|
||||
);
|
||||
mockito.when(wallet.walletId).thenAnswer((realInvocation) => "wallet id");
|
||||
mockito.when(wallet.coin).thenAnswer((realInvocation) => Coin.bitcoin);
|
||||
mockito
|
||||
|
@ -59,14 +73,15 @@ void main() {
|
|||
ProviderScope(
|
||||
overrides: [
|
||||
walletsChangeNotifierProvider.overrideWithValue(wallets),
|
||||
pThemeService.overrideWithValue(mockThemeService),
|
||||
],
|
||||
child: MaterialApp(
|
||||
theme: ThemeData(
|
||||
extensions: [
|
||||
StackColors.fromStackColorTheme(
|
||||
StackTheme.fromJson(
|
||||
json: darkJson,
|
||||
applicationThemesDirectoryPath: "",
|
||||
json: lightThemeJsonMap,
|
||||
applicationThemesDirectoryPath: "test",
|
||||
),
|
||||
),
|
||||
],
|
||||
|
|
|
@ -18,6 +18,7 @@ import 'package:stackwallet/electrumx_rpc/cached_electrumx.dart' as _i10;
|
|||
import 'package:stackwallet/electrumx_rpc/electrumx.dart' as _i9;
|
||||
import 'package:stackwallet/models/balance.dart' as _i11;
|
||||
import 'package:stackwallet/models/isar/models/isar_models.dart' as _i17;
|
||||
import 'package:stackwallet/models/isar/stack_theme.dart' as _i31;
|
||||
import 'package:stackwallet/models/paymint/fee_object_model.dart' as _i8;
|
||||
import 'package:stackwallet/models/signing_data.dart' as _i26;
|
||||
import 'package:stackwallet/services/coins/bitcoin/bitcoin_wallet.dart' as _i24;
|
||||
|
@ -28,6 +29,7 @@ import 'package:stackwallet/services/transaction_notification_tracker.dart'
|
|||
as _i7;
|
||||
import 'package:stackwallet/services/wallets.dart' as _i19;
|
||||
import 'package:stackwallet/services/wallets_service.dart' as _i2;
|
||||
import 'package:stackwallet/themes/theme_service.dart' as _i30;
|
||||
import 'package:stackwallet/utilities/amount/amount.dart' as _i14;
|
||||
import 'package:stackwallet/utilities/enums/coin_enum.dart' as _i20;
|
||||
import 'package:stackwallet/utilities/enums/derive_path_type_enum.dart' as _i25;
|
||||
|
@ -1758,3 +1760,93 @@ class MockLocaleService extends _i1.Mock implements _i29.LocaleService {
|
|||
returnValueForMissingStub: null,
|
||||
);
|
||||
}
|
||||
|
||||
/// A class which mocks [ThemeService].
|
||||
///
|
||||
/// See the documentation for Mockito's code generation for more information.
|
||||
class MockThemeService extends _i1.Mock implements _i30.ThemeService {
|
||||
MockThemeService() {
|
||||
_i1.throwOnMissingStub(this);
|
||||
}
|
||||
|
||||
@override
|
||||
_i12.MainDB get db => (super.noSuchMethod(
|
||||
Invocation.getter(#db),
|
||||
returnValue: _FakeMainDB_9(
|
||||
this,
|
||||
Invocation.getter(#db),
|
||||
),
|
||||
) as _i12.MainDB);
|
||||
@override
|
||||
List<_i31.StackTheme> get installedThemes => (super.noSuchMethod(
|
||||
Invocation.getter(#installedThemes),
|
||||
returnValue: <_i31.StackTheme>[],
|
||||
) as List<_i31.StackTheme>);
|
||||
@override
|
||||
void init(_i12.MainDB? db) => super.noSuchMethod(
|
||||
Invocation.method(
|
||||
#init,
|
||||
[db],
|
||||
),
|
||||
returnValueForMissingStub: null,
|
||||
);
|
||||
@override
|
||||
_i21.Future<void> install({required _i28.Uint8List? themeArchiveData}) =>
|
||||
(super.noSuchMethod(
|
||||
Invocation.method(
|
||||
#install,
|
||||
[],
|
||||
{#themeArchiveData: themeArchiveData},
|
||||
),
|
||||
returnValue: _i21.Future<void>.value(),
|
||||
returnValueForMissingStub: _i21.Future<void>.value(),
|
||||
) as _i21.Future<void>);
|
||||
@override
|
||||
_i21.Future<void> remove({required String? themeId}) => (super.noSuchMethod(
|
||||
Invocation.method(
|
||||
#remove,
|
||||
[],
|
||||
{#themeId: themeId},
|
||||
),
|
||||
returnValue: _i21.Future<void>.value(),
|
||||
returnValueForMissingStub: _i21.Future<void>.value(),
|
||||
) as _i21.Future<void>);
|
||||
@override
|
||||
_i21.Future<bool> verifyInstalled({required String? themeId}) =>
|
||||
(super.noSuchMethod(
|
||||
Invocation.method(
|
||||
#verifyInstalled,
|
||||
[],
|
||||
{#themeId: themeId},
|
||||
),
|
||||
returnValue: _i21.Future<bool>.value(false),
|
||||
) as _i21.Future<bool>);
|
||||
@override
|
||||
_i21.Future<List<_i30.StackThemeMetaData>> fetchThemes() =>
|
||||
(super.noSuchMethod(
|
||||
Invocation.method(
|
||||
#fetchThemes,
|
||||
[],
|
||||
),
|
||||
returnValue: _i21.Future<List<_i30.StackThemeMetaData>>.value(
|
||||
<_i30.StackThemeMetaData>[]),
|
||||
) as _i21.Future<List<_i30.StackThemeMetaData>>);
|
||||
@override
|
||||
_i21.Future<_i28.Uint8List> fetchTheme(
|
||||
{required _i30.StackThemeMetaData? themeMetaData}) =>
|
||||
(super.noSuchMethod(
|
||||
Invocation.method(
|
||||
#fetchTheme,
|
||||
[],
|
||||
{#themeMetaData: themeMetaData},
|
||||
),
|
||||
returnValue: _i21.Future<_i28.Uint8List>.value(_i28.Uint8List(0)),
|
||||
) as _i21.Future<_i28.Uint8List>);
|
||||
@override
|
||||
_i31.StackTheme? getTheme({required String? themeId}) =>
|
||||
(super.noSuchMethod(Invocation.method(
|
||||
#getTheme,
|
||||
[],
|
||||
{#themeId: themeId},
|
||||
)) as _i31.StackTheme?);
|
||||
}
|
||||
|
|
|
@ -4,7 +4,7 @@ import 'package:flutter_test/flutter_test.dart';
|
|||
import 'package:mockito/annotations.dart';
|
||||
import 'package:mockito/mockito.dart';
|
||||
import 'package:stackwallet/models/balance.dart';
|
||||
import 'package:stackwallet/models/isar/sw_theme.dart';
|
||||
import 'package:stackwallet/models/isar/stack_theme.dart';
|
||||
import 'package:stackwallet/providers/providers.dart';
|
||||
import 'package:stackwallet/services/coins/bitcoin/bitcoin_wallet.dart';
|
||||
import 'package:stackwallet/services/coins/coin_service.dart';
|
||||
|
@ -13,11 +13,11 @@ import 'package:stackwallet/services/node_service.dart';
|
|||
import 'package:stackwallet/services/wallets.dart';
|
||||
import 'package:stackwallet/services/wallets_service.dart';
|
||||
import 'package:stackwallet/themes/stack_colors.dart';
|
||||
import 'package:stackwallet/themes/defaults/dark.dart';
|
||||
import 'package:stackwallet/utilities/amount/amount.dart';
|
||||
import 'package:stackwallet/utilities/enums/coin_enum.dart';
|
||||
import 'package:stackwallet/widgets/wallet_info_row/sub_widgets/wallet_info_row_balance.dart';
|
||||
|
||||
import '../../../sample_data/theme_json.dart';
|
||||
import 'wallet_info_row_balance_future_test.mocks.dart';
|
||||
|
||||
@GenerateMocks([
|
||||
|
@ -63,8 +63,8 @@ void main() {
|
|||
extensions: [
|
||||
StackColors.fromStackColorTheme(
|
||||
StackTheme.fromJson(
|
||||
json: darkJson,
|
||||
applicationThemesDirectoryPath: "",
|
||||
json: lightThemeJsonMap,
|
||||
applicationThemesDirectoryPath: "test",
|
||||
),
|
||||
),
|
||||
],
|
||||
|
|
|
@ -4,7 +4,7 @@ import 'package:flutter_test/flutter_test.dart';
|
|||
import 'package:mockito/annotations.dart';
|
||||
import 'package:mockito/mockito.dart';
|
||||
import 'package:stackwallet/models/balance.dart';
|
||||
import 'package:stackwallet/models/isar/sw_theme.dart';
|
||||
import 'package:stackwallet/models/isar/stack_theme.dart';
|
||||
import 'package:stackwallet/providers/providers.dart';
|
||||
import 'package:stackwallet/services/coins/bitcoin/bitcoin_wallet.dart';
|
||||
import 'package:stackwallet/services/coins/coin_service.dart';
|
||||
|
@ -13,17 +13,19 @@ import 'package:stackwallet/services/node_service.dart';
|
|||
import 'package:stackwallet/services/wallets.dart';
|
||||
import 'package:stackwallet/services/wallets_service.dart';
|
||||
import 'package:stackwallet/themes/stack_colors.dart';
|
||||
import 'package:stackwallet/themes/defaults/dark.dart';
|
||||
import 'package:stackwallet/themes/theme_service.dart';
|
||||
import 'package:stackwallet/utilities/amount/amount.dart';
|
||||
import 'package:stackwallet/utilities/enums/coin_enum.dart';
|
||||
import 'package:stackwallet/widgets/wallet_info_row/sub_widgets/wallet_info_row_balance.dart';
|
||||
import 'package:stackwallet/widgets/wallet_info_row/wallet_info_row.dart';
|
||||
|
||||
import '../../sample_data/theme_json.dart';
|
||||
import 'wallet_info_row_test.mocks.dart';
|
||||
|
||||
@GenerateMocks([
|
||||
Wallets,
|
||||
WalletsService,
|
||||
ThemeService,
|
||||
BitcoinWallet
|
||||
], customMocks: [
|
||||
MockSpec<NodeService>(returnNullOnMissingStub: true),
|
||||
|
@ -34,7 +36,14 @@ import 'wallet_info_row_test.mocks.dart';
|
|||
void main() {
|
||||
testWidgets("Test wallet info row displays correctly", (widgetTester) async {
|
||||
final wallets = MockWallets();
|
||||
final mockThemeService = MockThemeService();
|
||||
final CoinServiceAPI wallet = MockBitcoinWallet();
|
||||
when(mockThemeService.getTheme(themeId: "light")).thenAnswer(
|
||||
(_) => StackTheme.fromJson(
|
||||
json: lightThemeJsonMap,
|
||||
applicationThemesDirectoryPath: "test",
|
||||
),
|
||||
);
|
||||
when(wallet.coin).thenAnswer((_) => Coin.bitcoin);
|
||||
when(wallet.walletName).thenAnswer((_) => "some wallet");
|
||||
when(wallet.walletId).thenAnswer((_) => "some-wallet-id");
|
||||
|
@ -56,14 +65,15 @@ void main() {
|
|||
ProviderScope(
|
||||
overrides: [
|
||||
walletsChangeNotifierProvider.overrideWithValue(wallets),
|
||||
pThemeService.overrideWithValue(mockThemeService),
|
||||
],
|
||||
child: MaterialApp(
|
||||
theme: ThemeData(
|
||||
extensions: [
|
||||
StackColors.fromStackColorTheme(
|
||||
StackTheme.fromJson(
|
||||
json: darkJson,
|
||||
applicationThemesDirectoryPath: "",
|
||||
json: lightThemeJsonMap,
|
||||
applicationThemesDirectoryPath: "test",
|
||||
),
|
||||
),
|
||||
],
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
|
||||
// ignore_for_file: no_leading_underscores_for_library_prefixes
|
||||
import 'dart:async' as _i23;
|
||||
import 'dart:typed_data' as _i29;
|
||||
import 'dart:typed_data' as _i28;
|
||||
import 'dart:ui' as _i25;
|
||||
|
||||
import 'package:bip32/bip32.dart' as _i16;
|
||||
|
@ -13,25 +13,27 @@ import 'package:bitcoindart/bitcoindart.dart' as _i13;
|
|||
import 'package:flutter/foundation.dart' as _i4;
|
||||
import 'package:flutter_riverpod/flutter_riverpod.dart' as _i5;
|
||||
import 'package:mockito/mockito.dart' as _i1;
|
||||
import 'package:stackwallet/db/isar/main_db.dart' as _i12;
|
||||
import 'package:stackwallet/electrumx_rpc/cached_electrumx.dart' as _i10;
|
||||
import 'package:stackwallet/electrumx_rpc/electrumx.dart' as _i9;
|
||||
import 'package:stackwallet/models/balance.dart' as _i11;
|
||||
import 'package:stackwallet/db/isar/main_db.dart' as _i7;
|
||||
import 'package:stackwallet/electrumx_rpc/cached_electrumx.dart' as _i11;
|
||||
import 'package:stackwallet/electrumx_rpc/electrumx.dart' as _i10;
|
||||
import 'package:stackwallet/models/balance.dart' as _i12;
|
||||
import 'package:stackwallet/models/isar/models/isar_models.dart' as _i17;
|
||||
import 'package:stackwallet/models/node_model.dart' as _i30;
|
||||
import 'package:stackwallet/models/paymint/fee_object_model.dart' as _i8;
|
||||
import 'package:stackwallet/models/signing_data.dart' as _i28;
|
||||
import 'package:stackwallet/services/coins/bitcoin/bitcoin_wallet.dart' as _i26;
|
||||
import 'package:stackwallet/models/isar/stack_theme.dart' as _i27;
|
||||
import 'package:stackwallet/models/node_model.dart' as _i32;
|
||||
import 'package:stackwallet/models/paymint/fee_object_model.dart' as _i9;
|
||||
import 'package:stackwallet/models/signing_data.dart' as _i31;
|
||||
import 'package:stackwallet/services/coins/bitcoin/bitcoin_wallet.dart' as _i29;
|
||||
import 'package:stackwallet/services/coins/coin_service.dart' as _i20;
|
||||
import 'package:stackwallet/services/coins/manager.dart' as _i6;
|
||||
import 'package:stackwallet/services/node_service.dart' as _i3;
|
||||
import 'package:stackwallet/services/transaction_notification_tracker.dart'
|
||||
as _i7;
|
||||
as _i8;
|
||||
import 'package:stackwallet/services/wallets.dart' as _i21;
|
||||
import 'package:stackwallet/services/wallets_service.dart' as _i2;
|
||||
import 'package:stackwallet/themes/theme_service.dart' as _i26;
|
||||
import 'package:stackwallet/utilities/amount/amount.dart' as _i14;
|
||||
import 'package:stackwallet/utilities/enums/coin_enum.dart' as _i22;
|
||||
import 'package:stackwallet/utilities/enums/derive_path_type_enum.dart' as _i27;
|
||||
import 'package:stackwallet/utilities/enums/derive_path_type_enum.dart' as _i30;
|
||||
import 'package:stackwallet/utilities/flutter_secure_storage_interface.dart'
|
||||
as _i19;
|
||||
import 'package:stackwallet/utilities/prefs.dart' as _i24;
|
||||
|
@ -90,9 +92,8 @@ class _FakeManager_3 extends _i1.SmartFake implements _i6.Manager {
|
|||
);
|
||||
}
|
||||
|
||||
class _FakeTransactionNotificationTracker_4 extends _i1.SmartFake
|
||||
implements _i7.TransactionNotificationTracker {
|
||||
_FakeTransactionNotificationTracker_4(
|
||||
class _FakeMainDB_4 extends _i1.SmartFake implements _i7.MainDB {
|
||||
_FakeMainDB_4(
|
||||
Object parent,
|
||||
Invocation parentInvocation,
|
||||
) : super(
|
||||
|
@ -101,8 +102,9 @@ class _FakeTransactionNotificationTracker_4 extends _i1.SmartFake
|
|||
);
|
||||
}
|
||||
|
||||
class _FakeFeeObject_5 extends _i1.SmartFake implements _i8.FeeObject {
|
||||
_FakeFeeObject_5(
|
||||
class _FakeTransactionNotificationTracker_5 extends _i1.SmartFake
|
||||
implements _i8.TransactionNotificationTracker {
|
||||
_FakeTransactionNotificationTracker_5(
|
||||
Object parent,
|
||||
Invocation parentInvocation,
|
||||
) : super(
|
||||
|
@ -111,8 +113,8 @@ class _FakeFeeObject_5 extends _i1.SmartFake implements _i8.FeeObject {
|
|||
);
|
||||
}
|
||||
|
||||
class _FakeElectrumX_6 extends _i1.SmartFake implements _i9.ElectrumX {
|
||||
_FakeElectrumX_6(
|
||||
class _FakeFeeObject_6 extends _i1.SmartFake implements _i9.FeeObject {
|
||||
_FakeFeeObject_6(
|
||||
Object parent,
|
||||
Invocation parentInvocation,
|
||||
) : super(
|
||||
|
@ -121,9 +123,8 @@ class _FakeElectrumX_6 extends _i1.SmartFake implements _i9.ElectrumX {
|
|||
);
|
||||
}
|
||||
|
||||
class _FakeCachedElectrumX_7 extends _i1.SmartFake
|
||||
implements _i10.CachedElectrumX {
|
||||
_FakeCachedElectrumX_7(
|
||||
class _FakeElectrumX_7 extends _i1.SmartFake implements _i10.ElectrumX {
|
||||
_FakeElectrumX_7(
|
||||
Object parent,
|
||||
Invocation parentInvocation,
|
||||
) : super(
|
||||
|
@ -132,8 +133,9 @@ class _FakeCachedElectrumX_7 extends _i1.SmartFake
|
|||
);
|
||||
}
|
||||
|
||||
class _FakeBalance_8 extends _i1.SmartFake implements _i11.Balance {
|
||||
_FakeBalance_8(
|
||||
class _FakeCachedElectrumX_8 extends _i1.SmartFake
|
||||
implements _i11.CachedElectrumX {
|
||||
_FakeCachedElectrumX_8(
|
||||
Object parent,
|
||||
Invocation parentInvocation,
|
||||
) : super(
|
||||
|
@ -142,8 +144,8 @@ class _FakeBalance_8 extends _i1.SmartFake implements _i11.Balance {
|
|||
);
|
||||
}
|
||||
|
||||
class _FakeMainDB_9 extends _i1.SmartFake implements _i12.MainDB {
|
||||
_FakeMainDB_9(
|
||||
class _FakeBalance_9 extends _i1.SmartFake implements _i12.Balance {
|
||||
_FakeBalance_9(
|
||||
Object parent,
|
||||
Invocation parentInvocation,
|
||||
) : super(
|
||||
|
@ -162,7 +164,8 @@ class _FakeNetworkType_10 extends _i1.SmartFake implements _i13.NetworkType {
|
|||
);
|
||||
}
|
||||
|
||||
class _FakeElectrumXNode_11 extends _i1.SmartFake implements _i9.ElectrumXNode {
|
||||
class _FakeElectrumXNode_11 extends _i1.SmartFake
|
||||
implements _i10.ElectrumXNode {
|
||||
_FakeElectrumXNode_11(
|
||||
Object parent,
|
||||
Invocation parentInvocation,
|
||||
|
@ -687,10 +690,100 @@ class MockWalletsService extends _i1.Mock implements _i2.WalletsService {
|
|||
);
|
||||
}
|
||||
|
||||
/// A class which mocks [ThemeService].
|
||||
///
|
||||
/// See the documentation for Mockito's code generation for more information.
|
||||
class MockThemeService extends _i1.Mock implements _i26.ThemeService {
|
||||
MockThemeService() {
|
||||
_i1.throwOnMissingStub(this);
|
||||
}
|
||||
|
||||
@override
|
||||
_i7.MainDB get db => (super.noSuchMethod(
|
||||
Invocation.getter(#db),
|
||||
returnValue: _FakeMainDB_4(
|
||||
this,
|
||||
Invocation.getter(#db),
|
||||
),
|
||||
) as _i7.MainDB);
|
||||
@override
|
||||
List<_i27.StackTheme> get installedThemes => (super.noSuchMethod(
|
||||
Invocation.getter(#installedThemes),
|
||||
returnValue: <_i27.StackTheme>[],
|
||||
) as List<_i27.StackTheme>);
|
||||
@override
|
||||
void init(_i7.MainDB? db) => super.noSuchMethod(
|
||||
Invocation.method(
|
||||
#init,
|
||||
[db],
|
||||
),
|
||||
returnValueForMissingStub: null,
|
||||
);
|
||||
@override
|
||||
_i23.Future<void> install({required _i28.Uint8List? themeArchiveData}) =>
|
||||
(super.noSuchMethod(
|
||||
Invocation.method(
|
||||
#install,
|
||||
[],
|
||||
{#themeArchiveData: themeArchiveData},
|
||||
),
|
||||
returnValue: _i23.Future<void>.value(),
|
||||
returnValueForMissingStub: _i23.Future<void>.value(),
|
||||
) as _i23.Future<void>);
|
||||
@override
|
||||
_i23.Future<void> remove({required String? themeId}) => (super.noSuchMethod(
|
||||
Invocation.method(
|
||||
#remove,
|
||||
[],
|
||||
{#themeId: themeId},
|
||||
),
|
||||
returnValue: _i23.Future<void>.value(),
|
||||
returnValueForMissingStub: _i23.Future<void>.value(),
|
||||
) as _i23.Future<void>);
|
||||
@override
|
||||
_i23.Future<bool> verifyInstalled({required String? themeId}) =>
|
||||
(super.noSuchMethod(
|
||||
Invocation.method(
|
||||
#verifyInstalled,
|
||||
[],
|
||||
{#themeId: themeId},
|
||||
),
|
||||
returnValue: _i23.Future<bool>.value(false),
|
||||
) as _i23.Future<bool>);
|
||||
@override
|
||||
_i23.Future<List<_i26.StackThemeMetaData>> fetchThemes() =>
|
||||
(super.noSuchMethod(
|
||||
Invocation.method(
|
||||
#fetchThemes,
|
||||
[],
|
||||
),
|
||||
returnValue: _i23.Future<List<_i26.StackThemeMetaData>>.value(
|
||||
<_i26.StackThemeMetaData>[]),
|
||||
) as _i23.Future<List<_i26.StackThemeMetaData>>);
|
||||
@override
|
||||
_i23.Future<_i28.Uint8List> fetchTheme(
|
||||
{required _i26.StackThemeMetaData? themeMetaData}) =>
|
||||
(super.noSuchMethod(
|
||||
Invocation.method(
|
||||
#fetchTheme,
|
||||
[],
|
||||
{#themeMetaData: themeMetaData},
|
||||
),
|
||||
returnValue: _i23.Future<_i28.Uint8List>.value(_i28.Uint8List(0)),
|
||||
) as _i23.Future<_i28.Uint8List>);
|
||||
@override
|
||||
_i27.StackTheme? getTheme({required String? themeId}) =>
|
||||
(super.noSuchMethod(Invocation.method(
|
||||
#getTheme,
|
||||
[],
|
||||
{#themeId: themeId},
|
||||
)) as _i27.StackTheme?);
|
||||
}
|
||||
|
||||
/// A class which mocks [BitcoinWallet].
|
||||
///
|
||||
/// See the documentation for Mockito's code generation for more information.
|
||||
class MockBitcoinWallet extends _i1.Mock implements _i26.BitcoinWallet {
|
||||
class MockBitcoinWallet extends _i1.Mock implements _i29.BitcoinWallet {
|
||||
MockBitcoinWallet() {
|
||||
_i1.throwOnMissingStub(this);
|
||||
}
|
||||
|
@ -704,15 +797,15 @@ class MockBitcoinWallet extends _i1.Mock implements _i26.BitcoinWallet {
|
|||
returnValueForMissingStub: null,
|
||||
);
|
||||
@override
|
||||
_i7.TransactionNotificationTracker get txTracker => (super.noSuchMethod(
|
||||
_i8.TransactionNotificationTracker get txTracker => (super.noSuchMethod(
|
||||
Invocation.getter(#txTracker),
|
||||
returnValue: _FakeTransactionNotificationTracker_4(
|
||||
returnValue: _FakeTransactionNotificationTracker_5(
|
||||
this,
|
||||
Invocation.getter(#txTracker),
|
||||
),
|
||||
) as _i7.TransactionNotificationTracker);
|
||||
) as _i8.TransactionNotificationTracker);
|
||||
@override
|
||||
set txTracker(_i7.TransactionNotificationTracker? _txTracker) =>
|
||||
set txTracker(_i8.TransactionNotificationTracker? _txTracker) =>
|
||||
super.noSuchMethod(
|
||||
Invocation.setter(
|
||||
#txTracker,
|
||||
|
@ -809,13 +902,13 @@ class MockBitcoinWallet extends _i1.Mock implements _i26.BitcoinWallet {
|
|||
returnValue: false,
|
||||
) as bool);
|
||||
@override
|
||||
_i23.Future<_i8.FeeObject> get fees => (super.noSuchMethod(
|
||||
_i23.Future<_i9.FeeObject> get fees => (super.noSuchMethod(
|
||||
Invocation.getter(#fees),
|
||||
returnValue: _i23.Future<_i8.FeeObject>.value(_FakeFeeObject_5(
|
||||
returnValue: _i23.Future<_i9.FeeObject>.value(_FakeFeeObject_6(
|
||||
this,
|
||||
Invocation.getter(#fees),
|
||||
)),
|
||||
) as _i23.Future<_i8.FeeObject>);
|
||||
) as _i23.Future<_i9.FeeObject>);
|
||||
@override
|
||||
_i23.Future<int> get maxFee => (super.noSuchMethod(
|
||||
Invocation.getter(#maxFee),
|
||||
|
@ -888,29 +981,29 @@ class MockBitcoinWallet extends _i1.Mock implements _i26.BitcoinWallet {
|
|||
returnValueForMissingStub: null,
|
||||
);
|
||||
@override
|
||||
_i9.ElectrumX get electrumXClient => (super.noSuchMethod(
|
||||
_i10.ElectrumX get electrumXClient => (super.noSuchMethod(
|
||||
Invocation.getter(#electrumXClient),
|
||||
returnValue: _FakeElectrumX_6(
|
||||
returnValue: _FakeElectrumX_7(
|
||||
this,
|
||||
Invocation.getter(#electrumXClient),
|
||||
),
|
||||
) as _i9.ElectrumX);
|
||||
) as _i10.ElectrumX);
|
||||
@override
|
||||
_i10.CachedElectrumX get cachedElectrumXClient => (super.noSuchMethod(
|
||||
_i11.CachedElectrumX get cachedElectrumXClient => (super.noSuchMethod(
|
||||
Invocation.getter(#cachedElectrumXClient),
|
||||
returnValue: _FakeCachedElectrumX_7(
|
||||
returnValue: _FakeCachedElectrumX_8(
|
||||
this,
|
||||
Invocation.getter(#cachedElectrumXClient),
|
||||
),
|
||||
) as _i10.CachedElectrumX);
|
||||
) as _i11.CachedElectrumX);
|
||||
@override
|
||||
_i11.Balance get balance => (super.noSuchMethod(
|
||||
_i12.Balance get balance => (super.noSuchMethod(
|
||||
Invocation.getter(#balance),
|
||||
returnValue: _FakeBalance_8(
|
||||
returnValue: _FakeBalance_9(
|
||||
this,
|
||||
Invocation.getter(#balance),
|
||||
),
|
||||
) as _i11.Balance);
|
||||
) as _i12.Balance);
|
||||
@override
|
||||
_i23.Future<String> get xpub => (super.noSuchMethod(
|
||||
Invocation.getter(#xpub),
|
||||
|
@ -926,13 +1019,13 @@ class MockBitcoinWallet extends _i1.Mock implements _i26.BitcoinWallet {
|
|||
returnValueForMissingStub: null,
|
||||
);
|
||||
@override
|
||||
_i12.MainDB get db => (super.noSuchMethod(
|
||||
_i7.MainDB get db => (super.noSuchMethod(
|
||||
Invocation.getter(#db),
|
||||
returnValue: _FakeMainDB_9(
|
||||
returnValue: _FakeMainDB_4(
|
||||
this,
|
||||
Invocation.getter(#db),
|
||||
),
|
||||
) as _i12.MainDB);
|
||||
) as _i7.MainDB);
|
||||
@override
|
||||
_i13.NetworkType get networkType => (super.noSuchMethod(
|
||||
Invocation.getter(#networkType),
|
||||
|
@ -951,15 +1044,15 @@ class MockBitcoinWallet extends _i1.Mock implements _i26.BitcoinWallet {
|
|||
returnValueForMissingStub: _i23.Future<void>.value(),
|
||||
) as _i23.Future<void>);
|
||||
@override
|
||||
_i27.DerivePathType addressType({required String? address}) =>
|
||||
_i30.DerivePathType addressType({required String? address}) =>
|
||||
(super.noSuchMethod(
|
||||
Invocation.method(
|
||||
#addressType,
|
||||
[],
|
||||
{#address: address},
|
||||
),
|
||||
returnValue: _i27.DerivePathType.bip44,
|
||||
) as _i27.DerivePathType);
|
||||
returnValue: _i30.DerivePathType.bip44,
|
||||
) as _i30.DerivePathType);
|
||||
@override
|
||||
_i23.Future<void> recoverFromMnemonic({
|
||||
required String? mnemonic,
|
||||
|
@ -1118,19 +1211,20 @@ class MockBitcoinWallet extends _i1.Mock implements _i26.BitcoinWallet {
|
|||
returnValueForMissingStub: _i23.Future<void>.value(),
|
||||
) as _i23.Future<void>);
|
||||
@override
|
||||
_i23.Future<_i9.ElectrumXNode> getCurrentNode() => (super.noSuchMethod(
|
||||
_i23.Future<_i10.ElectrumXNode> getCurrentNode() => (super.noSuchMethod(
|
||||
Invocation.method(
|
||||
#getCurrentNode,
|
||||
[],
|
||||
),
|
||||
returnValue: _i23.Future<_i9.ElectrumXNode>.value(_FakeElectrumXNode_11(
|
||||
returnValue:
|
||||
_i23.Future<_i10.ElectrumXNode>.value(_FakeElectrumXNode_11(
|
||||
this,
|
||||
Invocation.method(
|
||||
#getCurrentNode,
|
||||
[],
|
||||
),
|
||||
)),
|
||||
) as _i23.Future<_i9.ElectrumXNode>);
|
||||
) as _i23.Future<_i10.ElectrumXNode>);
|
||||
@override
|
||||
_i23.Future<List<Map<String, dynamic>>> fastFetch(
|
||||
List<String>? allTxHashes) =>
|
||||
|
@ -1212,7 +1306,7 @@ class MockBitcoinWallet extends _i1.Mock implements _i26.BitcoinWallet {
|
|||
},
|
||||
));
|
||||
@override
|
||||
_i23.Future<List<_i28.SigningData>> fetchBuildTxData(
|
||||
_i23.Future<List<_i31.SigningData>> fetchBuildTxData(
|
||||
List<_i17.UTXO>? utxosToUse) =>
|
||||
(super.noSuchMethod(
|
||||
Invocation.method(
|
||||
|
@ -1220,11 +1314,11 @@ class MockBitcoinWallet extends _i1.Mock implements _i26.BitcoinWallet {
|
|||
[utxosToUse],
|
||||
),
|
||||
returnValue:
|
||||
_i23.Future<List<_i28.SigningData>>.value(<_i28.SigningData>[]),
|
||||
) as _i23.Future<List<_i28.SigningData>>);
|
||||
_i23.Future<List<_i31.SigningData>>.value(<_i31.SigningData>[]),
|
||||
) as _i23.Future<List<_i31.SigningData>>);
|
||||
@override
|
||||
_i23.Future<Map<String, dynamic>> buildTransaction({
|
||||
required List<_i28.SigningData>? utxoSigningData,
|
||||
required List<_i31.SigningData>? utxoSigningData,
|
||||
required List<String>? recipients,
|
||||
required List<int>? satoshiAmounts,
|
||||
}) =>
|
||||
|
@ -1391,21 +1485,21 @@ class MockBitcoinWallet extends _i1.Mock implements _i26.BitcoinWallet {
|
|||
returnValueForMissingStub: _i23.Future<void>.value(),
|
||||
) as _i23.Future<void>);
|
||||
@override
|
||||
_i11.Balance getCachedBalance() => (super.noSuchMethod(
|
||||
_i12.Balance getCachedBalance() => (super.noSuchMethod(
|
||||
Invocation.method(
|
||||
#getCachedBalance,
|
||||
[],
|
||||
),
|
||||
returnValue: _FakeBalance_8(
|
||||
returnValue: _FakeBalance_9(
|
||||
this,
|
||||
Invocation.method(
|
||||
#getCachedBalance,
|
||||
[],
|
||||
),
|
||||
),
|
||||
) as _i11.Balance);
|
||||
) as _i12.Balance);
|
||||
@override
|
||||
_i23.Future<void> updateCachedBalance(_i11.Balance? balance) =>
|
||||
_i23.Future<void> updateCachedBalance(_i12.Balance? balance) =>
|
||||
(super.noSuchMethod(
|
||||
Invocation.method(
|
||||
#updateCachedBalance,
|
||||
|
@ -1415,21 +1509,21 @@ class MockBitcoinWallet extends _i1.Mock implements _i26.BitcoinWallet {
|
|||
returnValueForMissingStub: _i23.Future<void>.value(),
|
||||
) as _i23.Future<void>);
|
||||
@override
|
||||
_i11.Balance getCachedBalanceSecondary() => (super.noSuchMethod(
|
||||
_i12.Balance getCachedBalanceSecondary() => (super.noSuchMethod(
|
||||
Invocation.method(
|
||||
#getCachedBalanceSecondary,
|
||||
[],
|
||||
),
|
||||
returnValue: _FakeBalance_8(
|
||||
returnValue: _FakeBalance_9(
|
||||
this,
|
||||
Invocation.method(
|
||||
#getCachedBalanceSecondary,
|
||||
[],
|
||||
),
|
||||
),
|
||||
) as _i11.Balance);
|
||||
) as _i12.Balance);
|
||||
@override
|
||||
_i23.Future<void> updateCachedBalanceSecondary(_i11.Balance? balance) =>
|
||||
_i23.Future<void> updateCachedBalanceSecondary(_i12.Balance? balance) =>
|
||||
(super.noSuchMethod(
|
||||
Invocation.method(
|
||||
#updateCachedBalanceSecondary,
|
||||
|
@ -1458,7 +1552,7 @@ class MockBitcoinWallet extends _i1.Mock implements _i26.BitcoinWallet {
|
|||
returnValueForMissingStub: _i23.Future<void>.value(),
|
||||
) as _i23.Future<void>);
|
||||
@override
|
||||
void initWalletDB({_i12.MainDB? mockableOverride}) => super.noSuchMethod(
|
||||
void initWalletDB({_i7.MainDB? mockableOverride}) => super.noSuchMethod(
|
||||
Invocation.method(
|
||||
#initWalletDB,
|
||||
[],
|
||||
|
@ -1510,8 +1604,8 @@ class MockBitcoinWallet extends _i1.Mock implements _i26.BitcoinWallet {
|
|||
required String? walletName,
|
||||
required _i13.NetworkType? network,
|
||||
required _i22.Coin? coin,
|
||||
required _i12.MainDB? db,
|
||||
required _i9.ElectrumX? electrumXClient,
|
||||
required _i7.MainDB? db,
|
||||
required _i10.ElectrumX? electrumXClient,
|
||||
required _i19.SecureStorageInterface? secureStorage,
|
||||
required int? dustLimit,
|
||||
required int? dustLimitP2PKH,
|
||||
|
@ -1532,7 +1626,7 @@ class MockBitcoinWallet extends _i1.Mock implements _i26.BitcoinWallet {
|
|||
})?
|
||||
prepareSend,
|
||||
required _i23.Future<int> Function({required String address})? getTxCount,
|
||||
required _i23.Future<List<_i28.SigningData>> Function(List<_i17.UTXO>)?
|
||||
required _i23.Future<List<_i31.SigningData>> Function(List<_i17.UTXO>)?
|
||||
fetchBuildTxData,
|
||||
required _i23.Future<void> Function()? refresh,
|
||||
required _i23.Future<void> Function()? checkChangeAddressForTransactions,
|
||||
|
@ -1582,7 +1676,7 @@ class MockBitcoinWallet extends _i1.Mock implements _i26.BitcoinWallet {
|
|||
)),
|
||||
) as _i23.Future<_i16.BIP32>);
|
||||
@override
|
||||
_i23.Future<_i29.Uint8List> getPrivateKeyForPaynymReceivingAddress({
|
||||
_i23.Future<_i28.Uint8List> getPrivateKeyForPaynymReceivingAddress({
|
||||
required String? paymentCodeString,
|
||||
required int? index,
|
||||
}) =>
|
||||
|
@ -1595,8 +1689,8 @@ class MockBitcoinWallet extends _i1.Mock implements _i26.BitcoinWallet {
|
|||
#index: index,
|
||||
},
|
||||
),
|
||||
returnValue: _i23.Future<_i29.Uint8List>.value(_i29.Uint8List(0)),
|
||||
) as _i23.Future<_i29.Uint8List>);
|
||||
returnValue: _i23.Future<_i28.Uint8List>.value(_i28.Uint8List(0)),
|
||||
) as _i23.Future<_i28.Uint8List>);
|
||||
@override
|
||||
_i23.Future<_i17.Address> currentReceivingPaynymAddress({
|
||||
required _i18.PaymentCode? sender,
|
||||
|
@ -1682,14 +1776,14 @@ class MockBitcoinWallet extends _i1.Mock implements _i26.BitcoinWallet {
|
|||
)),
|
||||
) as _i23.Future<_i18.PaymentCode>);
|
||||
@override
|
||||
_i23.Future<_i29.Uint8List> signWithNotificationKey(_i29.Uint8List? data) =>
|
||||
_i23.Future<_i28.Uint8List> signWithNotificationKey(_i28.Uint8List? data) =>
|
||||
(super.noSuchMethod(
|
||||
Invocation.method(
|
||||
#signWithNotificationKey,
|
||||
[data],
|
||||
),
|
||||
returnValue: _i23.Future<_i29.Uint8List>.value(_i29.Uint8List(0)),
|
||||
) as _i23.Future<_i29.Uint8List>);
|
||||
returnValue: _i23.Future<_i28.Uint8List>.value(_i28.Uint8List(0)),
|
||||
) as _i23.Future<_i28.Uint8List>);
|
||||
@override
|
||||
_i23.Future<String> signStringWithNotificationKey(String? data) =>
|
||||
(super.noSuchMethod(
|
||||
|
@ -1922,9 +2016,9 @@ class MockBitcoinWallet extends _i1.Mock implements _i26.BitcoinWallet {
|
|||
required String? walletId,
|
||||
required String? walletName,
|
||||
required _i22.Coin? coin,
|
||||
required _i12.MainDB? db,
|
||||
required _i7.MainDB? db,
|
||||
required _i23.Future<int> Function()? getChainHeight,
|
||||
required _i23.Future<void> Function(_i11.Balance)? refreshedBalanceCallback,
|
||||
required _i23.Future<void> Function(_i12.Balance)? refreshedBalanceCallback,
|
||||
}) =>
|
||||
super.noSuchMethod(
|
||||
Invocation.method(
|
||||
|
@ -1967,15 +2061,15 @@ class MockNodeService extends _i1.Mock implements _i3.NodeService {
|
|||
),
|
||||
) as _i19.SecureStorageInterface);
|
||||
@override
|
||||
List<_i30.NodeModel> get primaryNodes => (super.noSuchMethod(
|
||||
List<_i32.NodeModel> get primaryNodes => (super.noSuchMethod(
|
||||
Invocation.getter(#primaryNodes),
|
||||
returnValue: <_i30.NodeModel>[],
|
||||
) as List<_i30.NodeModel>);
|
||||
returnValue: <_i32.NodeModel>[],
|
||||
) as List<_i32.NodeModel>);
|
||||
@override
|
||||
List<_i30.NodeModel> get nodes => (super.noSuchMethod(
|
||||
List<_i32.NodeModel> get nodes => (super.noSuchMethod(
|
||||
Invocation.getter(#nodes),
|
||||
returnValue: <_i30.NodeModel>[],
|
||||
) as List<_i30.NodeModel>);
|
||||
returnValue: <_i32.NodeModel>[],
|
||||
) as List<_i32.NodeModel>);
|
||||
@override
|
||||
bool get hasListeners => (super.noSuchMethod(
|
||||
Invocation.getter(#hasListeners),
|
||||
|
@ -1993,7 +2087,7 @@ class MockNodeService extends _i1.Mock implements _i3.NodeService {
|
|||
@override
|
||||
_i23.Future<void> setPrimaryNodeFor({
|
||||
required _i22.Coin? coin,
|
||||
required _i30.NodeModel? node,
|
||||
required _i32.NodeModel? node,
|
||||
bool? shouldNotifyListeners = false,
|
||||
}) =>
|
||||
(super.noSuchMethod(
|
||||
|
@ -2010,40 +2104,40 @@ class MockNodeService extends _i1.Mock implements _i3.NodeService {
|
|||
returnValueForMissingStub: _i23.Future<void>.value(),
|
||||
) as _i23.Future<void>);
|
||||
@override
|
||||
_i30.NodeModel? getPrimaryNodeFor({required _i22.Coin? coin}) =>
|
||||
_i32.NodeModel? getPrimaryNodeFor({required _i22.Coin? coin}) =>
|
||||
(super.noSuchMethod(Invocation.method(
|
||||
#getPrimaryNodeFor,
|
||||
[],
|
||||
{#coin: coin},
|
||||
)) as _i30.NodeModel?);
|
||||
)) as _i32.NodeModel?);
|
||||
@override
|
||||
List<_i30.NodeModel> getNodesFor(_i22.Coin? coin) => (super.noSuchMethod(
|
||||
List<_i32.NodeModel> getNodesFor(_i22.Coin? coin) => (super.noSuchMethod(
|
||||
Invocation.method(
|
||||
#getNodesFor,
|
||||
[coin],
|
||||
),
|
||||
returnValue: <_i30.NodeModel>[],
|
||||
) as List<_i30.NodeModel>);
|
||||
returnValue: <_i32.NodeModel>[],
|
||||
) as List<_i32.NodeModel>);
|
||||
@override
|
||||
_i30.NodeModel? getNodeById({required String? id}) =>
|
||||
_i32.NodeModel? getNodeById({required String? id}) =>
|
||||
(super.noSuchMethod(Invocation.method(
|
||||
#getNodeById,
|
||||
[],
|
||||
{#id: id},
|
||||
)) as _i30.NodeModel?);
|
||||
)) as _i32.NodeModel?);
|
||||
@override
|
||||
List<_i30.NodeModel> failoverNodesFor({required _i22.Coin? coin}) =>
|
||||
List<_i32.NodeModel> failoverNodesFor({required _i22.Coin? coin}) =>
|
||||
(super.noSuchMethod(
|
||||
Invocation.method(
|
||||
#failoverNodesFor,
|
||||
[],
|
||||
{#coin: coin},
|
||||
),
|
||||
returnValue: <_i30.NodeModel>[],
|
||||
) as List<_i30.NodeModel>);
|
||||
returnValue: <_i32.NodeModel>[],
|
||||
) as List<_i32.NodeModel>);
|
||||
@override
|
||||
_i23.Future<void> add(
|
||||
_i30.NodeModel? node,
|
||||
_i32.NodeModel? node,
|
||||
String? password,
|
||||
bool? shouldNotifyListeners,
|
||||
) =>
|
||||
|
@ -2095,7 +2189,7 @@ class MockNodeService extends _i1.Mock implements _i3.NodeService {
|
|||
) as _i23.Future<void>);
|
||||
@override
|
||||
_i23.Future<void> edit(
|
||||
_i30.NodeModel? editedNode,
|
||||
_i32.NodeModel? editedNode,
|
||||
String? password,
|
||||
bool? shouldNotifyListeners,
|
||||
) =>
|
||||
|
@ -2221,13 +2315,13 @@ class MockManager extends _i1.Mock implements _i6.Manager {
|
|||
returnValueForMissingStub: null,
|
||||
);
|
||||
@override
|
||||
_i23.Future<_i8.FeeObject> get fees => (super.noSuchMethod(
|
||||
_i23.Future<_i9.FeeObject> get fees => (super.noSuchMethod(
|
||||
Invocation.getter(#fees),
|
||||
returnValue: _i23.Future<_i8.FeeObject>.value(_FakeFeeObject_5(
|
||||
returnValue: _i23.Future<_i9.FeeObject>.value(_FakeFeeObject_6(
|
||||
this,
|
||||
Invocation.getter(#fees),
|
||||
)),
|
||||
) as _i23.Future<_i8.FeeObject>);
|
||||
) as _i23.Future<_i9.FeeObject>);
|
||||
@override
|
||||
_i23.Future<int> get maxFee => (super.noSuchMethod(
|
||||
Invocation.getter(#maxFee),
|
||||
|
@ -2239,13 +2333,13 @@ class MockManager extends _i1.Mock implements _i6.Manager {
|
|||
returnValue: _i23.Future<String>.value(''),
|
||||
) as _i23.Future<String>);
|
||||
@override
|
||||
_i11.Balance get balance => (super.noSuchMethod(
|
||||
_i12.Balance get balance => (super.noSuchMethod(
|
||||
Invocation.getter(#balance),
|
||||
returnValue: _FakeBalance_8(
|
||||
returnValue: _FakeBalance_9(
|
||||
this,
|
||||
Invocation.getter(#balance),
|
||||
),
|
||||
) as _i11.Balance);
|
||||
) as _i12.Balance);
|
||||
@override
|
||||
_i23.Future<List<_i17.Transaction>> get transactions => (super.noSuchMethod(
|
||||
Invocation.getter(#transactions),
|
||||
|
@ -2589,13 +2683,13 @@ class MockCoinServiceAPI extends _i1.Mock implements _i20.CoinServiceAPI {
|
|||
returnValueForMissingStub: null,
|
||||
);
|
||||
@override
|
||||
_i23.Future<_i8.FeeObject> get fees => (super.noSuchMethod(
|
||||
_i23.Future<_i9.FeeObject> get fees => (super.noSuchMethod(
|
||||
Invocation.getter(#fees),
|
||||
returnValue: _i23.Future<_i8.FeeObject>.value(_FakeFeeObject_5(
|
||||
returnValue: _i23.Future<_i9.FeeObject>.value(_FakeFeeObject_6(
|
||||
this,
|
||||
Invocation.getter(#fees),
|
||||
)),
|
||||
) as _i23.Future<_i8.FeeObject>);
|
||||
) as _i23.Future<_i9.FeeObject>);
|
||||
@override
|
||||
_i23.Future<int> get maxFee => (super.noSuchMethod(
|
||||
Invocation.getter(#maxFee),
|
||||
|
@ -2607,13 +2701,13 @@ class MockCoinServiceAPI extends _i1.Mock implements _i20.CoinServiceAPI {
|
|||
returnValue: _i23.Future<String>.value(''),
|
||||
) as _i23.Future<String>);
|
||||
@override
|
||||
_i11.Balance get balance => (super.noSuchMethod(
|
||||
_i12.Balance get balance => (super.noSuchMethod(
|
||||
Invocation.getter(#balance),
|
||||
returnValue: _FakeBalance_8(
|
||||
returnValue: _FakeBalance_9(
|
||||
this,
|
||||
Invocation.getter(#balance),
|
||||
),
|
||||
) as _i11.Balance);
|
||||
) as _i12.Balance);
|
||||
@override
|
||||
_i23.Future<List<_i17.Transaction>> get transactions => (super.noSuchMethod(
|
||||
Invocation.getter(#transactions),
|
||||
|
|
Loading…
Reference in a new issue