From 7b41f2dbd0fe8aa9566eb1d48751e675f7817b30 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Benjamin=20Beganovi=C4=87?= Date: Mon, 5 Jul 2021 10:04:11 +0200 Subject: [PATCH] Invoices: Test clicking "Pay Now" without selecting any invoices --- tests/Browser/ClientPortal/InvoicesTest.php | 22 ++++++++++++++++----- 1 file changed, 17 insertions(+), 5 deletions(-) diff --git a/tests/Browser/ClientPortal/InvoicesTest.php b/tests/Browser/ClientPortal/InvoicesTest.php index 6ad5bb004c..c909ff9e28 100644 --- a/tests/Browser/ClientPortal/InvoicesTest.php +++ b/tests/Browser/ClientPortal/InvoicesTest.php @@ -20,11 +20,23 @@ class InvoicesTest extends DuskTestCase public function testPageLoads() { $this->browse(function (Browser $browser) { - $browser - ->visit(new Login()) - ->auth() - ->visitRoute('client.invoices.index') - ->assertSee('Invoices'); + $browser + ->visit(new Login()) + ->auth() + ->visitRoute('client.invoices.index') + ->assertSee('Invoices'); + }); + } + + public function testClickingPayNowWithoutInvoices() + { + $this->browse(function (Browser $browser) { + $browser + ->visit(new Login()) + ->auth() + ->visitRoute('client.invoices.index') + ->press('Pay Now') + ->assertSee('No payable invoices selected. Make sure you are not trying to pay draft invoice or invoice with zero balance due.'); }); } }