feat(prescription): add intelligent medical toolbar with numbering, dosage shortcuts and quick chips

This commit is contained in:
=
2026-09-22 08:38:19 -04:00
parent dc39eab3ae
commit 1152168ea6
2 changed files with 383 additions and 41 deletions
+47
View File
@@ -101,6 +101,53 @@ void main() {
expect(find.text('• '), findsOneWidget);
});
testWidgets('inserts sequential numbers and sub-indication dosis', (tester) async {
final configStore = ConfigStore();
await tester.pumpWidget(
MaterialApp(
home: Scaffold(
body: PrescriptionModalView(
patientName: 'CARLOS ARIAS',
configStore: configStore,
),
),
),
);
await tester.pumpAndSettle();
final numberBtn = find.text('1. Número');
expect(numberBtn, findsOneWidget);
await tester.tap(numberBtn);
await tester.pump();
expect(find.text('1. '), findsOneWidget);
// Tap again to get next sequential number
await tester.tap(numberBtn);
await tester.pump();
expect(find.text('1. \n2. '), findsOneWidget);
// Insert dosage sub-indication
final subIndicationBtn = find.text('↳ Dosis');
expect(subIndicationBtn, findsOneWidget);
await tester.tap(subIndicationBtn);
await tester.pump();
expect(find.text('1. \n2. \n - '), findsOneWidget);
// Tap quick dosage chip
final chip = find.text('1 tableta');
expect(chip, findsOneWidget);
await tester.tap(chip);
await tester.pump();
expect(find.text('1. \n2. \n - 1 tableta'), findsOneWidget);
// Test clear button
final clearBtn = find.text('Limpiar lienzo');
expect(clearBtn, findsOneWidget);
await tester.tap(clearBtn);
await tester.pump();
expect(find.text('Limpiar lienzo'), findsNothing);
});
});
group('PrescriptionPdfService Tests', () {