diff --git a/resources/views/portal/ninja2020/quotes/show.blade.php b/resources/views/portal/ninja2020/quotes/show.blade.php index 380242d429..46ddef487c 100644 --- a/resources/views/portal/ninja2020/quotes/show.blade.php +++ b/resources/views/portal/ninja2020/quotes/show.blade.php @@ -19,10 +19,12 @@ @endcomponent @endif - @if(!$quote->isApproved()) + @if($quote->status_id === \App\Models\Quote::STATUS_SENT)
@include('portal.ninja2020.quotes.includes.actions', ['quote' => $quote])
+ @else +

{{ ctrans('texts.quotes_with_status_sent_can_be_approved') }}

@endif @include('portal.ninja2020.components.entity-documents', ['entity' => $quote]) diff --git a/tests/Browser/ClientPortal/QuotesTest.php b/tests/Browser/ClientPortal/QuotesTest.php index 2a294eca2e..189352be5f 100644 --- a/tests/Browser/ClientPortal/QuotesTest.php +++ b/tests/Browser/ClientPortal/QuotesTest.php @@ -70,6 +70,17 @@ class QuotesTest extends DuskTestCase } public function testQuotesWithSentStatusCanOnlyBeApproved() + { + $this->browse(function (Browser $browser) { + $browser + ->visitRoute('client.quotes.index') + ->clickLink('View') + ->assertSee('Only quotes with "Sent" status can be approved.') + ->visitRoute('client.logout'); + }); + } + + public function testMessageForNonApprovableQuotesIsVisible() { $this->browse(function (Browser $browser) { $browser @@ -78,6 +89,7 @@ class QuotesTest extends DuskTestCase ->press('Approve') ->assertPathIs('/client/quotes') ->assertDontSee('Quote(s) approved successfully.') + ->assertSee('Only quotes with "Sent" status can be approved.') ->visitRoute('client.logout'); }); }