diff --git a/tests/UserLoginTest.php b/tests/UserLoginTest.php index 703894e0..23c8f965 100644 --- a/tests/UserLoginTest.php +++ b/tests/UserLoginTest.php @@ -5,14 +5,14 @@ use Illuminate\Foundation\Testing\DatabaseMigrations; use Illuminate\Foundation\Testing\DatabaseTransactions; use App\Attendize\Utils; -class UserTest extends TestCase +class UserLoginTest extends TestCase { /** * Test login page is successful * * @return void */ - public function testLogin() + public function test_login_is_successful() { $this->visit(route('login')) ->type($this->test_user_email, 'email') @@ -20,4 +20,34 @@ class UserTest extends TestCase ->press('Login') ->seePageIs(route('showCreateOrganiser', ['first_run' => '1'])); } + + /** + * Test login page is unsuccessful with wrong password + * + * @return void + */ + public function test_login_is_unsuccessful_with_wrong_password() + { + $this->visit(route('login')) + ->type($this->test_user_email, 'email') + ->type('incorrect_password', 'password') + ->press('Login') + ->seePageIs(route('login')) + ->see('Your username/password combination was incorrect'); + } + + /** + * Test login page is unsuccessful with wrong email address + * + * @return void + */ + public function test_login_is_unsuccessful_with_wrong_email_address() + { + $this->visit(route('login')) + ->type('other@email.com', 'email') + ->type($this->test_user_password, 'password') + ->press('Login') + ->seePageIs(route('login')) + ->see('Your username/password combination was incorrect'); + } } diff --git a/tests/UserSignUpTest.php b/tests/UserSignUpTest.php index a9099cbc..8ffd8c4c 100644 --- a/tests/UserSignUpTest.php +++ b/tests/UserSignUpTest.php @@ -5,7 +5,7 @@ use Illuminate\Foundation\Testing\DatabaseMigrations; use Illuminate\Foundation\Testing\DatabaseTransactions; use App\Attendize\Utils; -class UserTest extends TestCase +class UserSignUpTest extends TestCase { /** * Test sign up page is successful