diff --git a/lib/core/router/app_shell.dart b/lib/core/router/app_shell.dart index 82701d1..b8ea1b8 100644 --- a/lib/core/router/app_shell.dart +++ b/lib/core/router/app_shell.dart @@ -9,6 +9,7 @@ import 'package:lazurite/core/crash_reporting/crash_reporting_consent_gate.dart' import 'package:lazurite/core/crash_reporting/crash_reporting_service.dart'; import 'package:lazurite/core/l10n/app_localizations.dart'; import 'package:lazurite/core/l10n/l10n.dart'; +import 'package:lazurite/core/logging/app_logger.dart'; import 'package:lazurite/core/theme/animation_tokens.dart'; import 'package:lazurite/core/theme/animation_utils.dart'; import 'package:lazurite/core/theme/theme_extensions.dart'; @@ -100,7 +101,8 @@ class _AppShellState extends State { CrashReportingService? crashReportingService; try { crashReportingService = context.read(); - } catch (_) { + } catch (error, stackTrace) { + log.d('showing app shell without crash reporting consent gate', error: error, stackTrace: stackTrace); crashReportingService = null; } return AppShellScope( @@ -133,7 +135,7 @@ class _AppShellState extends State { onDestinationSelected: (index) { widget.navigationShell.goBranch(index, initialLocation: index == widget.navigationShell.currentIndex); }, - labelBehavior: NavigationDestinationLabelBehavior.alwaysShow, + labelBehavior: NavigationDestinationLabelBehavior.alwaysHide, destinations: _destinations(l10n), ), ), diff --git a/test/core/router/app_router_test.dart b/test/core/router/app_router_test.dart index e83fae0..2e156ac 100644 --- a/test/core/router/app_router_test.dart +++ b/test/core/router/app_router_test.dart @@ -249,6 +249,11 @@ void main() { Widget buildSubject() => buildSubjectWithRouter(AppRouter(authBloc: authBloc).router); + Future tapProfileBottomTab(WidgetTester tester) async { + await tester.tap(find.byIcon(Icons.person_outline).last); + await tester.pumpAndSettle(); + } + testWidgets('opens the side menu and switches authenticated branches', (tester) async { await tester.binding.setSurfaceSize(const Size(430, 932)); addTearDown(() => tester.binding.setSurfaceSize(null)); @@ -281,7 +286,7 @@ void main() { expect(find.text('APPEARANCE'), findsOneWidget); }); - testWidgets('bottom navigation bar shows 4 tabs with uppercase labels', (tester) async { + testWidgets('bottom navigation bar shows 4 tabs with hidden labels', (tester) async { await tester.binding.setSurfaceSize(const Size(430, 932)); addTearDown(() => tester.binding.setSurfaceSize(null)); @@ -290,6 +295,7 @@ void main() { final navBar = tester.widget(find.byType(NavigationBar)); expect(navBar.destinations.length, 4); + expect(navBar.labelBehavior, NavigationDestinationLabelBehavior.alwaysHide); final destinations = navBar.destinations.cast(); expect(destinations.map((d) => d.label), containsAll(['HOME', 'SEARCH', 'ALERTS', 'PROFILE'])); @@ -338,8 +344,7 @@ void main() { await tester.pumpWidget(buildSubject()); await tester.pumpAndSettle(); - await tester.tap(find.text('PROFILE').last); - await tester.pumpAndSettle(); + await tapProfileBottomTab(tester); await tester.tap(find.byKey(const Key('profile_search_posts_button'))); await tester.pumpAndSettle(); @@ -390,8 +395,7 @@ void main() { await tester.pumpWidget(buildSubject()); await tester.pumpAndSettle(); - await tester.tap(find.text('PROFILE')); - await tester.pumpAndSettle(); + await tapProfileBottomTab(tester); expect(find.text('RIVER TAM'), findsOneWidget); @@ -462,8 +466,7 @@ void main() { final navBar = tester.widget(find.byType(NavigationBar)); expect(navBar.selectedIndex, 0); - await tester.tap(find.text('PROFILE')); - await tester.pumpAndSettle(); + await tapProfileBottomTab(tester); final navBarAfter = tester.widget(find.byType(NavigationBar)); expect(navBarAfter.selectedIndex, 3); @@ -650,8 +653,7 @@ void main() { await tester.pumpWidget(buildSubjectWithRouter(router)); await tester.pumpAndSettle(); - await tester.tap(find.text('PROFILE')); - await tester.pumpAndSettle(); + await tapProfileBottomTab(tester); expect(find.text('RIVER TAM'), findsOneWidget); await tester.tap(find.byIcon(Icons.settings_outlined));