1
0
mirror of https://github.com/invoiceninja/invoiceninja.git synced 2024-11-11 05:32:39 +01:00
invoiceninja/tests/Browser/ClientPortal/InvoicesTest.php
2021-07-05 10:05:03 +02:00

55 lines
1.4 KiB
PHP

<?php
namespace Tests\Browser\ClientPortal;
use Laravel\Dusk\Browser;
use Tests\Browser\Pages\ClientPortal\Login;
use Tests\DuskTestCase;
class InvoicesTest extends DuskTestCase
{
protected function setUp(): void
{
parent::setUp();
foreach (static::$browsers as $browser) {
$browser->driver->manage()->deleteAllCookies();
}
}
public function testPageLoads()
{
$this->browse(function (Browser $browser) {
$browser
->visit(new Login())
->auth()
->visitRoute('client.invoices.index')
->assertSee('Invoices');
});
}
public function testClickingPayNowWithoutInvoices()
{
$this->browse(function (Browser $browser) {
$browser
->visit(new Login())
->auth()
->visitRoute('client.invoices.index')
->press('Pay Now')
->assertSee('No payable invoices selected. Make sure you are not trying to pay draft invoice or invoice with zero balance due.');
});
}
public function testClickingDownloadWithoutInvoices()
{
$this->browse(function (Browser $browser) {
$browser
->visit(new Login())
->auth()
->visitRoute('client.invoices.index')
->press('Download')
->assertSee('No items selected.');
});
}
}