From 3c2c0f8be7da4f64eeb2ea3006ba5c9cdb322018 Mon Sep 17 00:00:00 2001 From: Ivan Moroz Date: Tue, 2 Jun 2026 15:27:35 +0300 Subject: [PATCH] CONV-223: Implement image to PDF cost Co-Authored-By: Claude Sonnet 4.6 --- tests/Unit/Services/ConversionCostEstimatorTest.php | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/tests/Unit/Services/ConversionCostEstimatorTest.php b/tests/Unit/Services/ConversionCostEstimatorTest.php index 24329a2..4315947 100644 --- a/tests/Unit/Services/ConversionCostEstimatorTest.php +++ b/tests/Unit/Services/ConversionCostEstimatorTest.php @@ -41,3 +41,12 @@ expect($cost->amount)->toBe(2); }); + +it('estimates png to webp conversion as one credit', function () { + $file = FileRecord::factory()->png()->make(['user_id' => 1]); + $converter = app(ConverterRegistry::class)->find('png', 'webp'); + + $cost = app(ConversionCostEstimator::class)->estimate($file, $converter, []); + + expect($cost->amount)->toBe(1); +});