import 'package:flutter_test/flutter_test.dart';
import 'package:health_app/pages/medication/medication_checkin_page.dart';

void main() {
  test('same-name medications remain separate check-in groups', () {
    final groups = groupMedicationReminders([
      {
        'id': 'med-a',
        'name': '阿司匹林',
        'dosage': '100 mg',
        'scheduledTime': '08:00',
        'status': 'taken',
      },
      {
        'id': 'med-b',
        'name': '阿司匹林',
        'dosage': '50 mg',
        'scheduledTime': '08:00',
        'status': 'upcoming',
      },
    ]);

    expect(groups.keys, containsAll(['med-a', 'med-b']));
    expect(groups['med-a']!.single['status'], 'taken');
    expect(groups['med-b']!.single['status'], 'upcoming');
  });
}
