Skip to content

Commit 968ead0

Browse files
committed
test(mobile): bind provenance fixtures to signed and status-aware evidence
Signed-off-by: Logan Johnson <loganj@squareup.com>
1 parent f91f714 commit 968ead0

2 files changed

Lines changed: 27 additions & 2 deletions

File tree

mobile/test/features/channels/channels_page_test.dart

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2507,6 +2507,19 @@ class _ReconnectingRelaySession extends RelaySessionNotifier {
25072507
void Function(String message)? onClosed,
25082508
}) async => () {};
25092509

2510+
// The directory now uses the status-aware SDK seam. Do not fall through
2511+
// to a real session (and its EOSE fallback) in this connection-state fake.
2512+
@override
2513+
Future<void Function()> subscribeWithStatus(
2514+
NostrFilter filter,
2515+
void Function(NostrEvent) onEvent, {
2516+
void Function(String message)? onClosed,
2517+
void Function(RelaySubscriptionStatus status)? onStatusChanged,
2518+
}) async {
2519+
onStatusChanged?.call(RelaySubscriptionStatus.ready);
2520+
return () {};
2521+
}
2522+
25102523
void connect() {
25112524
state = const SessionState(status: SessionStatus.connected);
25122525
}

mobile/test/shared/widgets/agent_provenance_test.dart

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,12 @@ import 'package:flutter/rendering.dart';
1414
import 'package:flutter/services.dart';
1515
import 'package:flutter_test/flutter_test.dart';
1616
import 'package:lucide_icons_flutter/lucide_icons.dart';
17+
import 'package:nostr/nostr.dart' as nostr;
1718

1819
import '../../helpers/widget_helpers.dart';
1920

2021
const _agent =
21-
'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa';
22+
'79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798';
2223
const _owner =
2324
'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb';
2425
const _peer =
@@ -69,7 +70,18 @@ void main() {
6970
findsNWidgets(2),
7071
);
7172
expect(find.text('Agent'), findsOneWidget);
72-
cache.put(const UserProfile(pubkey: _agent, displayName: 'Agent'));
73+
// Revocation is signed relay evidence, not a seed-only cache update.
74+
cache.cacheProfileEvent(
75+
NostrEvent.fromJson(
76+
nostr.Event.from(
77+
kind: 0,
78+
content: '{"name":"Agent"}',
79+
secretKey:
80+
'0000000000000000000000000000000000000000000000000000000000000001',
81+
createdAt: 2,
82+
).toMap(),
83+
),
84+
);
7385
await tester.pump();
7486
expect(
7587
find.byIcon(LucideIcons.cloud),

0 commit comments

Comments
 (0)