aggiunto qr dati finanziamento
This commit is contained in:
1 parent
addb06a61a
commit
70db03066b
8 files changed
+1296
-8
No files matched your search
@@ -0,0 +1,56 @@
|
||||
import 'package:flutter_test/flutter_test.dart';
|
||||
import 'package:flux/features/operations/models/financing_translations.dart';
|
||||
|
||||
void main() {
|
||||
group('FinancingTranslations', () {
|
||||
test('contains all 9 requested languages', () {
|
||||
final supportedCodes = FinancingTranslations.supportedLanguages.map((l) => l.code).toSet();
|
||||
expect(
|
||||
supportedCodes,
|
||||
containsAll([
|
||||
'it',
|
||||
'en',
|
||||
'fr',
|
||||
'es',
|
||||
'ar',
|
||||
'uk',
|
||||
'ru',
|
||||
'mk',
|
||||
'sq',
|
||||
]),
|
||||
);
|
||||
expect(FinancingTranslations.supportedLanguages.length, 9);
|
||||
});
|
||||
|
||||
test('Arabic is marked as RTL', () {
|
||||
final ar = FinancingTranslations.supportedLanguages.firstWhere((l) => l.code == 'ar');
|
||||
expect(ar.isRtl, isTrue);
|
||||
|
||||
final it = FinancingTranslations.supportedLanguages.firstWhere((l) => l.code == 'it');
|
||||
expect(it.isRtl, isFalse);
|
||||
});
|
||||
|
||||
test('formatNoteText outputs canonical Italian labels regardless of language', () {
|
||||
final noteText = FinancingTranslations.formatNoteText(
|
||||
maritalStatusIndex: 0, // Celibe / Nubile
|
||||
occupation: 'Ingegnere Informatico',
|
||||
incomeRangeIndex: 1, // Da 2.000 € a 5.000 €
|
||||
languageName: 'العربية (Arabo)',
|
||||
);
|
||||
|
||||
expect(noteText, contains('[DATI FINANZIAMENTO]'));
|
||||
expect(noteText, contains('Stato civile: Celibe / Nubile'));
|
||||
expect(noteText, contains('Professione: Ingegnere Informatico'));
|
||||
expect(noteText, contains('Reddito mensile: Da 2.000 € a 5.000 €'));
|
||||
expect(noteText, contains('Lingua: العربية (Arabo)'));
|
||||
});
|
||||
|
||||
test('each language has exactly 5 marital status and 3 income range options', () {
|
||||
for (final lang in FinancingTranslations.supportedLanguages) {
|
||||
final strings = FinancingTranslations.getStrings(lang.code);
|
||||
expect(strings.maritalOptions.length, 5, reason: 'Language ${lang.code} should have 5 marital options');
|
||||
expect(strings.incomeOptions.length, 3, reason: 'Language ${lang.code} should have 3 income options');
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
Reference in new issue
Block a user