- AppDatabase with schemaVersion 1, in-memory executor for testing - Database provider with @Riverpod(keepAlive: true) - AppTheme with sage green seed ColorScheme and warm surface overrides - ThemeNotifier with SharedPreferences persistence, defaults to system - Full German ARB localization (15 keys) with proper umlauts - Minimal main.dart with ProviderScope placeholder - Drift schema v1 captured via make-migrations - All .g.dart files generated via build_runner - Wave 0 tests: database (3), color scheme (6), theme (3), localization (2) -- 14 total, all passing Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
32 lines
742 B
Dart
32 lines
742 B
Dart
import 'package:drift/native.dart';
|
|
import 'package:flutter_test/flutter_test.dart';
|
|
import 'package:household_keeper/core/database/database.dart';
|
|
|
|
void main() {
|
|
group('AppDatabase', () {
|
|
late AppDatabase db;
|
|
|
|
setUp(() {
|
|
db = AppDatabase(NativeDatabase.memory());
|
|
});
|
|
|
|
tearDown(() async {
|
|
await db.close();
|
|
});
|
|
|
|
test('opens successfully with in-memory executor', () {
|
|
expect(db, isNotNull);
|
|
});
|
|
|
|
test('has schemaVersion 1', () {
|
|
expect(db.schemaVersion, equals(1));
|
|
});
|
|
|
|
test('can be closed without error', () async {
|
|
await db.close();
|
|
// If we reach here, close succeeded. Re-create for tearDown.
|
|
db = AppDatabase(NativeDatabase.memory());
|
|
});
|
|
});
|
|
}
|