Public name is now Tane (種, "seed"); Tanemaki (種まき, "to scatter seeds") is kept only as etymology in the About screen and onboarding. App not yet distributed, so format tokens rename cleanly with no migration: backup extension .tanemaki→.tane, QR scheme tanemaki://→tane://, file prefixes tane-*. Website link and species-catalog User-Agent → tane.comunes.org. Android label capitalised to "Tane". Identity/crypto constants already use org.comunes.tane (derivation, HKDF backup, sync namespace, TANE1 recovery tag) — left untouched, so keys, backups and sync are unaffected. Tests updated; analyze + full suite green.
102 lines
3.3 KiB
Dart
102 lines
3.3 KiB
Dart
import 'package:flutter/material.dart';
|
|
import 'package:flutter_test/flutter_test.dart';
|
|
import 'package:package_info_plus/package_info_plus.dart';
|
|
import 'package:tane/app.dart';
|
|
import 'package:tane/i18n/strings.g.dart';
|
|
|
|
import '../support/test_support.dart';
|
|
|
|
void main() {
|
|
Widget app(db) => TranslationProvider(
|
|
child: TaneApp(
|
|
repository: newTestRepository(db),
|
|
species: newTestSpeciesRepository(db),
|
|
onboarding: newTestOnboardingStore(),
|
|
),
|
|
);
|
|
|
|
setUp(() {
|
|
PackageInfo.setMockInitialValues(
|
|
appName: 'Tane',
|
|
packageName: 'org.comunes.tane',
|
|
version: '0.1.0',
|
|
buildNumber: '1',
|
|
buildSignature: '',
|
|
);
|
|
});
|
|
|
|
testWidgets('drawer About item opens the About screen', (tester) async {
|
|
LocaleSettings.setLocaleSync(AppLocale.en);
|
|
final db = newTestDatabase();
|
|
addTearDown(db.close);
|
|
|
|
await tester.pumpWidget(app(db));
|
|
await tester.pumpAndSettle();
|
|
|
|
await tester.tap(find.byIcon(Icons.menu));
|
|
await tester.pumpAndSettle();
|
|
await tester.tap(find.text('About')); // drawer entry
|
|
await tester.pumpAndSettle();
|
|
|
|
expect(find.text('種'), findsOneWidget);
|
|
expect(find.textContaining('digital Plantare'), findsOneWidget);
|
|
await disposeTree(tester);
|
|
});
|
|
|
|
testWidgets('Settings About tile opens the About screen', (tester) async {
|
|
LocaleSettings.setLocaleSync(AppLocale.en);
|
|
final db = newTestDatabase();
|
|
addTearDown(db.close);
|
|
|
|
await tester.pumpWidget(app(db));
|
|
await tester.pumpAndSettle();
|
|
|
|
await tester.tap(find.byIcon(Icons.menu));
|
|
await tester.pumpAndSettle();
|
|
await tester.tap(find.text('Settings'));
|
|
await tester.pumpAndSettle();
|
|
|
|
// The backup section pushed the About tile below the fold.
|
|
await tester.scrollUntilVisible(find.text('About Tane'), 200);
|
|
await tester.tap(find.text('About Tane'));
|
|
await tester.pumpAndSettle();
|
|
|
|
// Explanation text and kanji are shown above the fold.
|
|
expect(find.text('種'), findsOneWidget);
|
|
expect(find.textContaining('helps people and collectives'), findsOneWidget);
|
|
expect(find.textContaining('digital Plantare'), findsOneWidget);
|
|
|
|
// License and version live below the fold; scroll them into view.
|
|
await tester.scrollUntilVisible(find.text('AGPL-3.0'), 200);
|
|
expect(find.text('AGPL-3.0'), findsOneWidget);
|
|
expect(find.text('0.1.0 (1)'), findsOneWidget);
|
|
await disposeTree(tester);
|
|
});
|
|
|
|
testWidgets('About screen opens the open-source licenses page', (
|
|
tester,
|
|
) async {
|
|
LocaleSettings.setLocaleSync(AppLocale.en);
|
|
final db = newTestDatabase();
|
|
addTearDown(db.close);
|
|
|
|
await tester.pumpWidget(app(db));
|
|
await tester.pumpAndSettle();
|
|
|
|
await tester.tap(find.byIcon(Icons.menu));
|
|
await tester.pumpAndSettle();
|
|
await tester.tap(find.text('Settings'));
|
|
await tester.pumpAndSettle();
|
|
await tester.scrollUntilVisible(find.text('About Tane'), 200);
|
|
await tester.tap(find.text('About Tane'));
|
|
await tester.pumpAndSettle();
|
|
|
|
await tester.scrollUntilVisible(find.text('Open-source licenses'), 200);
|
|
await tester.tap(find.text('Open-source licenses'));
|
|
await tester.pumpAndSettle();
|
|
|
|
// Flutter's built-in LicensePage renders the app name.
|
|
expect(find.byType(LicensePage), findsOneWidget);
|
|
await disposeTree(tester);
|
|
});
|
|
}
|