Merge branch 'spike/block2-derisking'

This commit is contained in:
vjrj 2026-07-10 13:40:07 +02:00
commit 552f1737bf
17 changed files with 428 additions and 108 deletions

View file

@ -66,7 +66,7 @@ Widget _wrapMarket(SocialService social, SocialSettings settings,
}
void main() {
testWidgets('offline (no transport) shows the "set up sharing" prompt',
testWidgets('offline (no transport) shows the "can\'t reach servers" state',
(tester) async {
final cubit = OffersCubit(null);
addTearDown(cubit.close);
@ -74,8 +74,8 @@ void main() {
await tester.pumpWidget(_wrapBody(cubit));
await tester.pumpAndSettle();
expect(find.text("Sharing isn't set up yet"), findsOneWidget);
expect(find.text('Set up sharing'), findsOneWidget);
expect(find.textContaining("Can't reach the community servers"),
findsOneWidget);
});
testWidgets('MarketScreen with no relays configured degrades to offline',
@ -88,7 +88,7 @@ void main() {
await tester.pumpAndSettle();
expect(find.text('Seeds near you'), findsOneWidget); // app bar title
expect(find.text('Set up sharing'), findsOneWidget); // offline prompt
expect(find.text('Retry'), findsOneWidget); // can't-reach state offers retry
});
testWidgets('"use my location" fills the area with a coarse geohash',
@ -107,8 +107,7 @@ void main() {
await tester.tap(find.byKey(const Key('market.useLocation')));
await tester.pumpAndSettle();
final area = tester.widget<TextField>(find.byKey(const Key('market.area')));
expect(area.controller!.text, hasLength(5));
expect(area.controller!.text, matches(RegExp(r'^[0-9a-z]+$')));
// The area status flips to "set" once a coarse location is captured.
expect(find.textContaining('Your area is set'), findsOneWidget);
});
}