mirror of
https://github.com/dz0ny/meshcore-sar.git
synced 2026-08-12 00:40:28 +00:00
feat: save all pending work
ref:
This commit is contained in:
26
test/utils/avatar_label_helper_test.dart
Normal file
26
test/utils/avatar_label_helper_test.dart
Normal file
@@ -0,0 +1,26 @@
|
||||
import 'package:flutter_test/flutter_test.dart';
|
||||
import 'package:meshcore_sar_app/utils/avatar_label_helper.dart';
|
||||
|
||||
void main() {
|
||||
group('AvatarLabelHelper.buildLabel', () {
|
||||
test('returns two initials for multi-word names', () {
|
||||
expect(AvatarLabelHelper.buildLabel('John Smith'), 'JS');
|
||||
});
|
||||
|
||||
test('returns first two characters for single-word names', () {
|
||||
expect(AvatarLabelHelper.buildLabel('Alpha'), 'AL');
|
||||
});
|
||||
|
||||
test('allows three compact characters for hash-prefixed names', () {
|
||||
expect(AvatarLabelHelper.buildLabel('#ops'), '#OP');
|
||||
});
|
||||
|
||||
test('removes spacing after hash-prefixed names', () {
|
||||
expect(AvatarLabelHelper.buildLabel('# foo alpha'), '#FO');
|
||||
});
|
||||
|
||||
test('keeps non-hash labels at two characters', () {
|
||||
expect(AvatarLabelHelper.buildLabel('abc'), 'AB');
|
||||
});
|
||||
});
|
||||
}
|
||||
Reference in New Issue
Block a user