forked from eatvio/eatvio_app
fix: issue-372, issue-227, issue-406
This commit is contained in:
@@ -85,4 +85,27 @@ void main() {
|
||||
expect(image.fit, BoxFit.fitWidth);
|
||||
});
|
||||
});
|
||||
|
||||
testWidgets('empty cover does not reserve media height', (tester) async {
|
||||
await tester.pumpWidget(wrap(media(images: const [], imageUrl: '')));
|
||||
await tester.pump();
|
||||
|
||||
expect(find.byType(CachedNetworkImage), findsNothing);
|
||||
expect(tester.getSize(find.byType(BlogPostMediaContent)).height, 0);
|
||||
});
|
||||
|
||||
testWidgets('placeholder cover does not reserve media height', (tester) async {
|
||||
await tester.pumpWidget(
|
||||
wrap(
|
||||
media(
|
||||
images: const [],
|
||||
imageUrl: 'images/element-image-placeholder.svg',
|
||||
),
|
||||
),
|
||||
);
|
||||
await tester.pump();
|
||||
|
||||
expect(find.byType(CachedNetworkImage), findsNothing);
|
||||
expect(tester.getSize(find.byType(BlogPostMediaContent)).height, 0);
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user