ANDREAS_LATANOWSKY_CPD_1910877/test/widget_test.dart

22 lines
768 B
Dart
Raw Normal View History

2023-11-21 19:48:58 +01:00
import 'package:cpd_app/image_uploader.dart';
2023-11-21 02:29:46 +01:00
import 'package:flutter_test/flutter_test.dart';
void main() {
2023-11-21 19:48:58 +01:00
TestWidgetsFlutterBinding.ensureInitialized();
test('Test OCR functionality', () async {
final ImageUploader imageUploader = ImageUploader();
String imageName = "lorem.png";
var img = await imageUploader.buildImageFile(imageName);
assert(img.lengthInBytes > 0);
// momentan auskommentiert, weil das pathproviderplugin irgentwie gemockt werden muss und ich es noch nicht hinbekommen habe
//mock response, weil man keine http requests in tests machen kann
// String mockResponse = "eng";
// String text = await imageUploader.performOcr(img, imageName, mockResponse);
// assert(text.contains("Lorem ipsum"));
2023-11-21 02:29:46 +01:00
});
}