Drawer 'Profile' is now live. - commons_core: ProfileTransport + UserProfile + NostrProfileTransport (kind:0 publish/fetch), exposed as SocialSession.profile. Round-trip tested against the in-process relay (fast dart test). - app: ProfileStore (local name/about, keystore) + ProfileScreen — shows your shareable npub with copy, edits display name + 'about', saves locally and (when online) publishes kind:0 so peers can recognise you instead of a raw key. - Drawer 'Profile' -> /profile (gated like Market/Chat). - i18n en/es/pt. ProfileStore + profile transport covered by plain/dart tests. Analyzer clean (both packages).
20 lines
578 B
Dart
20 lines
578 B
Dart
import 'package:flutter_test/flutter_test.dart';
|
|
import 'package:tane/services/profile_store.dart';
|
|
|
|
import '../support/test_support.dart';
|
|
|
|
void main() {
|
|
late ProfileStore store;
|
|
setUp(() => store = ProfileStore(InMemorySecretStore()));
|
|
|
|
test('defaults are empty', () async {
|
|
expect(await store.name(), '');
|
|
expect(await store.about(), '');
|
|
});
|
|
|
|
test('save then read back, trimmed', () async {
|
|
await store.save(name: ' Alicia ', about: ' tomate rosa ');
|
|
expect(await store.name(), 'Alicia');
|
|
expect(await store.about(), 'tomate rosa');
|
|
});
|
|
}
|