Fix school browser initialization and redirect detection; improve diagnostics
This commit is contained in:
@@ -33,6 +33,39 @@ class FakeFeedbackHttpTransport implements FeedbackHttpTransport {
|
||||
}
|
||||
|
||||
void main() {
|
||||
test(
|
||||
'old feedback service gets a specific diagnostic-upgrade hint',
|
||||
() async {
|
||||
final transport = FakeFeedbackHttpTransport()
|
||||
..response = FeedbackHttpResponse(
|
||||
422,
|
||||
utf8.encode(
|
||||
'{"error":"validation_error","detail":"Unexpected file field."}',
|
||||
),
|
||||
);
|
||||
await expectLater(
|
||||
HttpFeedbackSender(
|
||||
endpoint: 'https://example.com/v1/feedback',
|
||||
transport: transport,
|
||||
).send(
|
||||
FeedbackSubmission.problem(
|
||||
id: 'same-id',
|
||||
message: '问题',
|
||||
diagnosticLog: Uint8List.fromList(
|
||||
utf8.encode('TPSchedule diagnostic log\n'),
|
||||
),
|
||||
),
|
||||
),
|
||||
throwsA(
|
||||
isA<FeedbackException>().having(
|
||||
(e) => e.message,
|
||||
'upgrade hint',
|
||||
allOf(contains('日志'), contains('更新')),
|
||||
),
|
||||
),
|
||||
);
|
||||
},
|
||||
);
|
||||
test('diagnostics use a separate UTF8 attachment field', () async {
|
||||
final transport = FakeFeedbackHttpTransport();
|
||||
await HttpFeedbackSender(
|
||||
|
||||
Reference in New Issue
Block a user