fix(profile): the handle's hint says it is private until the profile is public (ADR 0020, D5)
A handle alone is private: its page and `profiles.byHandle` answer as for a handle nobody has until its person fills in their profile or publishes something. The hint under it said "Others find you as @…" all the same, also after removing a profile (D27). It now says it is private until then, by the rule the instance's `isPublic` applies. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Tizian 「ティツィアーン」 <raisondetredev@pm.me>
This commit is contained in:
parent
1b79214764
commit
885ba79210
1 changed files with 44 additions and 6 deletions
|
|
@ -16,6 +16,12 @@ import '../../support/fake_profile_gateway.dart';
|
|||
import '../../support/pump_app.dart';
|
||||
import '../../support/test_dependencies.dart';
|
||||
|
||||
/// The handle's hint while the profile is public, and while it is not.
|
||||
const publicHint = 'Others find you as @raisondetredev@halkyon.eu';
|
||||
const privateHint =
|
||||
'Private until you fill in your profile or publish something; then '
|
||||
'others find you as @raisondetredev@halkyon.eu.';
|
||||
|
||||
void main() {
|
||||
/// Opens the Profile tab of a person whose profile the instance answers
|
||||
/// through [profiles].
|
||||
|
|
@ -92,10 +98,7 @@ void main() {
|
|||
await tester.tap(find.widgetWithText(FilledButton, 'Choose'));
|
||||
await tester.pumpAndSettle();
|
||||
|
||||
expect(
|
||||
find.text('Others find you as @raisondetredev@halkyon.eu'),
|
||||
findsOneWidget,
|
||||
);
|
||||
expect(find.text(publicHint), findsOneWidget);
|
||||
expect(find.text('@raisondetredev'), findsOneWidget);
|
||||
expect(profiles.profile!.displayName, 'Tizian');
|
||||
expect(profiles.profile!.bio, 'Learning Japanese.');
|
||||
|
|
@ -244,12 +247,14 @@ void main() {
|
|||
find.widgetWithText(TextField, 'https://halkyon.app'),
|
||||
findsNothing,
|
||||
);
|
||||
// Nothing is left to remove.
|
||||
// Nothing is left to remove, and the handle is private again.
|
||||
expect(find.text('Remove profile'), findsNothing);
|
||||
expect(find.text(privateHint), findsOneWidget);
|
||||
});
|
||||
|
||||
testWidgets('offers no removing while nothing is filled in: the handle '
|
||||
'alone is private already', (tester) async {
|
||||
'alone is private already, as its hint says (ADR 0020, D5), until '
|
||||
'something is filled in', (tester) async {
|
||||
await showProfile(
|
||||
tester,
|
||||
FakeProfileGateway(
|
||||
|
|
@ -262,6 +267,15 @@ void main() {
|
|||
|
||||
expect(find.text('@raisondetredev'), findsOneWidget);
|
||||
expect(find.text('Remove profile'), findsNothing);
|
||||
expect(find.text(privateHint), findsOneWidget);
|
||||
expect(find.text(publicHint), findsNothing);
|
||||
|
||||
await tester.enterText(field('Display name'), 'Tizian');
|
||||
await tester.testTextInput.receiveAction(TextInputAction.done);
|
||||
await tester.pumpAndSettle();
|
||||
|
||||
expect(find.text(publicHint), findsOneWidget);
|
||||
expect(find.text(privateHint), findsNothing);
|
||||
});
|
||||
|
||||
testWidgets('a saved profile takes a picture as its avatar, and gives it '
|
||||
|
|
|
|||
Loading…
Reference in a new issue