import 'package:flutter/cupertino.dart';
import 'package:flutter_test/flutter_test.dart';
import 'package:flutter_riverpod/flutter_riverpod.dart';

import 'package:webrtc_controller_flutter/app/app.dart';
import 'package:webrtc_controller_flutter/features/auth/presentation/pages/splash_page.dart';

void main() {
  testWidgets('App builds and shows splash page', (WidgetTester tester) async {
    await tester.pumpWidget(
      const ProviderScope(child: WebrtcControllerApp()),
    );
    await tester.pump();

    // 初始路由为 /splash：启动页负责恢复并校验登录态。
    expect(find.byType(SplashPage), findsOneWidget);
    expect(find.byType(CupertinoPageScaffold), findsOneWidget);
    expect(find.byType(CupertinoActivityIndicator), findsOneWidget);
  });
}
