Skip to content

Commit

Permalink
test fix (openfoodfacts#285)
Browse files Browse the repository at this point in the history
Impacted files:
* `api_addProductImage_test.dart`: renamed tests
* `api_saveProduct_test.dart`: added a specifically larger time out for a slow test
* `corn_da.jpg`: reduced the size from 4000x3000 (2.5Mb) to 1000x750 (200Kb) as it seemed to be problematic, while size was not part of the test
  • Loading branch information
monsieurtanuki authored Oct 29, 2021
1 parent 3a5211d commit a4d3c36
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 3 deletions.
5 changes: 3 additions & 2 deletions test/api_addProductImage_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ void main() {
expect(status.error, 'Dieses Foto wurde schon hochgeladen.');
});

test('add ingredients image test', () async {
test('add ingredients image test 1', () async {
SendImage image = SendImage(
lang: OpenFoodFactsLanguage.ENGLISH,
barcode: '0048151623426',
Expand All @@ -40,7 +40,8 @@ void main() {
expect(status.error, 'This picture has already been sent.');
});

test('add ingredients image test', () async {
// TODO(monsieurtanuki): test with a bigger pic used to crash (4000x3000, 2.5Mb)
test('add ingredients image test 2', () async {
SendImage image = SendImage(
lang: OpenFoodFactsLanguage.DANISH,
barcode: '5722970900207',
Expand Down
6 changes: 5 additions & 1 deletion test/api_saveProduct_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,11 @@ void main() {
);

testProductResult1(result2);
});
},
timeout: Timeout(
// this guy is rather slow
Duration(seconds: 90),
));

test('dont overwrite language', () async {
String barcode = '4008391212596';
Expand Down
Binary file modified test/test_assets/corn_da.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit a4d3c36

Please sign in to comment.