Files
buzz/mobile/test/features/settings/builderlab_account_row_test.dart
klopez4212 cb69ad9e4f Adapt iPhone Duo layouts, rail navigation, and native sheets (#8568)
Duo keeps conversations and Settings details open across closed, book
and flat postures. Book mode splits at the fold; flattening restores the
sidebar. Native rail controls, full-width navigation backdrops and
sheet-local safe areas keep content aligned. Ordinary iPhones remain
single-pane in portrait and landscape; tablet and Duo split layouts
remain enabled.

Includes the recovered preview's matching pane widths, Buzz empty-pane
mark, stable Settings chevrons, Bestie pane routing and Duo-only upward
New menu attachment. Current main's Activity redesign, Search content
fade and unread-navigation button are retained. Menu selection checks
sit beside their labels.

Shared mobile changes remain in scope: the native iOS status editor,
Appearance preview layout, avatar crop preservation, onboarding footer
layout, profile/invite sheet geometry and nested conversation
navigation. This PR is not exclusively Duo-gated. Nested navigator
observers preserve recording cancellation and navigation callbacks; crop
resizing preserves the selected image region. iOS 27.1 APIs remain
compile-time and runtime gated.

Validation on the reconciled source: Flutter analysis, Activity/Home
journeys, the full mobile test suite, file-size checks and Swift package
tests. The iPhone single-pane fix was also exercised on an iPhone 18 Pro
simulator before reconciliation. Fresh hosted CI and physical-device
confirmation of the reconciled build are separate and remain pending.

---------

Signed-off-by: kenny lopez <klopez4212@gmail.com>
Signed-off-by: Tom Brow <tomb@squareup.com>
Co-authored-by: Terp <5856f6900e8e0a4e0ea1f4f8d2ee33e4753d2119bc122f94ecafc660b46c0511@buzz.block.builderlab.xyz>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: Tom Brow <tomb@block.xyz>
Co-authored-by: Tom Brow <tomb@squareup.com>
2026-11-12 19:00:58 +00:00

96 lines
3.2 KiB
Dart
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

import 'package:buzz/features/settings/settings_page.dart';
import 'package:buzz/shared/community/community_membership_provider.dart';
import 'package:buzz/shared/hosted/hosted_environment.dart';
import 'package:buzz/shared/theme/theme.dart';
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:flutter_test/flutter_test.dart';
import 'package:hooks_riverpod/hooks_riverpod.dart';
import 'package:package_info_plus/package_info_plus.dart';
import 'package:shared_preferences/shared_preferences.dart';
void main() {
Future<List<Uri>> pumpSettings(
WidgetTester tester, {
bool wide = false,
bool opens = true,
bool throws = false,
}) async {
tester.view.devicePixelRatio = 1;
tester.view.physicalSize = wide
? const Size(1000, 800)
: const Size(390, 844);
addTearDown(tester.view.reset);
PackageInfo.setMockInitialValues(
appName: 'Buzz',
packageName: 'xyz.block.buzz',
version: '0.16.0',
buildNumber: '432',
buildSignature: '',
);
SharedPreferences.setMockInitialValues({});
final prefs = await SharedPreferences.getInstance();
final opened = <Uri>[];
await tester.pumpWidget(
ProviderScope(
overrides: [
savedPrefsProvider.overrideWithValue(prefs),
currentCommunityRoleProvider.overrideWithValue(
const AsyncData<CommunityMemberRole?>(CommunityMemberRole.member),
),
builderlabWebLauncherProvider.overrideWithValue((uri) async {
opened.add(uri);
if (throws) throw PlatformException(code: 'ACTIVITY_NOT_FOUND');
return opens;
}),
],
child: MaterialApp(
theme: AppTheme.light(),
home: SettingsPage(
profileHeader: const SizedBox.shrink(),
identityRecoveryPageBuilder: (_) => const SizedBox.shrink(),
),
),
),
);
await tester.pumpAndSettle();
return opened;
}
final row = find.byKey(const Key('settings-builderlab-account'));
for (final wide in [false, true]) {
Future<void> openAccount(WidgetTester tester) async {
if (wide) {
await tester.tap(find.text('Account'));
await tester.pumpAndSettle();
}
await tester.ensureVisible(row);
await tester.tap(row);
await tester.pumpAndSettle();
}
testWidgets('opens the public dashboard (wide=$wide)', (tester) async {
final opened = await pumpSettings(tester, wide: wide);
await openAccount(tester);
expect(opened, [HostedEnvironment.origin]);
expect(find.text('Couldn’t open Builderlab.'), findsNothing);
}, skip: !HostedEnvironment.enabled);
for (final throws in [false, true]) {
testWidgets('reports browser failure (throws=$throws, wide=$wide)', (
tester,
) async {
await pumpSettings(tester, wide: wide, opens: false, throws: throws);
await openAccount(tester);
expect(find.text('Couldn’t open Builderlab.'), findsOneWidget);
}, skip: !HostedEnvironment.enabled);
}
}
testWidgets('is absent outside a public build', (tester) async {
await pumpSettings(tester);
expect(row, findsNothing);
}, skip: HostedEnvironment.enabled);
}