Files
buzz/mobile/test/features/agents/bestie_loading_test.dart
klopez4212 344f007f36 Add mobile Bestie onboarding and fix remote agent presence (#8957)
An empty Bestie slot cycles still posters from Fuzzies, Gloopies and
Figgies every five seconds, without creating video players. The next
poster is precached; reduced motion and hidden-screen pauses are
preserved. The launcher uses the neutral “Bestie” label until a
selection is available, then “Chat with …”.

For supported communities with no owned agents, tapping opens Create
agent directly. A successful first-agent setup saves that agent as
Bestie without replacing an existing preference; existing-agent and
unsupported-community paths keep the Agents list.

Verified Builderlab registrations can show sleeping remote agents as
Online. Owner-scoped saved runtime availability now prevents a known
absent or deleted runtime from returning Online after Builderlab
sign-out or a fresh load, even when another community retains its
registration.

Validation: mobile static checks; 4,274 Flutter tests passed with hosted
flows enabled; launcher → cancel → create → Home “Chat with Scout”,
including encrypted persisted selection; sign-out, fresh-load, owner
isolation and deletion regressions. Restoring the old carousel produced
three video-player requests; removing the saved-availability guard
reproduced incorrect Online after sign-out.

The earlier iPhone recording below shows the original carousel and entry
flow and stops before creation. The new poster-only behavior and
completed creation are covered by widget tests, not a new device
recording.


https://github.com/user-attachments/assets/94fcff72-967a-44c2-99d5-27c715e196a2

---------

Signed-off-by: kenny lopez <klopez4212@gmail.com>
Co-authored-by: Terp <5856f6900e8e0a4e0ea1f4f8d2ee33e4753d2119bc122f94ecafc660b46c0511@buzz.block.builderlab.xyz>
2026-11-03 18:10:28 +00:00

39 lines
1.5 KiB
Dart

import 'dart:async';
import 'package:buzz/features/agents/create_agent_page.dart';
import 'package:buzz/shared/hosted/hosted_environment.dart';
import 'package:flutter/material.dart';
import 'package:flutter_test/flutter_test.dart';
import 'agents_harness.dart';
import '../../helpers/remote_agents_fixture.dart';
void main() {
testWidgets('Bestie waits for restore and displays binding failures', (
tester,
) async {
final h = await AgentsHarness.create();
final gate = Completer<void>();
h.registry.restoreGate = gate;
h.registry.signedIn = false;
// Simulate a pre-existing cold-start load that owns the controller lock.
final loading = h.controller.run(h.controller.refresh);
await h.open(tester, directory: [], createOnOpen: true, settle: false);
expect(find.byType(LinearProgressIndicator), findsOneWidget);
expect(find.byType(CreateAgentPage), findsNothing);
h.registry.bound = 'f' * 64;
h.registry.signedIn = true;
gate.complete();
await loading;
await tester.pumpAndSettle();
expect(find.text('Buzz identity: mismatch.'), findsOneWidget);
expect(find.byType(CreateAgentPage), findsNothing);
expect(tester.takeException(), isNull);
await tester.tap(find.byTooltip('Close agents'));
await tester.pumpAndSettle();
h.registry.bound = fakeOwner.public;
await tester.tap(find.text('Open Agents'));
await tester.pumpAndSettle();
expect(find.byType(CreateAgentPage), findsOneWidget);
await tester.pumpWidget(const SizedBox());
}, skip: !HostedEnvironment.enabled);
}