feat(app): turn documents in the artifact gallery
This commit is contained in:
@@ -515,4 +515,42 @@ void main() {
|
||||
// The viewer and its markdown add no Material control to a Cupertino host.
|
||||
expect(find.byType(Material), findsNothing);
|
||||
});
|
||||
|
||||
testWidgets('Material paging stays inside 320px at 2x text', (tester) async {
|
||||
tester.view.physicalSize = const Size(640, 1200);
|
||||
tester.view.devicePixelRatio = 2;
|
||||
tester.platformDispatcher.textScaleFactorTestValue = 2;
|
||||
addTearDown(tester.view.resetPhysicalSize);
|
||||
addTearDown(tester.view.resetDevicePixelRatio);
|
||||
addTearDown(tester.platformDispatcher.clearTextScaleFactorTestValue);
|
||||
|
||||
final first = recordedArtifact(
|
||||
'a.png',
|
||||
url: '/artifacts/1/1/a.png',
|
||||
contentType: 'image/png',
|
||||
);
|
||||
final second = recordedArtifact(
|
||||
'b.png',
|
||||
url: '/artifacts/1/2/b.png',
|
||||
contentType: 'image/png',
|
||||
);
|
||||
final groups = [
|
||||
_group([first], visit: 1),
|
||||
_group([second], visit: 2),
|
||||
];
|
||||
await _pumpViewer(
|
||||
tester,
|
||||
groups: groups,
|
||||
selected: artifactVisitIdentity(groups[0], first),
|
||||
);
|
||||
|
||||
expect(tester.takeException(), isNull);
|
||||
// Both labelled controls are whole: a clipped Row overflowed the viewport.
|
||||
for (final label in ['Previous artifact', 'Next artifact']) {
|
||||
final rect = tester.getRect(find.text(label));
|
||||
expect(rect.left, greaterThanOrEqualTo(0), reason: label);
|
||||
expect(rect.right, lessThanOrEqualTo(320), reason: label);
|
||||
expect(rect.width, greaterThan(0), reason: label);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user