import 'package:flutter/material.dart'; import 'package:flutter_test/flutter_test.dart'; import 'package:health_app/widgets/ai_content.dart'; void main() { testWidgets('AI generated note shows text without an icon', (tester) async { await tester.pumpWidget( const MaterialApp(home: Scaffold(body: AiGeneratedNote())), ); expect(find.text('内容由 AI 生成'), findsOneWidget); expect( find.descendant( of: find.byType(AiGeneratedNote), matching: find.byType(Icon), ), findsNothing, ); }); }