diff --git a/tests/Unit/Services/ConversionCostEstimatorTest.php b/tests/Unit/Services/ConversionCostEstimatorTest.php index 5954fe6..24329a2 100644 --- a/tests/Unit/Services/ConversionCostEstimatorTest.php +++ b/tests/Unit/Services/ConversionCostEstimatorTest.php @@ -23,3 +23,21 @@ expect($cost->amount)->toBe(1); }); + +it('estimates image to pdf conversion as two credits', function () { + $file = FileRecord::factory()->png()->make(['user_id' => 1]); + $converter = app(ConverterRegistry::class)->find('png', 'pdf'); + + $cost = app(ConversionCostEstimator::class)->estimate($file, $converter, []); + + expect($cost->amount)->toBe(2); +}); + +it('estimates jpg to pdf conversion as two credits', function () { + $file = FileRecord::factory()->jpg()->make(['user_id' => 1]); + $converter = app(ConverterRegistry::class)->find('jpg', 'pdf'); + + $cost = app(ConversionCostEstimator::class)->estimate($file, $converter, []); + + expect($cost->amount)->toBe(2); +});