import 'package:flutter_test/flutter_test.dart';
import 'package:tdc114plus/src/core/network/api_error.dart';

void main() {
  test('ApiError parses common error payload', () {
    final error = ApiError.fromJson({
      'error': 'Unauthorized',
      'code': 'unauthorized',
      'details': {'reason': 'expired'},
    });

    expect(error.code, 'unauthorized');
    expect(error.details['reason'], 'expired');
  });
}
