import 'package:flutter_test/flutter_test.dart';
import 'package:agenda_tasks/features/tasks/domain/enums/priority.dart';

void main() {
  group('Priority', () {
    group('values', () {
      test('should have three priority levels', () {
        expect(Priority.values.length, 3);
        expect(Priority.values, contains(Priority.low));
        expect(Priority.values, contains(Priority.medium));
        expect(Priority.values, contains(Priority.high));
      });
    });

    group('displayName', () {
      test('should return "Low" for Priority.low', () {
        expect(Priority.low.displayName, 'Low');
      });

      test('should return "Medium" for Priority.medium', () {
        expect(Priority.medium.displayName, 'Medium');
      });

      test('should return "High" for Priority.high', () {
        expect(Priority.high.displayName, 'High');
      });
    });

    group('fromString', () {
      test('should parse "low" to Priority.low', () {
        expect(Priority.fromString('low'), Priority.low);
      });

      test('should parse "medium" to Priority.medium', () {
        expect(Priority.fromString('medium'), Priority.medium);
      });

      test('should parse "high" to Priority.high', () {
        expect(Priority.fromString('high'), Priority.high);
      });

      test('should parse uppercase "LOW" to Priority.low', () {
        expect(Priority.fromString('LOW'), Priority.low);
      });

      test('should parse mixed case "Medium" to Priority.medium', () {
        expect(Priority.fromString('Medium'), Priority.medium);
      });

      test('should return Priority.medium for invalid string', () {
        expect(Priority.fromString('invalid'), Priority.medium);
      });

      test('should return Priority.medium for empty string', () {
        expect(Priority.fromString(''), Priority.medium);
      });
    });
  });
}
