fix(study): cramming again after turning front and back
A session begun anew (turned to the other side, its settings changed, or tried again) kept the cards it had crammed before, so a cram of a few cards turned round said at once there was nothing to study. It now crams every card again. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Tizian 「ティツィアーン」 <raisondetredev@pm.me>
This commit is contained in:
parent
22f5a4fcd1
commit
cc777d6b06
1 changed files with 30 additions and 0 deletions
|
|
@ -912,6 +912,33 @@ void main() {
|
|||
});
|
||||
});
|
||||
|
||||
test('turning front and back crams every card again, the other way '
|
||||
'round (it said there was nothing to study)', () async {
|
||||
await cards.create('japanese', card('猫'));
|
||||
await cards.create('japanese', card('犬'));
|
||||
await study(const StudyOptions(mode: LearnMode.cram));
|
||||
|
||||
await withClock(Clock(() => now), () async {
|
||||
final bloc = session();
|
||||
addTearDown(bloc.close);
|
||||
expect((await showing(bloc, '猫')).asksBack, isFalse);
|
||||
|
||||
bloc.add(const StudySessionEventBackFirstToggled());
|
||||
|
||||
final turned = await until(
|
||||
bloc,
|
||||
(s) =>
|
||||
(s is StudySessionStateShowing && s.asksBack) ||
|
||||
s is StudySessionStateNothing,
|
||||
);
|
||||
expect(turned, isA<StudySessionStateShowing>());
|
||||
expect(
|
||||
(turned as StudySessionStateShowing).card.content.front,
|
||||
text('猫'),
|
||||
);
|
||||
});
|
||||
});
|
||||
|
||||
test('newest first takes the studyset backwards', () async {
|
||||
await cards.create('japanese', card('猫'));
|
||||
await cards.create('japanese', card('犬'));
|
||||
|
|
|
|||
Loading…
Reference in a new issue