fix: import unpublished exam rooms and add opt-in school HTML feedback
This commit is contained in:
@@ -33,6 +33,31 @@ class FakeFeedbackHttpTransport implements FeedbackHttpTransport {
|
||||
}
|
||||
|
||||
void main() {
|
||||
test('HTML diagnostics use independent attachment field with an immutable payload', () async {
|
||||
final transport = FakeFeedbackHttpTransport();
|
||||
final html = Uint8List.fromList(
|
||||
utf8.encode('<!doctype html><!-- TPSchedule school diagnostic -->'),
|
||||
);
|
||||
final submission = FeedbackSubmission.problem(
|
||||
id: 'same-id',
|
||||
message: '无法导入',
|
||||
diagnosticHtml: html,
|
||||
);
|
||||
html.fillRange(0, html.length, 0);
|
||||
await HttpFeedbackSender(
|
||||
endpoint: 'https://example.com/v1/feedback',
|
||||
transport: transport,
|
||||
).send(submission);
|
||||
final body = utf8.decode(transport.body!);
|
||||
expect(
|
||||
body,
|
||||
contains(
|
||||
'name="diagnostic_html"; filename="TPSchedule-school-page.html"',
|
||||
),
|
||||
);
|
||||
expect(body, contains('TPSchedule school diagnostic'));
|
||||
expect(submission.attachments, isEmpty);
|
||||
});
|
||||
test(
|
||||
'old feedback service gets a specific diagnostic-upgrade hint',
|
||||
() async {
|
||||
|
||||
Reference in New Issue
Block a user