Retry Montzar orders after refreshing a stale quote.
When the partner rejects with a mazaneh-changed error, pull the live quote and submit once more so the customer buy can succeed without a page refresh. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -0,0 +1,25 @@
|
||||
<?php
|
||||
|
||||
namespace Tests\Unit;
|
||||
|
||||
use App\Services\MontzarService;
|
||||
use PHPUnit\Framework\TestCase;
|
||||
|
||||
class MontzarQuoteChangedTest extends TestCase
|
||||
{
|
||||
public function test_detects_persian_quote_changed_toast(): void
|
||||
{
|
||||
$this->assertTrue(MontzarService::isQuoteChangedMessage('تغییر در مظنه !'));
|
||||
$this->assertTrue(MontzarService::isQuoteChangedMessage('تغيير در مظنه'));
|
||||
$this->assertTrue(MontzarService::isQuoteChangedMessage('مظنه تغییر کرده است'));
|
||||
$this->assertTrue(MontzarService::isQuoteChangedMessage('Quote changed'));
|
||||
}
|
||||
|
||||
public function test_ignores_unrelated_messages(): void
|
||||
{
|
||||
$this->assertFalse(MontzarService::isQuoteChangedMessage(null));
|
||||
$this->assertFalse(MontzarService::isQuoteChangedMessage(''));
|
||||
$this->assertFalse(MontzarService::isQuoteChangedMessage('موجودی شما کمتر از میزان سفارش است'));
|
||||
$this->assertFalse(MontzarService::isQuoteChangedMessage('سفارشات توسط ارائه دهنده بسته شده است.'));
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user