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
+34 -25
View File
@@ -145,36 +145,45 @@ void main() {
final json = Map<String, dynamic>.from(_previewJson)..['account_id'] = null;
expect(ImportPreview.fromJson(json).canCommit, isFalse);
final failed = Map<String, dynamic>.from(_previewJson)..['parse_status'] = 'failed';
final failed = Map<String, dynamic>.from(_previewJson)
..['parse_status'] = 'failed';
expect(ImportPreview.fromJson(failed).canCommit, isFalse);
expect(ImportPreview.fromJson(failed).canDelete, isTrue);
final committed = Map<String, dynamic>.from(_previewJson)..['parse_status'] = 'committed';
final committed = Map<String, dynamic>.from(_previewJson)
..['parse_status'] = 'committed';
expect(ImportPreview.fromJson(committed).canDelete, isFalse);
});
test('parses PendingResolveResult and builds the create body as plain strings', () {
final r = PendingResolveResult.fromJson(const {
'id': 4,
'status': 'resolved',
'instrument_id': 88,
'events_bound': 3,
'alias_created': true,
'metrics_refreshed': true,
});
expect(r.eventsBound, 3);
expect(r.instrumentId, 88);
test(
'parses PendingResolveResult and builds the create body as plain strings',
() {
final r = PendingResolveResult.fromJson(const {
'id': 4,
'status': 'resolved',
'instrument_id': 88,
'events_bound': 3,
'alias_created': true,
'metrics_refreshed': true,
});
expect(r.eventsBound, 3);
expect(r.instrumentId, 88);
final body = const NewInstrument(
assetClass: 'index',
name: 'Индекс МосБиржи',
currency: 'RUB',
isin: '',
ticker: 'IMOEX',
lot: 1,
).toJson();
expect(body['asset_class'], 'index');
expect(body.containsKey('isin'), isFalse, reason: 'empty optionals are omitted');
expect(body['ticker'], 'IMOEX');
});
final body = const NewInstrument(
assetClass: 'index',
name: 'Индекс МосБиржи',
currency: 'RUB',
isin: '',
ticker: 'IMOEX',
lot: 1,
).toJson();
expect(body['asset_class'], 'index');
expect(
body.containsKey('isin'),
isFalse,
reason: 'empty optionals are omitted',
);
expect(body['ticker'], 'IMOEX');
},
);
}