style(app): остальные экраны под новый визуальный язык и форматирование

Доходы, ребалансировка, налоги, импорт, цели, здоровье данных, правила, транзакции, категории, cashflow, pending: новые виджеты и токены темы, dart format. Тесты подстроены под новые модели.
This commit is contained in:
Dmitry
2026-09-19 22:14:27 +03:00
parent 62d36aa3e8
commit 322c60a359
55 changed files with 2158 additions and 1080 deletions
+31 -11
View File
@@ -28,6 +28,7 @@ EventOut event({
kind: kind,
price: '100',
priceCurrency: currency,
source_: 'tinvest',
quantity: quantity,
status: status,
tax: null,
@@ -38,13 +39,15 @@ EventOut event({
}
Widget wrap(EventOut e) => MaterialApp(
home: Scaffold(
body: EventRow(event: e, accountName: 'T-Invest ИИС', onTap: () {}),
),
);
home: Scaffold(
body: EventRow(event: e, accountName: 'T-Invest ИИС', onTap: () {}),
),
);
void main() {
testWidgets('shows kind, ticker, account and the native amount', (tester) async {
testWidgets('shows kind, ticker, account and the native amount', (
tester,
) async {
await tester.pumpWidget(wrap(event()));
expect(find.text('Покупка · SBER'), findsOneWidget);
@@ -53,15 +56,23 @@ void main() {
expect(find.text(MoneyText.format('-10000', 'RUB')), findsOneWidget);
});
testWidgets('adds the RUB equivalent only for a foreign currency', (tester) async {
await tester.pumpWidget(wrap(event(currency: 'USD', amount: '-100', amountRub: '-9500')));
testWidgets('adds the RUB equivalent only for a foreign currency', (
tester,
) async {
await tester.pumpWidget(
wrap(event(currency: 'USD', amount: '-100', amountRub: '-9500')),
);
expect(find.text(MoneyText.format('-100', 'USD')), findsOneWidget);
expect(find.text(MoneyText.format('-9500', 'RUB')), findsOneWidget);
});
testWidgets('leaves the RUB line out when no rate was available', (tester) async {
await tester.pumpWidget(wrap(event(currency: 'USD', amount: '-100', amountRub: null)));
testWidgets('leaves the RUB line out when no rate was available', (
tester,
) async {
await tester.pumpWidget(
wrap(event(currency: 'USD', amount: '-100', amountRub: null)),
);
expect(find.text(MoneyText.format('-100', 'USD')), findsOneWidget);
expect(find.textContaining(''), findsNothing);
@@ -73,9 +84,18 @@ void main() {
expect(find.textContaining('Ожидает'), findsOneWidget);
});
testWidgets('drops the separator for an event with no instrument', (tester) async {
testWidgets('drops the separator for an event with no instrument', (
tester,
) async {
await tester.pumpWidget(
wrap(event(kind: EventKind.deposit, ticker: null, quantity: null, externalFlow: true)),
wrap(
event(
kind: EventKind.deposit,
ticker: null,
quantity: null,
externalFlow: true,
),
),
);
expect(find.text('Пополнение'), findsOneWidget);