Merge branch 'spike/block2-derisking'

This commit is contained in:
vjrj 2026-07-10 12:57:02 +02:00
commit 5b59670c47
7 changed files with 149 additions and 13 deletions

View file

@ -0,0 +1,22 @@
import 'package:flutter_test/flutter_test.dart';
import 'package:tane/services/profile_cache.dart';
import '../support/test_support.dart';
void main() {
test('unknown pubkey has no cached name', () async {
final cache = ProfileCache(InMemorySecretStore());
expect(await cache.name('abc'), isNull);
});
test('setName then name round-trips (trimmed)', () async {
final cache = ProfileCache(InMemorySecretStore());
await cache.setName('abc', ' Alicia ');
expect(await cache.name('abc'), 'Alicia');
});
test('shortPubkey abbreviates long keys, keeps short ones', () {
expect(shortPubkey('abcdef1234567890'), 'abcdef…7890');
expect(shortPubkey('short'), 'short');
});
}