import 'package:flutter_test/flutter_test.dart';
import 'package:health_tracker/models/backup/export_options.dart';
import 'package:health_tracker/services/export_service.dart';
import 'package:health_tracker/utils/file_utils.dart';

void main() {
  group('CSV Export with Downloads Directory', () {
    test('ExportOptions includes location field', () {
      final options = ExportOptions.csvExport();
      
      expect(options.format, equals(ExportFormat.csv));
      expect(options.location, equals(ExportLocation.appDirectory));
    });
    
    test('ExportOptions can be copied with save dialog location', () {
      final initialOptions = ExportOptions.csvExport();
      final updatedOptions = initialOptions.copyWith(
        location: ExportLocation.saveDialog,
      );
      
      expect(updatedOptions.location, equals(ExportLocation.saveDialog));
      expect(updatedOptions.format, equals(ExportFormat.csv));
    });
    
    test('ExportLocation enum has correct values', () {
      expect(ExportLocation.values, contains(ExportLocation.appDirectory));
      expect(ExportLocation.values, contains(ExportLocation.saveDialog));
    });
    
    test('FileUtils has save dialog methods', () {
      // This test just verifies the methods exist and can be called
      // The actual functionality would require platform-specific testing
      expect(FileUtils.saveFileWithDialog, isA<Function>());
      expect(FileUtils.createCsvFileWithDialog, isA<Function>());
    });
  });
}
