// This is a basic Flutter widget test.
//
// To perform an interaction with a widget in your test, use the WidgetTester
// utility in the flutter_test package. For example, you can send tap and scroll
// gestures. You can also use WidgetTester to find child widgets in the widget
// tree, read text, and verify that the values of widget properties are correct.

import 'package:flutter/material.dart';
import 'package:flutter_test/flutter_test.dart';
import 'package:provider/provider.dart';

import 'package:aesthetica_wallpaper/providers/editor_provider.dart';
import 'package:aesthetica_wallpaper/providers/recipe_provider.dart';
import 'package:aesthetica_wallpaper/providers/weather_provider.dart';
import 'package:aesthetica_wallpaper/providers/puzzle_provider.dart';
import 'package:aesthetica_wallpaper/core/app.dart';

void main() {
  testWidgets('App loads without crashing', (WidgetTester tester) async {
    // Build our app and trigger a frame.
    await tester.pumpWidget(
      MultiProvider(
        providers: [
          ChangeNotifierProvider(create: (_) => EditorProvider()),
          ChangeNotifierProvider(create: (_) => RecipeProvider()),
          ChangeNotifierProvider(create: (_) => WeatherProvider()),
          ChangeNotifierProvider(create: (_) => PuzzleProvider()),
        ],
        child: AestheticaApp(analyObserver: NavigatorObserver()),
      ),
    );

    // Verify that the app loads
    expect(find.text('Aesthetica'), findsOneWidget);
  });
}
