Skip to content

Commit

Permalink
fix: #223 - deprecated method getIngredientSpellingCorrection (#627)
Browse files Browse the repository at this point in the history
* fix: #223 - deprecated method getIngredientSpellingCorrection

Impacted files:
* `api_getRobotoff_test.dart`: removed test related to `getIngredientSpellingCorrection`
* `openfoodfacts.dart`: deprecated method `getIngredientSpellingCorrection` that does not work

* fix: #223 - deprecated method getIngredientSpellingCorrection

Impacted files:
* `api_getRobotoff_test.dart`: removed test related to `getIngredientSpellingCorrection`
* `openfoodfacts.dart`: deprecated method `getIngredientSpellingCorrection` that does not work
  • Loading branch information
monsieurtanuki committed Nov 22, 2022
1 parent 8566fcf commit 9da441f
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 16 deletions.
2 changes: 2 additions & 0 deletions lib/openfoodfacts.dart
Original file line number Diff line number Diff line change
Expand Up @@ -720,6 +720,8 @@ class OpenFoodAPIClient {
return Status.fromApiResponse(response.body);
}

// TODO: deprecated from 2022-11-22; remove when old enough
@Deprecated('Unstable version, do not use and wait for the next version')
static Future<SpellingCorrection?> getIngredientSpellingCorrection({
String? ingredientName,
Product? product,
Expand Down
16 changes: 0 additions & 16 deletions test/api_getRobotoff_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -147,20 +147,4 @@ void main() {
expect(result.insights, isNull);
});
});

group('$OpenFoodAPIClient get robotoff ingredient spelling corrections', () {
test('get farine de blé spelling corrections', () async {
final SpellingCorrection? result =
await OpenFoodAPIClient.getIngredientSpellingCorrection(
user: TestConstants.TEST_USER,
ingredientName: 'fqrine de blé',
);

expect(result, isNotNull);
expect(result!.corrected, 'farine de blé');
expect(result.input, 'fqrine de blé');
expect(result.termCorrections!.length, 1);
expect(result.termCorrections![0].corrections, isNull);
});
}, skip: 'This Group of tests is unstable');
}

0 comments on commit 9da441f

Please sign in to comment.