mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2024-11-10 13:12:50 +01:00
Show 'Only quotes with "Sent" status can be approved.' for non-approvable quotes
This commit is contained in:
parent
a9ac73264e
commit
7f7120af6b
@ -19,10 +19,12 @@
|
||||
@endcomponent
|
||||
@endif
|
||||
|
||||
@if(!$quote->isApproved())
|
||||
@if($quote->status_id === \App\Models\Quote::STATUS_SENT)
|
||||
<div class="mb-4">
|
||||
@include('portal.ninja2020.quotes.includes.actions', ['quote' => $quote])
|
||||
</div>
|
||||
@else
|
||||
<p class="text-right text-gray-900 text-sm mb-4">{{ ctrans('texts.quotes_with_status_sent_can_be_approved') }}</p>
|
||||
@endif
|
||||
|
||||
@include('portal.ninja2020.components.entity-documents', ['entity' => $quote])
|
||||
|
@ -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');
|
||||
});
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user