import 'package:flutter/material.dart';
import 'package:flutter_test/flutter_test.dart';
import 'package:mocktail/mocktail.dart';
import 'package:rasadyar_chicken/data/common/dio_error_handler.dart';
import 'package:rasadyar_core/core.dart';

class MockGet extends Mock implements GetInterface {}

void main() {
  late DioErrorHandler errorHandler;
  late MockGet mockGet;

  setUp(() {
    errorHandler = DioErrorHandler();
    mockGet = MockGet();
    Get.testMode = true;
    Get.put<GetInterface>(mockGet);
  });

  /*test('handle 410 Error', () {
    final error = DioException(
      response: Response(statusCode: 410, requestOptions: RequestOptions(path: "/")),
      requestOptions: RequestOptions(path: "/"),
    );

    errorHandler.handle(error);

    verify(
      () => mockGet.showSnackbar(
        any(
          that: isA<GetSnackBar>().having(
            (s) => (s.messageText as Text).data,
            'messageText',
            'نام کاربری یا رمز عبور اشتباه است',
          ),
        ),
      ),
    ).called(1);
  });*/
}
