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
9a86a6fe9e
commit
f7a49c8f8a
3 changed files with 18 additions and 14 deletions
|
@ -98,6 +98,9 @@ void main() {
|
|||
|
||||
test("transactions", () async {
|
||||
final CoinServiceAPI wallet = MockFiroWallet();
|
||||
|
||||
when(wallet.coin).thenAnswer((realInvocation) => Coin.firo);
|
||||
|
||||
final tx = Transaction(
|
||||
walletId: "walletId",
|
||||
txid: "txid",
|
||||
|
|
|
@ -29,6 +29,8 @@ import 'table_view_row_test.mocks.dart';
|
|||
])
|
||||
void main() {
|
||||
testWidgets('Test table view row', (widgetTester) async {
|
||||
widgetTester.binding.window.physicalSizeTestValue = const Size(2500, 1800);
|
||||
|
||||
final mockWallet = MockWallets();
|
||||
final CoinServiceAPI wallet = MockBitcoinWallet();
|
||||
when(wallet.coin).thenAnswer((_) => Coin.bitcoin);
|
||||
|
@ -56,8 +58,6 @@ void main() {
|
|||
when(mockWallet.getManagerProvider("wallet id 2")).thenAnswer(
|
||||
(realInvocation) => ChangeNotifierProvider((ref) => manager));
|
||||
|
||||
final walletIds = mockWallet.getWalletIdsFor(coin: Coin.bitcoin);
|
||||
|
||||
await widgetTester.pumpWidget(
|
||||
ProviderScope(
|
||||
overrides: [
|
||||
|
@ -73,13 +73,14 @@ void main() {
|
|||
),
|
||||
home: Material(
|
||||
child: TableViewRow(
|
||||
cells: [
|
||||
for (int j = 1; j <= 5; j++)
|
||||
TableViewCell(flex: 16, child: Text("Some Text ${j}"))
|
||||
],
|
||||
expandingChild: const CoinWalletsTable(
|
||||
coin: Coin.bitcoin,
|
||||
)),
|
||||
cells: [
|
||||
for (int j = 1; j <= 5; j++)
|
||||
TableViewCell(flex: 16, child: Text("Some ${j}"))
|
||||
],
|
||||
expandingChild: const CoinWalletsTable(
|
||||
coin: Coin.bitcoin,
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
|
@ -87,7 +88,7 @@ void main() {
|
|||
|
||||
await widgetTester.pumpAndSettle();
|
||||
|
||||
expect(find.text("Some Text 1"), findsOneWidget);
|
||||
expect(find.text("Some 1"), findsOneWidget);
|
||||
expect(find.byType(TableViewRow), findsWidgets);
|
||||
expect(find.byType(TableViewCell), findsWidgets);
|
||||
expect(find.byType(CoinWalletsTable), findsWidgets);
|
||||
|
|
|
@ -138,7 +138,7 @@ void main() {
|
|||
|
||||
verify(mockPrefs.currency).called(1);
|
||||
verify(mockPriceService.getPrice(Coin.firo)).called(1);
|
||||
verify(wallet.coin.ticker).called(2);
|
||||
verify(wallet.coin.ticker).called(1);
|
||||
|
||||
verify(mockLocaleService.locale).called(1);
|
||||
|
||||
|
@ -241,7 +241,7 @@ void main() {
|
|||
|
||||
verify(mockPrefs.currency).called(1);
|
||||
verify(mockPriceService.getPrice(Coin.firo)).called(1);
|
||||
verify(wallet.coin.ticker).called(2);
|
||||
verify(wallet.coin.ticker).called(1);
|
||||
|
||||
verify(mockLocaleService.locale).called(1);
|
||||
|
||||
|
@ -337,7 +337,7 @@ void main() {
|
|||
|
||||
verify(mockPrefs.currency).called(1);
|
||||
verify(mockPriceService.getPrice(Coin.firo)).called(1);
|
||||
verify(wallet.coin.ticker).called(2);
|
||||
verify(wallet.coin.ticker).called(1);
|
||||
|
||||
verify(mockLocaleService.locale).called(1);
|
||||
|
||||
|
@ -434,7 +434,7 @@ void main() {
|
|||
|
||||
verify(mockPrefs.currency).called(2);
|
||||
verify(mockLocaleService.locale).called(4);
|
||||
verify(wallet.coin.ticker).called(2);
|
||||
verify(wallet.coin.ticker).called(1);
|
||||
verify(wallet.storedChainHeight).called(2);
|
||||
|
||||
verifyNoMoreInteractions(wallet);
|
||||
|
|
Loading…
Reference in a new issue