From e0885e2567a5f5b1350c322ede3039ccc6b6f8ec Mon Sep 17 00:00:00 2001 From: Lucas Date: Mon, 9 Dec 2024 09:17:07 +0800 Subject: [PATCH] fix: image tests (#6928) --- .../document_with_image_block_test.dart | 39 +++++++++++++------ 1 file changed, 27 insertions(+), 12 deletions(-) diff --git a/frontend/appflowy_flutter/integration_test/desktop/document/document_with_image_block_test.dart b/frontend/appflowy_flutter/integration_test/desktop/document/document_with_image_block_test.dart index c6fb6f72934de..382a9d91340e6 100644 --- a/frontend/appflowy_flutter/integration_test/desktop/document/document_with_image_block_test.dart +++ b/frontend/appflowy_flutter/integration_test/desktop/document/document_with_image_block_test.dart @@ -24,13 +24,6 @@ import 'package:run_with_network_images/run_with_network_images.dart'; import '../../shared/mock/mock_file_picker.dart'; import '../../shared/util.dart'; -const _testImageUrls = [ - 'https://images.unsplash.com/photo-1469474968028-56623f02e42e?ixlib=rb-4.0.3&q=85&fm=jpg&crop=entropy&cs=srgb&dl=david-marcu-78A265wPiO4-unsplash.jpg&w=640', - 'https://www.easygifanimator.net/images/samples/eglite.gif', - 'https://people.math.sc.edu/Burkardt/data/bmp/snail.bmp', - 'https://file-examples.com/storage/fe9566cb7d67345489a5a97/2017/10/file_example_JPG_100kB.jpg', -]; - void main() { IntegrationTestWidgetsFlutterBinding.ensureInitialized(); TestWidgetsFlutterBinding.ensureInitialized(); @@ -138,11 +131,33 @@ void main() { file.deleteSync(); }); - for (final url in _testImageUrls) { - testWidgets('insert an image from network: $url', (tester) async { - await testEmbedImage(tester, url); - }); - } + testWidgets('insert a gif image from network', (tester) async { + await testEmbedImage( + tester, + 'https://www.easygifanimator.net/images/samples/sparkles.gif', + ); + }); + + testWidgets('insert a jpg image from network', (tester) async { + await testEmbedImage( + tester, + 'https://file-examples.com/storage/fe9566cb7d67345489a5a97/2017/10/file_example_JPG_100kB.jpg', + ); + }); + + testWidgets('insert a bmp image from network', (tester) async { + await testEmbedImage( + tester, + 'https://people.math.sc.edu/Burkardt/data/bmp/snail.bmp', + ); + }); + + testWidgets('insert a jpg image from network', (tester) async { + await testEmbedImage( + tester, + 'https://images.unsplash.com/photo-1469474968028-56623f02e42e?ixlib=rb-4.0.3&q=85&fm=jpg&crop=entropy&cs=srgb&dl=david-marcu-78A265wPiO4-unsplash.jpg&w=640', + ); + }); testWidgets('insert an image from unsplash', (tester) async { await runWithNetworkImages(() async {