feat(app): adding SimpleLogin to an account (ADR 0020, D21, D23)
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:
parent
3a93dc4fd8
commit
fad12b4411
1 changed files with 829 additions and 77 deletions
|
|
@ -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);
|
||||
});
|
||||
}
|
||||
Loading…
Reference in a new issue