1
0
mirror of https://github.com/invoiceninja/invoiceninja.git synced 2024-11-10 13:12:50 +01:00

Quotes: Test approving process

This commit is contained in:
Benjamin Beganović 2021-07-05 13:57:28 +02:00
parent 1a5c40d02e
commit c81044994b

View File

@ -44,7 +44,7 @@ class QuotesTest extends DuskTestCase
}); });
} }
public function testClickingApproveWithoutQuotes() public function testClickingApproveWithoutQuotesDoesntWork()
{ {
$this->browse(function (Browser $browser) { $this->browse(function (Browser $browser) {
$browser $browser
@ -53,4 +53,32 @@ class QuotesTest extends DuskTestCase
->assertPathIs('/client/quotes'); ->assertPathIs('/client/quotes');
}); });
} }
public function testApprovingQuotes()
{
$this->browse(function (Browser $browser) {
$browser
->visitRoute('client.quotes.index')
->check('.form-check.form-check-child')
->press('Approve')
->assertPathIs('/client/quotes/approve')
->press('Approve')
->assertPathIs('/client/quotes')
->assertSee('Quote(s) approved successfully.')
->visitRoute('client.logout');
});
}
public function testQuotesWithSentStatusCanOnlyBeApproved()
{
$this->browse(function (Browser $browser) {
$browser
->visitRoute('client.quotes.index')
->check('.form-check.form-check-child')
->press('Approve')
->assertPathIs('/client/quotes')
->assertDontSee('Quote(s) approved successfully.')
->visitRoute('client.logout');
});
}
} }