test: fix gamma default + localized home
Some checks failed
CI / Windows build (push) Has been cancelled

Two tests asserted pre-refactor behavior:
- pen_config_test expected the old pressureGamma default of 1.0; it is
  now the natural curve (the pen-feel feature). Also assert the new
  eraser defaults.
- widget_test pumped HomeScreen without localization delegates, which
  the now-localized app bar requires. Provide the delegates.

Full suite: 258/258 pass.
This commit is contained in:
2026-06-23 09:51:10 +08:00
parent 4fb431727e
commit 2c9f6037f7
2 changed files with 16 additions and 2 deletions

View File

@@ -3,6 +3,7 @@ import 'package:flutter_riverpod/flutter_riverpod.dart';
import 'package:flutter_test/flutter_test.dart';
import 'package:shared_preferences/shared_preferences.dart';
import 'package:badnote/l10n/app_localizations.dart';
import 'package:badnote/screens/home_screen.dart';
void main() {
@@ -17,7 +18,14 @@ void main() {
SharedPreferences.setMockInitialValues({});
await tester.pumpWidget(
const ProviderScope(child: MaterialApp(home: HomeScreen())),
ProviderScope(
child: MaterialApp(
// The screen is now localized; provide the delegates it depends on.
localizationsDelegates: AppLocalizations.localizationsDelegates,
supportedLocales: AppLocalizations.supportedLocales,
home: const HomeScreen(),
),
),
);
await tester.pump();