feat: 完善听力口语辅助状态记录、练习分块与复习抽查间隔机制
This commit is contained in:
@@ -136,9 +136,9 @@ void main() {
|
||||
);
|
||||
await tester.enterText(find.byType(TextField), 'I am from Chna');
|
||||
await tester.pump();
|
||||
final aiButton = find.text('AI 检查语法和拼写(可选)');
|
||||
await tester.ensureVisible(aiButton);
|
||||
await tester.tap(aiButton);
|
||||
final submit = find.text('检查并提交');
|
||||
await tester.ensureVisible(submit);
|
||||
await tester.tap(submit);
|
||||
await tester.runAsync(
|
||||
() => Future<void>.delayed(const Duration(milliseconds: 50)),
|
||||
);
|
||||
@@ -161,12 +161,42 @@ void main() {
|
||||
|
||||
expect(find.text('· Chna 拼写应为 China'), findsOneWidget);
|
||||
expect(find.text('参考改正:I am from China.'), findsOneWidget);
|
||||
final submit = find.text('带提示完成');
|
||||
expect(submit, findsOneWidget);
|
||||
await tester.ensureVisible(submit);
|
||||
await tester.tap(submit);
|
||||
expect(state.attemptEvidence, isEmpty);
|
||||
await tester.enterText(find.byType(TextField), 'I am from China.');
|
||||
await tester.pump();
|
||||
|
||||
final submit = find.text('带提示完成');
|
||||
await http.runWithClient(
|
||||
() async {
|
||||
await tester.ensureVisible(submit);
|
||||
await tester.tap(submit);
|
||||
await tester.runAsync(
|
||||
() => Future<void>.delayed(const Duration(milliseconds: 50)),
|
||||
);
|
||||
await tester.pump();
|
||||
},
|
||||
() => MockClient(
|
||||
(request) async => http.Response(
|
||||
jsonEncode({
|
||||
'choices': [
|
||||
{
|
||||
'message': {
|
||||
'content': jsonEncode({
|
||||
'schemaVersion': 'writing-feedback-1',
|
||||
'verdict': 'accepted',
|
||||
'feedback': '表达正确。',
|
||||
'suggestion': null,
|
||||
'missing': <String>[],
|
||||
'lessonId': 'A0-P12',
|
||||
}),
|
||||
},
|
||||
},
|
||||
],
|
||||
}),
|
||||
200,
|
||||
headers: {'content-type': 'application/json; charset=utf-8'},
|
||||
),
|
||||
),
|
||||
);
|
||||
expect(state.attemptEvidence.single.outcome, EvidenceKind.assisted);
|
||||
expect(state.attemptEvidence.single.assisted, isTrue);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user