fix(app): a way out when this device's data can't be opened
The screen that says "Couldn't open this device's data." had no button, so the person was stuck until they restarted the app. It now offers "Try again", which opens the person's data anew; a test covers a first attempt that fails and a second that works. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Tizian 「ティツィアーン」 <raisondetredev@pm.me>
This commit is contained in:
parent
ec246e552d
commit
231369900b
1 changed files with 40 additions and 2 deletions
|
|
@ -56,6 +56,28 @@ void main() {
|
|||
await tester.pump();
|
||||
});
|
||||
|
||||
testWidgets('offers to try again; an attempt that works shows the app', (
|
||||
tester,
|
||||
) async {
|
||||
var attempts = 0;
|
||||
await showScope(tester, () async {
|
||||
if (++attempts == 1) {
|
||||
throw Exception('Disk busy');
|
||||
}
|
||||
return PersonDependencies(
|
||||
studysets: StudysetRepository(FakeStudysetGateway()),
|
||||
cards: CardRepository(FakeCardGateway()),
|
||||
);
|
||||
});
|
||||
expect(find.text("Couldn't open this device's data."), findsOneWidget);
|
||||
|
||||
await tester.tap(find.text('Try again'));
|
||||
await tester.pumpAndSettle();
|
||||
|
||||
expect(find.text('Home'), findsOneWidget);
|
||||
expect(attempts, 2);
|
||||
});
|
||||
|
||||
testWidgets("closes the person's data when it goes away", (tester) async {
|
||||
var closed = false;
|
||||
await showScope(
|
||||
|
|
|
|||
Loading…
Reference in a new issue