import 'package:eatvio_app/core/utils/toasts.dart'; import 'package:flutter/services.dart'; import 'package:flutter_test/flutter_test.dart'; void main() { TestWidgetsFlutterBinding.ensureInitialized(); group('Toasts', () { test('showInfoToast is callable', () { // Note: This test verifies the function exists and can be called // Actual toast display requires Flutter context and cannot be easily tested expect(showInfoToast, isA()); }); test('showErrorToast is callable', () { expect(showErrorToast, isA()); }); test('showSuccessToast is callable', () { expect(showSuccessToast, isA()); }); test('showInternetConnectionToast is callable', () { expect(showInternetConnectionToast, isA()); }); testWidgets('showInfoToast accepts string parameter', (tester) async { // Verify function signature - MissingPluginException is expected in tests // Fluttertoast.showToast is async, so we need to handle it properly try { showInfoToast('Test message'); // Wait a bit for async operations await tester.pump(); } catch (e) { // MissingPluginException is expected in test environment expect(e, isA()); } }); testWidgets('showErrorToast accepts string parameter', (tester) async { try { showErrorToast('Test error'); await tester.pump(); } catch (e) { expect(e, isA()); } }); testWidgets('showSuccessToast accepts string parameter', (tester) async { try { showSuccessToast('Test success'); await tester.pump(); } catch (e) { expect(e, isA()); } }); testWidgets('showInternetConnectionToast has no parameters', (tester) async { try { showInternetConnectionToast(); await tester.pump(); } catch (e) { expect(e, isA()); } }); }); }