Skip to content

Commit

Permalink
optimize test pay component
Browse files Browse the repository at this point in the history
  • Loading branch information
alifaraun committed Sep 22, 2022
1 parent 5757e86 commit db10715
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions tests/Feature/PayTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,15 @@

namespace MoamalatPay\Tests\Feature;

use Illuminate\Support\Facades\Blade;
use MoamalatPay\Pay;
use MoamalatPay\Tests\TestCase;
use MoamalatPay\View\Components\Pay as ComponentsPay;
use Illuminate\Foundation\Testing\Concerns\InteractsWithViews;

class PayTest extends TestCase
{

use InteractsWithViews;


/**
* Test config.
Expand All @@ -36,10 +37,9 @@ public function test_render()
*/
public function test_component()
{
$blade = (new ComponentsPay())->render()->render();
$this->assertStringContainsString('class MoamalataPay', $blade);
$this->assertStringContainsString('let _moamalatPay = new MoamalataPay(', $blade);
$this->assertStringNotContainsString('_moamalatPay.pay(', $blade);
$this->assertStringNotContainsString("_moamalatPay.pay(1000, '');", $blade);
$view = $this->blade('<x-moamalat-pay amount="1000" />');
$view->assertSeeText('class MoamalataPay');
$view->assertSeeText('let _moamalatPay = new MoamalataPay(');
$view->assertSeeText('_moamalatPay.pay(1000, "");', false);
}
}

0 comments on commit db10715

Please sign in to comment.