feat(prescription): expand canvas to fill bottom space and add cursor-aware newline on bullet insertion
This commit is contained in:
@@ -79,7 +79,7 @@ void main() {
|
||||
expect(find.text('ESC para salir'), findsOneWidget);
|
||||
});
|
||||
|
||||
testWidgets('inserts bullet when clicking viñeta button', (tester) async {
|
||||
testWidgets('inserts bullet when clicking viñeta button and jumps to new line if text has content', (tester) async {
|
||||
final configStore = ConfigStore();
|
||||
await tester.pumpWidget(
|
||||
MaterialApp(
|
||||
@@ -100,6 +100,18 @@ void main() {
|
||||
await tester.pump();
|
||||
|
||||
expect(find.text('• '), findsOneWidget);
|
||||
|
||||
// Now enter text at end of line and test auto-newline
|
||||
final prescriptionField = find.byWidgetPredicate(
|
||||
(w) => w is TextField && (w.decoration?.hintText?.contains('Ciprofloxacina') ?? false),
|
||||
);
|
||||
await tester.enterText(prescriptionField, '1. Ciprofloxacina 500mg');
|
||||
await tester.pump();
|
||||
|
||||
await tester.tap(bulletBtn);
|
||||
await tester.pump();
|
||||
|
||||
expect(find.text('1. Ciprofloxacina 500mg\n• '), findsOneWidget);
|
||||
});
|
||||
|
||||
testWidgets('inserts sequential numbers and sub-indication dosis', (tester) async {
|
||||
|
||||
Reference in New Issue
Block a user