Fix stale map labels, avatar initials and offline bubble widths
- Map node labels follow light/dark theme changes. - Avatar initials use only letters and digits; hop avatars fall back to the hash prefix. - Incoming channel bubbles are the same width connected and offline. - Day separators wrap instead of overflowing with large text.
This commit is contained in:
1 parent
34ea0cb7ca
commit
92dadb0d3a
12 files changed
+642
-48
No files matched your search
@@ -0,0 +1,84 @@
|
||||
import 'dart:typed_data';
|
||||
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_test/flutter_test.dart';
|
||||
import 'package:meshcore_open/connector/meshcore_connector.dart';
|
||||
import 'package:meshcore_open/connector/meshcore_protocol.dart';
|
||||
import 'package:meshcore_open/l10n/app_localizations.dart';
|
||||
import 'package:meshcore_open/models/channel_message.dart';
|
||||
import 'package:meshcore_open/models/contact.dart';
|
||||
import 'package:meshcore_open/screens/channel_message_path_screen.dart';
|
||||
import 'package:meshcore_open/widgets/mesh_ui.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
|
||||
class _FakeConnector extends MeshCoreConnector {
|
||||
_FakeConnector(this.hopContacts);
|
||||
|
||||
final List<Contact> hopContacts;
|
||||
|
||||
@override
|
||||
List<Contact> get allContacts => hopContacts;
|
||||
|
||||
@override
|
||||
double? get selfLatitude => null;
|
||||
|
||||
@override
|
||||
double? get selfLongitude => null;
|
||||
}
|
||||
|
||||
void main() {
|
||||
testWidgets('hop avatars use the repeater name or the hex prefix', (
|
||||
tester,
|
||||
) async {
|
||||
final connector = _FakeConnector([
|
||||
Contact(
|
||||
publicKey: Uint8List(32)..first = 0xAA,
|
||||
name: '(Base) Hilltop',
|
||||
type: advTypeRepeater,
|
||||
pathLength: 0,
|
||||
path: Uint8List(0),
|
||||
lastSeen: DateTime.utc(2026),
|
||||
),
|
||||
]);
|
||||
final message = ChannelMessage(
|
||||
senderName: 'Alice',
|
||||
text: 'hello',
|
||||
timestamp: DateTime.utc(2026),
|
||||
isOutgoing: false,
|
||||
pathBytes: Uint8List.fromList([0xAA, 0xBC]),
|
||||
channelIndex: 0,
|
||||
);
|
||||
|
||||
await tester.pumpWidget(
|
||||
ChangeNotifierProvider<MeshCoreConnector>.value(
|
||||
value: connector,
|
||||
child: MaterialApp(
|
||||
localizationsDelegates: AppLocalizations.localizationsDelegates,
|
||||
supportedLocales: AppLocalizations.supportedLocales,
|
||||
home: ChannelMessagePathScreen(
|
||||
message: message,
|
||||
channelMessage: true,
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
await tester.pumpAndSettle();
|
||||
|
||||
final avatarNames = tester
|
||||
.widgetList<AvatarCircle>(find.byType(AvatarCircle))
|
||||
.map((avatar) => avatar.name)
|
||||
.toList();
|
||||
expect(avatarNames, containsAll(['(Base) Hilltop', 'BC']));
|
||||
expect(
|
||||
find.descendant(of: find.byType(AvatarCircle), matching: find.text('BH')),
|
||||
findsOneWidget,
|
||||
);
|
||||
expect(
|
||||
find.descendant(
|
||||
of: find.byType(AvatarCircle),
|
||||
matching: find.textContaining('('),
|
||||
),
|
||||
findsNothing,
|
||||
);
|
||||
});
|
||||
}
|
||||
@@ -0,0 +1,321 @@
|
||||
import 'dart:io';
|
||||
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter/services.dart';
|
||||
import 'package:flutter_localizations/flutter_localizations.dart';
|
||||
import 'package:flutter_test/flutter_test.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
import 'package:shared_preferences/shared_preferences.dart';
|
||||
|
||||
import 'package:meshcore_open/connector/meshcore_connector.dart';
|
||||
import 'package:meshcore_open/connector/meshcore_protocol.dart';
|
||||
import 'package:meshcore_open/l10n/app_localizations.dart';
|
||||
import 'package:meshcore_open/models/channel.dart';
|
||||
import 'package:meshcore_open/models/channel_message.dart';
|
||||
import 'package:meshcore_open/models/contact.dart';
|
||||
import 'package:meshcore_open/models/message.dart';
|
||||
import 'package:meshcore_open/screens/channel_chat_screen.dart';
|
||||
import 'package:meshcore_open/screens/chat_screen.dart';
|
||||
import 'package:meshcore_open/services/app_debug_log_service.dart';
|
||||
import 'package:meshcore_open/services/app_settings_service.dart';
|
||||
import 'package:meshcore_open/services/ble_debug_log_service.dart';
|
||||
import 'package:meshcore_open/services/chat_text_scale_service.dart';
|
||||
import 'package:meshcore_open/services/image_codec_service.dart';
|
||||
import 'package:meshcore_open/services/map_tile_cache_service.dart';
|
||||
import 'package:meshcore_open/services/message_retry_service.dart';
|
||||
import 'package:meshcore_open/services/network_map/network_map_upload_service.dart';
|
||||
import 'package:meshcore_open/services/path_history_service.dart';
|
||||
import 'package:meshcore_open/services/received_image_store.dart';
|
||||
import 'package:meshcore_open/services/storage_service.dart';
|
||||
import 'package:meshcore_open/services/timeout_prediction_service.dart';
|
||||
import 'package:meshcore_open/services/translation_service.dart';
|
||||
import 'package:meshcore_open/services/ui_view_state_service.dart';
|
||||
import 'package:meshcore_open/storage/channel_message_store.dart';
|
||||
import 'package:meshcore_open/storage/channel_store.dart';
|
||||
import 'package:meshcore_open/storage/contact_store.dart';
|
||||
import 'package:meshcore_open/storage/last_radio_store.dart';
|
||||
import 'package:meshcore_open/storage/message_store.dart';
|
||||
import 'package:meshcore_open/storage/prefs_manager.dart';
|
||||
import 'package:meshcore_open/theme/mesh_theme.dart';
|
||||
import 'package:meshcore_open/utils/platform_info.dart';
|
||||
import 'package:meshcore_open/widgets/message_bubble_frame.dart';
|
||||
|
||||
final _radioKey = Uint8List.fromList(List<int>.generate(32, (i) => 0xA0 + i));
|
||||
final _radioHex = pubKeyToHex(_radioKey);
|
||||
final _aliceKey = Uint8List.fromList(List<int>.generate(32, (i) => 0x10 + i));
|
||||
final _psk = Uint8List.fromList(List<int>.generate(16, (i) => 0x40 + i));
|
||||
|
||||
const _long =
|
||||
'The ridge trail is washed out past the second bridge, so take the '
|
||||
'lower path along the river and meet us at the old ranger station.';
|
||||
|
||||
/// Shows the saved radio as connected or offline without a transport, so
|
||||
/// both states render exactly the same stored transcript.
|
||||
class _ToggleConnector extends MeshCoreConnector {
|
||||
bool connected = false;
|
||||
|
||||
@override
|
||||
bool get isConnected => connected;
|
||||
}
|
||||
|
||||
DateTime _at(int seconds) =>
|
||||
DateTime.fromMillisecondsSinceEpoch(1700000000000 + seconds * 1000);
|
||||
|
||||
Future<void> _seedRadio() async {
|
||||
final alice = Contact(
|
||||
publicKey: _aliceKey,
|
||||
name: 'Alice',
|
||||
type: advTypeChat,
|
||||
pathLength: 1,
|
||||
path: Uint8List.fromList([0x22]),
|
||||
lastSeen: _at(0),
|
||||
);
|
||||
await (ContactStore()..setPublicKeyHex = _radioHex).saveContacts([alice]);
|
||||
final channel = Channel(index: 0, name: 'Base Camp', psk: _psk);
|
||||
final channelStore = ChannelStore()..setPublicKeyHex = _radioHex;
|
||||
await channelStore.saveChannels([channel]);
|
||||
await channelStore.saveSlotChannelIds({0: channel.storageId!});
|
||||
|
||||
ChannelMessage channelMessage(
|
||||
int second,
|
||||
String text, {
|
||||
required bool outgoing,
|
||||
String? translated,
|
||||
}) => ChannelMessage(
|
||||
senderName: outgoing ? 'Base' : 'Bob',
|
||||
text: text,
|
||||
translatedText: translated,
|
||||
timestamp: _at(second),
|
||||
isOutgoing: outgoing,
|
||||
status: ChannelMessageStatus.sent,
|
||||
channelIndex: 0,
|
||||
);
|
||||
await (ChannelMessageStore()..setPublicKeyHex = _radioHex)
|
||||
.saveChannelMessages(channel.storageId!, [
|
||||
channelMessage(1, 'ok', outgoing: false),
|
||||
channelMessage(2, _long, outgoing: false),
|
||||
channelMessage(3, 'on my way', outgoing: true),
|
||||
channelMessage(4, _long, outgoing: true),
|
||||
channelMessage(
|
||||
5,
|
||||
'Der Weg ist frei',
|
||||
outgoing: false,
|
||||
translated: 'The path is clear',
|
||||
),
|
||||
]);
|
||||
|
||||
Message directMessage(
|
||||
int second,
|
||||
String text, {
|
||||
required bool outgoing,
|
||||
String? translated,
|
||||
}) => Message(
|
||||
senderKey: _aliceKey,
|
||||
text: text,
|
||||
translatedText: translated,
|
||||
timestamp: _at(second),
|
||||
isOutgoing: outgoing,
|
||||
status: MessageStatus.delivered,
|
||||
);
|
||||
await (MessageStore()..setPublicKeyHex = _radioHex)
|
||||
.saveMessages(alice.publicKeyHex, [
|
||||
directMessage(1, 'hi', outgoing: false),
|
||||
directMessage(2, _long, outgoing: false),
|
||||
directMessage(3, 'see you', outgoing: true),
|
||||
directMessage(4, _long, outgoing: true),
|
||||
directMessage(
|
||||
5,
|
||||
'Der Weg ist frei',
|
||||
outgoing: false,
|
||||
translated: 'The path is clear',
|
||||
),
|
||||
]);
|
||||
await LastRadioStore().save(
|
||||
LastRadio(
|
||||
publicKeyHex: _radioHex,
|
||||
name: 'Base',
|
||||
transport: LastRadio.transportBle,
|
||||
bleRemoteId: 'AA:BB:CC:DD:EE:FF',
|
||||
savedAt: _at(0),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
Future<Widget> _app(
|
||||
WidgetTester tester,
|
||||
MeshCoreConnector connector,
|
||||
Widget home,
|
||||
) async {
|
||||
final storage = StorageService();
|
||||
final settings = AppSettingsService();
|
||||
await tester.runAsync(settings.loadSettings);
|
||||
final translation = TranslationService(settings);
|
||||
return MultiProvider(
|
||||
providers: [
|
||||
ChangeNotifierProvider.value(value: connector),
|
||||
ChangeNotifierProvider.value(value: MessageRetryService()),
|
||||
ChangeNotifierProvider.value(value: PathHistoryService(storage)),
|
||||
ChangeNotifierProvider.value(value: settings),
|
||||
ChangeNotifierProvider.value(value: BleDebugLogService()),
|
||||
ChangeNotifierProvider.value(value: AppDebugLogService()),
|
||||
ChangeNotifierProvider.value(value: ChatTextScaleService()),
|
||||
ChangeNotifierProvider.value(value: translation),
|
||||
ChangeNotifierProvider.value(value: UiViewStateService()),
|
||||
Provider.value(value: storage),
|
||||
ChangeNotifierProvider.value(
|
||||
value: MapTileCacheService(appSettingsService: settings),
|
||||
),
|
||||
ChangeNotifierProvider.value(value: TimeoutPredictionService(storage)),
|
||||
ChangeNotifierProvider.value(value: ImageCodecService(settings)),
|
||||
ChangeNotifierProvider.value(value: ReceivedImageStore()),
|
||||
ChangeNotifierProvider.value(
|
||||
value: NetworkMapUploadService(
|
||||
connector: connector,
|
||||
settings: settings,
|
||||
),
|
||||
),
|
||||
],
|
||||
child: MaterialApp(
|
||||
theme: MeshTheme.light(),
|
||||
locale: const Locale('en'),
|
||||
localizationsDelegates: const [
|
||||
AppLocalizations.delegate,
|
||||
GlobalMaterialLocalizations.delegate,
|
||||
GlobalWidgetsLocalizations.delegate,
|
||||
GlobalCupertinoLocalizations.delegate,
|
||||
],
|
||||
supportedLocales: AppLocalizations.supportedLocales,
|
||||
home: home,
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
Future<void> _settle(WidgetTester tester) async {
|
||||
for (var i = 0; i < 10; i++) {
|
||||
await tester.pump(const Duration(milliseconds: 100));
|
||||
}
|
||||
}
|
||||
|
||||
/// Horizontal extent of every rendered bubble, in transcript order.
|
||||
List<String> _bubbleExtents(WidgetTester tester) {
|
||||
final frames = find.byType(MessageBubbleFrame);
|
||||
expect(frames, findsWidgets);
|
||||
return [
|
||||
for (final element in frames.evaluate())
|
||||
() {
|
||||
final rect = tester.getRect(find.byWidget(element.widget));
|
||||
return '${rect.left.toStringAsFixed(1)}..'
|
||||
'${rect.right.toStringAsFixed(1)}';
|
||||
}(),
|
||||
];
|
||||
}
|
||||
|
||||
Future<List<String>> _render(
|
||||
WidgetTester tester,
|
||||
_ToggleConnector connector,
|
||||
Widget Function() screen, {
|
||||
required bool connected,
|
||||
}) async {
|
||||
connector.connected = connected;
|
||||
await tester.pumpWidget(await _app(tester, connector, screen()));
|
||||
await _settle(tester);
|
||||
final extents = _bubbleExtents(tester);
|
||||
await tester.pumpWidget(const SizedBox());
|
||||
await tester.pump(const Duration(seconds: 1));
|
||||
return extents;
|
||||
}
|
||||
|
||||
void main() {
|
||||
TestWidgetsFlutterBinding.ensureInitialized();
|
||||
|
||||
final tempDir = Directory.systemTemp.createTempSync('bubble_width_test');
|
||||
TestDefaultBinaryMessengerBinding.instance.defaultBinaryMessenger
|
||||
.setMockMethodCallHandler(
|
||||
const MethodChannel('plugins.flutter.io/path_provider'),
|
||||
(call) async => tempDir.path,
|
||||
);
|
||||
|
||||
setUp(() async {
|
||||
SharedPreferences.setMockInitialValues({});
|
||||
PrefsManager.reset();
|
||||
await PrefsManager.initialize();
|
||||
ChannelMessageStore().forgetArchive();
|
||||
MessageStore().forgetArchive();
|
||||
await _seedRadio();
|
||||
ChannelMessageStore().forgetArchive();
|
||||
MessageStore().forgetArchive();
|
||||
});
|
||||
|
||||
// On phones, incoming channel bubbles are swipeable (reply) only while
|
||||
// connected; that must not change their size or position. Day separators
|
||||
// and bubbles must also fit 320dp at large text sizes.
|
||||
for (final desktop in [false, true]) {
|
||||
for (final scale in [1.0, 1.3, 2.0]) {
|
||||
final label = '${desktop ? 'desktop' : 'phone'}, 320dp, ${scale}x text';
|
||||
|
||||
testWidgets('channel bubbles match connected vs offline ($label)', (
|
||||
tester,
|
||||
) async {
|
||||
PlatformInfo.debugIsDesktopOverride = desktop;
|
||||
addTearDown(() => PlatformInfo.debugIsDesktopOverride = null);
|
||||
tester.view.physicalSize = const Size(320, 4000);
|
||||
tester.view.devicePixelRatio = 1;
|
||||
tester.platformDispatcher.textScaleFactorTestValue = scale;
|
||||
addTearDown(tester.view.reset);
|
||||
addTearDown(tester.platformDispatcher.clearTextScaleFactorTestValue);
|
||||
|
||||
final connector = _ToggleConnector();
|
||||
addTearDown(connector.dispose);
|
||||
await tester.runAsync(connector.restoreLastRadio);
|
||||
final channel = connector.channels.single;
|
||||
|
||||
final offline = await _render(
|
||||
tester,
|
||||
connector,
|
||||
() => ChannelChatScreen(channel: channel),
|
||||
connected: false,
|
||||
);
|
||||
final connected = await _render(
|
||||
tester,
|
||||
connector,
|
||||
() => ChannelChatScreen(channel: channel),
|
||||
connected: true,
|
||||
);
|
||||
expect(offline, hasLength(5));
|
||||
expect(connected, offline);
|
||||
});
|
||||
|
||||
testWidgets('DM bubbles match connected vs offline ($label)', (
|
||||
tester,
|
||||
) async {
|
||||
PlatformInfo.debugIsDesktopOverride = desktop;
|
||||
addTearDown(() => PlatformInfo.debugIsDesktopOverride = null);
|
||||
tester.view.physicalSize = const Size(320, 4000);
|
||||
tester.view.devicePixelRatio = 1;
|
||||
tester.platformDispatcher.textScaleFactorTestValue = scale;
|
||||
addTearDown(tester.view.reset);
|
||||
addTearDown(tester.platformDispatcher.clearTextScaleFactorTestValue);
|
||||
|
||||
final connector = _ToggleConnector();
|
||||
addTearDown(connector.dispose);
|
||||
await tester.runAsync(connector.restoreLastRadio);
|
||||
final alice = connector.contacts.single;
|
||||
|
||||
final offline = await _render(
|
||||
tester,
|
||||
connector,
|
||||
() => ChatScreen(contact: alice),
|
||||
connected: false,
|
||||
);
|
||||
final connected = await _render(
|
||||
tester,
|
||||
connector,
|
||||
() => ChatScreen(contact: alice),
|
||||
connected: true,
|
||||
);
|
||||
expect(offline, hasLength(5));
|
||||
expect(connected, offline);
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -95,7 +95,11 @@ void main() {
|
||||
viewState.dispose();
|
||||
});
|
||||
|
||||
Future<void> openMap(WidgetTester tester) async {
|
||||
Future<void> openMap(
|
||||
WidgetTester tester, {
|
||||
ThemeMode themeMode = ThemeMode.light,
|
||||
LatLng? highlight,
|
||||
}) async {
|
||||
await tester.pumpWidget(
|
||||
MultiProvider(
|
||||
providers: [
|
||||
@@ -107,9 +111,11 @@ void main() {
|
||||
],
|
||||
child: MaterialApp(
|
||||
theme: MeshTheme.light(),
|
||||
darkTheme: MeshTheme.dark(),
|
||||
themeMode: themeMode,
|
||||
localizationsDelegates: AppLocalizations.localizationsDelegates,
|
||||
supportedLocales: AppLocalizations.supportedLocales,
|
||||
home: const MapScreen(),
|
||||
home: MapScreen(highlightPosition: highlight),
|
||||
),
|
||||
),
|
||||
);
|
||||
@@ -185,4 +191,55 @@ void main() {
|
||||
expect(markerPoints(tester), contains(const LatLng(35, -112)));
|
||||
await tester.pumpWidget(const SizedBox.shrink());
|
||||
});
|
||||
|
||||
testWidgets('node labels follow a system light/dark switch', (tester) async {
|
||||
addTearDown(tester.platformDispatcher.clearPlatformBrightnessTestValue);
|
||||
tester.platformDispatcher.platformBrightnessTestValue = Brightness.light;
|
||||
connector.nodes = [_node()];
|
||||
// Zoomed in past the label threshold so node names are drawn.
|
||||
await openMap(
|
||||
tester,
|
||||
themeMode: ThemeMode.system,
|
||||
highlight: const LatLng(35, -112),
|
||||
);
|
||||
|
||||
Color? labelColor() => tester
|
||||
.widget<Text>(
|
||||
find.descendant(
|
||||
of: find.byType(MarkerLayer),
|
||||
matching: find.text('Repeater'),
|
||||
),
|
||||
)
|
||||
.style
|
||||
?.color;
|
||||
|
||||
expect(labelColor(), MeshTheme.light().colorScheme.onSurface);
|
||||
|
||||
tester.platformDispatcher.platformBrightnessTestValue = Brightness.dark;
|
||||
await tester.pumpAndSettle();
|
||||
expect(labelColor(), MapPalette.textPrimary);
|
||||
|
||||
tester.platformDispatcher.platformBrightnessTestValue = Brightness.light;
|
||||
await tester.pumpAndSettle();
|
||||
expect(labelColor(), MeshTheme.light().colorScheme.onSurface);
|
||||
await tester.pumpWidget(const SizedBox.shrink());
|
||||
});
|
||||
|
||||
testWidgets('a fixed light theme ignores the system switch', (tester) async {
|
||||
addTearDown(tester.platformDispatcher.clearPlatformBrightnessTestValue);
|
||||
tester.platformDispatcher.platformBrightnessTestValue = Brightness.light;
|
||||
connector.nodes = [_node()];
|
||||
await openMap(tester, highlight: const LatLng(35, -112));
|
||||
|
||||
tester.platformDispatcher.platformBrightnessTestValue = Brightness.dark;
|
||||
await tester.pumpAndSettle();
|
||||
final label = tester.widget<Text>(
|
||||
find.descendant(
|
||||
of: find.byType(MarkerLayer),
|
||||
matching: find.text('Repeater'),
|
||||
),
|
||||
);
|
||||
expect(label.style?.color, MeshTheme.light().colorScheme.onSurface);
|
||||
await tester.pumpWidget(const SizedBox.shrink());
|
||||
});
|
||||
}
|
||||
@@ -0,0 +1,73 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_test/flutter_test.dart';
|
||||
import 'package:meshcore_open/widgets/contact_visuals.dart';
|
||||
import 'package:meshcore_open/widgets/mesh_ui.dart';
|
||||
|
||||
void main() {
|
||||
group('avatarInitials', () {
|
||||
test('empty and whitespace-only names have no initials', () {
|
||||
expect(avatarInitials(''), isNull);
|
||||
expect(avatarInitials(' '), isNull);
|
||||
});
|
||||
|
||||
test('punctuation-only names have no initials', () {
|
||||
expect(avatarInitials('-'), isNull);
|
||||
expect(avatarInitials('(--) [ ]'), isNull);
|
||||
});
|
||||
|
||||
test('punctuation never becomes an initial', () {
|
||||
expect(avatarInitials('(Base) Node'), 'BN');
|
||||
expect(avatarInitials('- Relay'), 'RE');
|
||||
expect(avatarInitials('[AB12] Hilltop'), 'AH');
|
||||
expect(avatarInitials('Node-1'), 'N1');
|
||||
});
|
||||
|
||||
test('plain names keep the existing two-letter shape', () {
|
||||
expect(avatarInitials('Alice Smith'), 'AS');
|
||||
expect(avatarInitials('tower'), 'TO');
|
||||
expect(avatarInitials('A1B2C3D4'), 'A1');
|
||||
});
|
||||
|
||||
test('Cyrillic names use their letters', () {
|
||||
expect(avatarInitials('Иван Петров'), 'ИП');
|
||||
expect(avatarInitials('(ретранслятор)'), 'РЕ');
|
||||
});
|
||||
|
||||
test('CJK names use their characters', () {
|
||||
expect(avatarInitials('東京 中継'), '東中');
|
||||
expect(avatarInitials('「大阪」'), '大阪');
|
||||
});
|
||||
|
||||
test('emoji is kept whole and skipped when letters exist', () {
|
||||
expect(avatarInitials('🔥 Fire Node'), 'FN');
|
||||
expect(avatarInitials('Fire🔥Node'), 'FN');
|
||||
expect(avatarInitials('🔥'), '🔥');
|
||||
expect(avatarInitials('👨👩👧 -'), '👨👩👧');
|
||||
});
|
||||
|
||||
test('combining accents stay with their letter', () {
|
||||
expect(avatarInitials('école'), 'ÉC');
|
||||
});
|
||||
});
|
||||
|
||||
testWidgets('AvatarCircle shows an icon when the name has no initials', (
|
||||
tester,
|
||||
) async {
|
||||
await tester.pumpWidget(
|
||||
const MaterialApp(
|
||||
home: Scaffold(
|
||||
body: Column(
|
||||
children: [
|
||||
AvatarCircle(name: '(--)'),
|
||||
AvatarCircle(name: '(Base) Node'),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
|
||||
expect(find.byIcon(Icons.person_outline), findsOneWidget);
|
||||
expect(find.text('BN'), findsOneWidget);
|
||||
expect(find.textContaining('('), findsNothing);
|
||||
});
|
||||
}
|
||||
Reference in new issue
Block a user