diff --git a/tests/Browser/ClientPortal/QuotesTest.php b/tests/Browser/ClientPortal/QuotesTest.php index a6495be0b015..0a1164f7116f 100644 --- a/tests/Browser/ClientPortal/QuotesTest.php +++ b/tests/Browser/ClientPortal/QuotesTest.php @@ -44,7 +44,7 @@ class QuotesTest extends DuskTestCase }); } - public function testClickingApproveWithoutQuotes() + public function testClickingApproveWithoutQuotesDoesntWork() { $this->browse(function (Browser $browser) { $browser @@ -53,4 +53,32 @@ class QuotesTest extends DuskTestCase ->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'); + }); + } }