2021-10-04 13:40:16 +02:00
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace Tests\Browser\ClientPortal\Gateways\GoCardless;
|
|
|
|
|
2021-10-04 13:40:48 +02:00
|
|
|
use App\Models\CompanyGateway;
|
2021-10-04 13:40:16 +02:00
|
|
|
use Laravel\Dusk\Browser;
|
2021-10-04 13:40:48 +02:00
|
|
|
use Tests\Browser\Pages\ClientPortal\Login;
|
2021-10-04 13:40:16 +02:00
|
|
|
use Tests\DuskTestCase;
|
|
|
|
|
|
|
|
class ACHTest extends DuskTestCase
|
|
|
|
{
|
2021-10-04 13:40:48 +02:00
|
|
|
protected function setUp(): void
|
2021-10-04 13:40:16 +02:00
|
|
|
{
|
2021-10-04 13:40:48 +02:00
|
|
|
parent::setUp();
|
|
|
|
|
|
|
|
foreach (static::$browsers as $browser) {
|
|
|
|
$browser->driver->manage()->deleteAllCookies();
|
|
|
|
}
|
|
|
|
|
|
|
|
$this->disableCompanyGateways();
|
|
|
|
|
|
|
|
CompanyGateway::where('gateway_key', 'b9886f9257f0c6ee7c302f1c74475f6c')->restore();
|
|
|
|
|
2021-10-04 13:40:16 +02:00
|
|
|
$this->browse(function (Browser $browser) {
|
2021-10-04 13:40:48 +02:00
|
|
|
$browser
|
|
|
|
->visit(new Login())
|
|
|
|
->auth();
|
2021-10-04 13:40:16 +02:00
|
|
|
});
|
|
|
|
}
|
2021-10-04 13:44:57 +02:00
|
|
|
|
|
|
|
public function testPayingWithNoPreauthorizedIsntPossible()
|
|
|
|
{
|
|
|
|
$this->browse(function (Browser $browser) {
|
|
|
|
$browser
|
|
|
|
->visitRoute('client.invoices.index')
|
|
|
|
->click('@pay-now')
|
|
|
|
->press('Pay Now')
|
|
|
|
->clickLink('Bank Transfer')
|
|
|
|
->assertSee('To pay with a bank account, first you have to add it as payment method.');
|
|
|
|
});
|
|
|
|
}
|
2021-10-04 13:40:16 +02:00
|
|
|
}
|