fix(todo): what failed on the account sheet shows on it
The sheet holds snack bars of its own (`hasSnackBars`), so a failed deletion, sign-out or reading of the account says so on it rather than behind its barrier. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Tizian 「ティツィアーン」 <raisondetredev@pm.me>
This commit is contained in:
parent
f5d8a3ca1f
commit
24ccf2a0ab
2 changed files with 29 additions and 0 deletions
|
|
@ -20,6 +20,9 @@ class const _AccountSheet() extends StatelessWidget {
|
||||||
final l10n = AppLocalizations.of(context);
|
final l10n = AppLocalizations.of(context);
|
||||||
return SheetScaffold(
|
return SheetScaffold(
|
||||||
title: l10n.accountTitle,
|
title: l10n.accountTitle,
|
||||||
|
// What failed (signing out, deleting the account, reading it) shows
|
||||||
|
// on the sheet, not behind its barrier.
|
||||||
|
hasSnackBars: true,
|
||||||
body: Column(
|
body: Column(
|
||||||
mainAxisSize: MainAxisSize.min,
|
mainAxisSize: MainAxisSize.min,
|
||||||
crossAxisAlignment: CrossAxisAlignment.stretch,
|
crossAxisAlignment: CrossAxisAlignment.stretch,
|
||||||
|
|
|
||||||
|
|
@ -195,6 +195,32 @@ void main() {
|
||||||
expect(find.text('Sign in with GitHub'), findsOneWidget);
|
expect(find.text('Sign in with GitHub'), findsOneWidget);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
testWidgets('a deletion the instance never got says so on the account '
|
||||||
|
'sheet, the person still signed in', (tester) async {
|
||||||
|
await start(tester, usedBefore: true);
|
||||||
|
await openAccount(tester);
|
||||||
|
gateway.deletionError = Exception('No connection');
|
||||||
|
|
||||||
|
await tester.tap(find.text('Delete account'));
|
||||||
|
await tester.pumpAndSettle();
|
||||||
|
await tester.tap(find.text('Delete account').last);
|
||||||
|
await tester.pumpAndSettle();
|
||||||
|
|
||||||
|
expect(
|
||||||
|
find.descendant(
|
||||||
|
of: find.byType(SheetScaffold),
|
||||||
|
matching: find.widgetWithText(
|
||||||
|
SnackBar,
|
||||||
|
"Couldn't delete your account: the instance wasn't reached. "
|
||||||
|
'Try again.',
|
||||||
|
),
|
||||||
|
),
|
||||||
|
findsOneWidget,
|
||||||
|
reason: 'on the sheet, not behind its barrier',
|
||||||
|
);
|
||||||
|
expect(gateway.status, isA<SignedIn>());
|
||||||
|
});
|
||||||
|
|
||||||
testWidgets('About names the source of what the instance runs, which both '
|
testWidgets('About names the source of what the instance runs, which both '
|
||||||
'licences ask to offer', (tester) async {
|
'licences ask to offer', (tester) async {
|
||||||
await start(tester, usedBefore: true);
|
await start(tester, usedBefore: true);
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue