mirror of
https://github.com/cypherstack/stack_wallet.git
synced 2024-11-16 17:27:39 +00:00
Merge branch 'widget-tests' of github.com:cypherstack/stack_wallet into widget-tests
This commit is contained in:
commit
777ca516bf
1 changed files with 11 additions and 9 deletions
|
@ -1,9 +1,9 @@
|
|||
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:mockito/annotations.dart';
|
||||
import 'package:mockito/mockito.dart' as mockito;
|
||||
import 'package:mockingjay/mockingjay.dart' as mockingjay;
|
||||
import 'package:stackwallet/providers/providers.dart';
|
||||
import 'package:stackwallet/services/coins/bitcoin/bitcoin_wallet.dart';
|
||||
import 'package:stackwallet/services/coins/coin_service.dart';
|
||||
|
@ -33,20 +33,22 @@ void main() {
|
|||
final wallets = MockWallets();
|
||||
final locale = MockLocaleService();
|
||||
final manager = Manager(wallet);
|
||||
final managerProvider = ChangeNotifierProvider((ref) => manager);
|
||||
|
||||
mockito.when(wallets.getManagerProvider("wallet id")).thenAnswer(
|
||||
(realInvocation) => ChangeNotifierProvider((ref) => manager));
|
||||
mockito
|
||||
.when(wallets.getManagerProvider("wallet id"))
|
||||
.thenAnswer((realInvocation) => managerProvider);
|
||||
mockito.when(locale.locale).thenAnswer((_) => "en_US");
|
||||
|
||||
mockito.when(wallets.getManagerProvider("wallet id")).thenAnswer(
|
||||
(realInvocation) => ChangeNotifierProvider((ref) => manager));
|
||||
mockito
|
||||
.when(wallets.getManagerProvider("wallet id"))
|
||||
.thenAnswer((realInvocation) => managerProvider);
|
||||
|
||||
final navigator = mockingjay.MockNavigator();
|
||||
mockingjay
|
||||
.when(() => navigator.pushNamed("/wallet", arguments: [
|
||||
Tuple2("wallet id", wallets.getManagerProvider("wallet id"))
|
||||
]))
|
||||
.thenAnswer((_) async => Object());
|
||||
.when(() => navigator.pushNamed("/wallet",
|
||||
arguments: Tuple2("wallet id", managerProvider)))
|
||||
.thenAnswer((_) async => {});
|
||||
|
||||
// mockingjay
|
||||
// .when(() => navigator.push(mockingjay.any(
|
||||
|
|
Loading…
Reference in a new issue