feat(app): adding SimpleLogin to an account (ADR 0020, D21, D23)
All checks were successful
CI / check (push) Successful in 32m34s
CI / deploy (push) Has been skipped

halkyon_app reads where the device's person stands with SimpleLogin
(nothing to show, linked, or missing) and shows it in SimpleLoginSection,
which each app places above the password part: Add SimpleLogin, once
added one more way in. GitHub is added to nobody where SimpleLogin is
offered, and Learn's Profile offers an anonymous person SimpleLogin
alone there (D23).

No cut-off day, reminder or banner (D24): with the developer the only
person on learn.halkyon.eu, the cut-off is the operator taking GitHub's
OAuth app out of the deploy's settings once that account has SimpleLogin.
ADR 0020 records it and drops step 5.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Tizian 「ティツィアーン」 <raisondetredev@pm.me>
This commit is contained in:
Tizian 「ティツィアーン」 2026-10-24 11:56:26 +02:00
commit fad12b4411
Signed by: raisondetredev
GPG key ID: 07F6FCF405488B64

View file

@ -0,0 +1,52 @@
import 'package:flutter_test/flutter_test.dart';
import 'package:halkyon_app/testing.dart';
import '../../../support/pump_app.dart';
import '../../../support/test_dependencies.dart';
// Where the instance offers SimpleLogin (ADR 0020, D21, D23): it alone keeps
// an anonymous account.
void main() {
late FakeAuthGateway auth;
late FakeSimpleLoginGateway simpleLogin;
setUp(() {
auth = FakeAuthGateway();
simpleLogin = FakeSimpleLoginGateway(auth);
});
Future<void> start(WidgetTester tester) => pumpApp(
tester,
testDependencies(authGateway: auth, simpleLoginGateway: simpleLogin),
);
testWidgets('an anonymous person is offered SimpleLogin alone, not GitHub '
'(D23)', (tester) async {
await start(tester);
await openTab(tester, 'Profile');
expect(
find.text(
'Progress is saved on this device. Add SimpleLogin to keep it.',
),
findsOneWidget,
);
expect(find.text('Sign in with GitHub'), findsNothing);
expect(find.text('Add SimpleLogin'), findsWidgets);
});
testWidgets('without SimpleLogin, GitHub keeps the account as before', (
tester,
) async {
simpleLogin.isOffered = false;
await start(tester);
await openTab(tester, 'Profile');
expect(
find.text('Progress is saved on this device. Sign in to keep it.'),
findsOneWidget,
);
expect(find.text('Sign in with GitHub'), findsOneWidget);
expect(find.textContaining('SimpleLogin'), findsNothing);
});
}