Skip to content

A free open source IT asset/license management system

Updated tests

snipec1601b9a8c8a
diff --git a/tests/Feature/Modals/Ui/ShowModalsTest.php b/tests/Feature/Modals/Ui/ShowModalsTest.php
index 308460999f..6da781d319 100644
--- a/tests/Feature/Modals/Ui/ShowModalsTest.php
+++ b/tests/Feature/Modals/Ui/ShowModalsTest.php
@@ -9,9 +9,15 @@ class ShowModalsTest extends TestCase
{
public function testUserModalRenders()
{
- $this->actingAs(User::factory()->createUsers()->create())
+ $admin = User::factory()->createUsers()->create();
+ $response = $this->actingAs($admin)
->get('modals/user')
->assertOk();
+
+ $response->assertStatus(200);
+ $response->assertDontSee($admin->first_name);
+ $response->assertDontSee($admin->last_name);
+ $response->assertDontSee($admin->email);
}
public function testDepartmentModalRenders()
diff --git a/tests/Feature/Users/Ui/CreateUserTest.php b/tests/Feature/Users/Ui/CreateUserTest.php
index 63d27d3d1c..456190ee3e 100644
--- a/tests/Feature/Users/Ui/CreateUserTest.php
+++ b/tests/Feature/Users/Ui/CreateUserTest.php
@@ -9,8 +9,12 @@ class CreateUserTest extends TestCase
{
public function testPageRenders()
{
- $this->actingAs(User::factory()->superuser()->create())
+ $admin = User::factory()->createUsers()->create();
+ $response = $this->actingAs(User::factory()->superuser()->create())
->get(route('users.create'))
->assertOk();
+ $response->assertDontSee($admin->first_name);
+ $response->assertDontSee($admin->last_name);
+ $response->assertDontSee($admin->email);
}
}