Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions assets/languages/strings_de.arb
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
"buyPaymentInformationDescription": "Bitte überweisen Sie den Kaufbetrag mit diesen Angaben über Ihre Bankanwendung. Der Verwendungszweck ist wichtig!",
"buyRealUnit": "RealUnit kaufen",
"buyRealu": "RealUnit Token kaufen",
"buyRecurringPaymentHint": "Tipp: Richten Sie mit diesen Angaben einen wiederkehrenden Dauerauftrag bei Ihrer Bank ein, um regelmässig zu investieren. Sie können auch mehrere Sparpläne parallel mit unterschiedlichen Beträgen oder Intervallen anlegen.",
"cancel": "Abbrechen",
"changeAddress": "Adresse ändern",
"changeInReview": "Änderung in Prüfung",
Expand Down
1 change: 1 addition & 0 deletions assets/languages/strings_en.arb
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
"buyPaymentInformationDescription": "Please transfer the purchase amount using your banking app with these details. The purpose of payment is important!",
"buyRealUnit": "Buy RealUnit",
"buyRealu": "Buy RealUnit Token",
"buyRecurringPaymentHint": "Tip: set up a recurring bank standing order with these details to invest regularly. You can also create several plans in parallel with different amounts or intervals.",
"cancel": "Cancel",
"changeAddress": "Change address",
"changeInReview": "Change in review",
Expand Down
16 changes: 16 additions & 0 deletions lib/screens/buy/widgets/payment_information_details.dart
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,22 @@ class PaymentInformationDetailsView extends StatelessWidget {
),
],
),
Row(
spacing: 12,
children: [
const Icon(
Icons.autorenew,
size: 24,
color: RealUnitColors.realUnitBlue,
),
Expanded(
child: Text(
S.of(context).buyRecurringPaymentHint,
style: Theme.of(context).textTheme.bodyMedium,
),
),
],
),
],
),
Column(
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified test/goldens/screens/home/goldens/macos/home_page_loaded.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
68 changes: 68 additions & 0 deletions test/screens/buy/widgets/payment_information_details_test.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
import 'package:bloc_test/bloc_test.dart';
import 'package:flutter/material.dart';
import 'package:flutter_bloc/flutter_bloc.dart';
import 'package:flutter_test/flutter_test.dart';
import 'package:mocktail/mocktail.dart';
import 'package:realunit_wallet/generated/i18n.dart';
import 'package:realunit_wallet/packages/service/dfx/models/payment/buy/buy_payment_info.dart';
import 'package:realunit_wallet/screens/buy/cubits/buy_confirm/buy_confirm_cubit.dart';
import 'package:realunit_wallet/screens/buy/widgets/payment_information_details.dart';
import 'package:realunit_wallet/styles/colors.dart';
import 'package:realunit_wallet/styles/currency.dart';

import '../../../helper/helper.dart';

class _MockBuyConfirmCubit extends MockCubit<BuyConfirmState> implements BuyConfirmCubit {}

void main() {
late _MockBuyConfirmCubit confirmCubit;

const buyPaymentInfo = BuyPaymentInfo(
id: 1,
iban: 'CH00 0000 0000 0000 0000 0',
bic: 'BICCBIC',
name: 'RealUnit AG',
street: 'Bahnhofstrasse',
number: '1',
zip: '8001',
city: 'Zurich',
country: 'Switzerland',
currency: Currency.chf,
);

setUp(() {
confirmCubit = _MockBuyConfirmCubit();
when(() => confirmCubit.state).thenReturn(const BuyConfirmInitial());
});

Widget buildSubject() => BlocProvider<BuyConfirmCubit>.value(
value: confirmCubit,
child: const Scaffold(
body: SingleChildScrollView(
child: PaymentInformationDetailsView(
buyPaymentInfo: buyPaymentInfo,
amount: '100',
),
),
),
);

group('$PaymentInformationDetailsView recurring/multiple-plans hint', () {
testWidgets('renders the recurring savings-plan hint text', (tester) async {
await tester.pumpApp(buildSubject());

expect(
find.text(S.current.buyRecurringPaymentHint),
findsOneWidget,
);
});

testWidgets('renders the autorenew icon in RealUnit blue for the hint', (tester) async {
await tester.pumpApp(buildSubject());

final icon = tester.widget<Icon>(find.byIcon(Icons.autorenew));
expect(icon.color, RealUnitColors.realUnitBlue);
expect(icon.size, 24);
});
});
}
Loading