7e6b203a02
Bundle web bootstrap, icons, local font fallbacks and hosting instructions. Add optimized WebP/MP3 packaging, asset checks and a browser narration regression tool. Support browser audio handoff and ad-free explained hints. Refresh the responsive bookshelf and reduce unnecessary app, narration and paper repaint work. Preserve deliberate page swipes while tolerating small mouse movements during cell and navigation clicks. Validation: all 77 Flutter tests pass; shell, JavaScript and Python scripts parse; locale and web manifests are valid JSON; git diff --check passes.
38 lines
1.2 KiB
Dart
38 lines
1.2 KiB
Dart
import 'package:flutter/material.dart';
|
|
import 'package:flutter_test/flutter_test.dart';
|
|
import 'package:lumen/ui/paper.dart';
|
|
|
|
void main() {
|
|
testWidgets('paper raster layer stays within the viewport on large screens', (
|
|
tester,
|
|
) async {
|
|
tester.view.devicePixelRatio = 1;
|
|
addTearDown(tester.view.reset);
|
|
for (final viewport in [
|
|
const Size(1920, 1080),
|
|
const Size(3840, 2160),
|
|
const Size(390, 844),
|
|
]) {
|
|
tester.view.physicalSize = viewport;
|
|
await tester.pumpWidget(
|
|
const MaterialApp(home: Paper(child: SizedBox.expand())),
|
|
);
|
|
await tester.pumpAndSettle();
|
|
final image = find.image(
|
|
const AssetImage('assets/artwork/mara-single-page-v2.png'),
|
|
);
|
|
final bounds = tester.getRect(image);
|
|
expect(bounds.left, greaterThanOrEqualTo(0));
|
|
expect(bounds.top, greaterThanOrEqualTo(0));
|
|
expect(bounds.right, lessThanOrEqualTo(viewport.width));
|
|
expect(bounds.bottom, lessThanOrEqualTo(viewport.height));
|
|
if (viewport.width > viewport.height) {
|
|
expect(bounds.size, viewport);
|
|
expect(tester.widget<Image>(image).fit, BoxFit.cover);
|
|
} else {
|
|
expect(bounds.size, const Size(390, 585));
|
|
}
|
|
}
|
|
});
|
|
}
|