1
0
mirror of https://github.com/invoiceninja/invoiceninja.git synced 2024-11-13 06:32:40 +01:00

Show 'No quotes avialable for download' instead of blank page

This commit is contained in:
Benjamin Beganović 2021-07-14 14:33:17 +02:00
parent 7f7120af6b
commit 033e74da7d
3 changed files with 14 additions and 1 deletions

View File

@ -85,7 +85,9 @@ class QuoteController extends Controller
->get();
if (! $quotes || $quotes->count() == 0) {
return;
return redirect()
->route('client.quotes.index')
->with('message', ctrans('texts.no_quotes_available_for_download'));
}
if ($quotes->count() == 1) {

View File

@ -4279,6 +4279,7 @@ $LANG = array(
'recurring_purchases' => 'Recurring purchases',
'you_might_be_interested_in_following' => 'You might be interested in following',
'quotes_with_status_sent_can_be_approved' => 'Only quotes with "Sent" status can be approved.',
'no_quotes_available_for_download' => 'No quotes available for download.',
);
return $LANG;

View File

@ -93,4 +93,14 @@ class QuotesTest extends DuskTestCase
->visitRoute('client.logout');
});
}
public function testNoQuotesAvailableForDownloadMessage()
{
$this->browse(function (Browser $browser) {
$browser
->visitRoute('client.quotes.index')
->press('Download')
->assertSee('No quotes available for download.');
});
}
}