Merge branch 'spike/block2-derisking'
This commit is contained in:
commit
5b59670c47
7 changed files with 149 additions and 13 deletions
22
apps/app_seeds/test/services/profile_cache_test.dart
Normal file
22
apps/app_seeds/test/services/profile_cache_test.dart
Normal 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');
|
||||
});
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue