fix: import unpublished exam rooms and add opt-in school HTML feedback

This commit is contained in:
Codex
2026-10-16 16:38:00 +08:00
parent defe7fd50e
commit 437ed14dbe
31 changed files with 969 additions and 39 deletions
@@ -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 {