Files
pipelines/app/test/features/artifacts/ui/artifact_thumbnail_image_test.dart
T
alan 7b1455631b Rebuild only changed list rows and lay out big artifact sections lazily
Runs and chat session rows are memoized on their own data (MemoSubtree), so
a run event or a chat's running change rebuilds one row instead of every
built row. The artifact gallery's open sections are lazy slivers revealed
by a sliver open/close animation, and thumbnails decode at display size.
Benches in test/perf measure both.
2026-11-02 00:08:29 +00:00

19 lines
786 B
Dart

import 'package:flutter_test/flutter_test.dart';
import 'package:pipelines_app/features/artifacts/ui/artifact_thumbnail_image.dart';
void main() {
test('decodes a large picture just big enough to cover its box', () {
// Landscape into a square: the height binds, the width overflows.
final wide = coverTargetSize(4000, 2000, width: 200, height: 200);
expect((wide.width, wide.height), (400, 200));
// Portrait into a 4:3 tile: the width binds.
final tall = coverTargetSize(1000, 3000, width: 400, height: 300);
expect((tall.width, tall.height), (400, 1200));
});
test('never upscales a picture smaller than its box', () {
final small = coverTargetSize(100, 80, width: 200, height: 200);
expect((small.width, small.height), (null, null));
});
}