26 lines
713 B
Dart
26 lines
713 B
Dart
// Smoke test — 验证核心 widget 可正常构建
|
|
//
|
|
// NuanjiApp 依赖 Isar 原生库,无法在单元测试中直接 pump。
|
|
// 此测试验证 MaterialApp + 主题配置正常,不依赖数据库。
|
|
|
|
import 'package:flutter/material.dart';
|
|
import 'package:flutter_test/flutter_test.dart';
|
|
|
|
import 'package:nuanji_app/core/theme/app_theme.dart';
|
|
|
|
void main() {
|
|
testWidgets('App smoke test — 主题与 MaterialApp 正常构建', (
|
|
WidgetTester tester,
|
|
) async {
|
|
await tester.pumpWidget(
|
|
MaterialApp(
|
|
theme: AppTheme.light(),
|
|
home: const Scaffold(body: Text('暖记')),
|
|
),
|
|
);
|
|
|
|
// 验证文本渲染
|
|
expect(find.text('暖记'), findsOneWidget);
|
|
});
|
|
}
|