All checks were successful
CI / Windows build (push) Successful in 14m22s
Make Surface remote debugging and classroom workflows viable: always-on structured logs with one-click zip export, a single AppShell chrome, OOXML PPTX/DOCX annotation without LibreOffice, and a first-class sticky board. Also drop spike/legacy ink widgets and tighten pen feel (predictor, PenInfoHistory, page-tile layer). Co-authored-by: Cursor <cursoragent@cursor.com>
37 lines
1.1 KiB
Dart
37 lines
1.1 KiB
Dart
import 'package:flutter_test/flutter_test.dart';
|
|
|
|
import 'package:badnote/diagnostics/badnote_log.dart';
|
|
import 'package:badnote/diagnostics/pen_event_ring.dart';
|
|
import 'package:badnote/diagnostics/frame_sampler.dart';
|
|
|
|
void main() {
|
|
test('PenEventRing retains recent events', () {
|
|
final ring = PenEventRing.instance;
|
|
ring.clear();
|
|
ring.recordArbiter(
|
|
activeCount: 1,
|
|
deviceKind: 'stylus',
|
|
draw: true,
|
|
fingerDrawing: false,
|
|
);
|
|
expect(ring.recent(), isNotEmpty);
|
|
expect(ring.toJsonList().first['decision'], 'draw');
|
|
});
|
|
|
|
test('FrameSampler flags over-budget frames', () {
|
|
FrameSampler.instance.reset();
|
|
FrameSampler.instance.record('test', 8);
|
|
FrameSampler.instance.record('slow', 30);
|
|
expect(FrameSampler.instance.overBudget, 1);
|
|
expect(FrameSampler.instance.summary()['total'], 2);
|
|
});
|
|
|
|
test('BadNoteLog ring accepts entries without start', () {
|
|
BadNoteLog.instance.info(LogSubsystem.diag, 'unit_test_ping');
|
|
expect(
|
|
BadNoteLog.instance.snapshotRing().any((e) => e['msg'] == 'unit_test_ping'),
|
|
isTrue,
|
|
);
|
|
});
|
|
}
|