Skip to content

Commit f90dd9d

Browse files
authored
Merge pull request #15976 from marcusmoore/testing/ui-render
Added simple front end render tests
2 parents 8d24c0a + a539769 commit f90dd9d

File tree

70 files changed

+905
-4
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

70 files changed

+905
-4
lines changed

database/factories/GroupFactory.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ public function definition()
2323
{
2424
return [
2525
'name' => $this->faker->name(),
26+
'permissions' => json_encode([]),
2627
];
2728
}
2829
}

tests/Feature/Accessories/Ui/AccessoriesIndexTest.php

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,11 @@ public function testPermissionRequiredToViewAccessoryList()
1313
->get(route('accessories.index'))
1414
->assertForbidden();
1515
}
16+
17+
public function testPageRenders()
18+
{
19+
$this->actingAs(User::factory()->superuser()->create())
20+
->get(route('accessories.index'))
21+
->assertOk();
22+
}
1623
}
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
<?php
2+
3+
namespace Tests\Feature\Accessories\Ui;
4+
5+
use App\Models\Accessory;
6+
use App\Models\User;
7+
use Tests\TestCase;
8+
9+
class EditAccessoryTest extends TestCase
10+
{
11+
public function testPageRenders()
12+
{
13+
$this->actingAs(User::factory()->superuser()->create())
14+
->get(route('accessories.edit', Accessory::factory()->create()->id))
15+
->assertOk();
16+
}
17+
}
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
<?php
2+
3+
namespace Tests\Feature\Accessories\Ui;
4+
5+
use App\Models\Accessory;
6+
use App\Models\User;
7+
use Tests\TestCase;
8+
9+
class ShowAccessoryTest extends TestCase
10+
{
11+
public function testPageRenders()
12+
{
13+
$this->actingAs(User::factory()->superuser()->create())
14+
->get(route('accessories.show', Accessory::factory()->create()->id))
15+
->assertOk();
16+
}
17+
}
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
<?php
2+
3+
namespace Tests\Feature\AssetMaintenances\Ui;
4+
5+
use App\Models\User;
6+
use Tests\TestCase;
7+
8+
class AssetMaintenanceIndexTest extends TestCase
9+
{
10+
public function testPageRenders()
11+
{
12+
$this->actingAs(User::factory()->superuser()->create())
13+
->get(route('maintenances.index'))
14+
->assertOk();
15+
}
16+
}
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
<?php
2+
3+
namespace Tests\Feature\AssetMaintenances\Ui;
4+
5+
use App\Models\User;
6+
use Tests\TestCase;
7+
8+
class CreateAssetMaintenanceTest extends TestCase
9+
{
10+
public function testPageRenders()
11+
{
12+
$this->actingAs(User::factory()->superuser()->create())
13+
->get(route('maintenances.create'))
14+
->assertOk();
15+
}
16+
}
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
<?php
2+
3+
namespace Tests\Feature\AssetMaintenances\Ui;
4+
5+
use App\Models\AssetMaintenance;
6+
use App\Models\User;
7+
use Tests\TestCase;
8+
9+
class EditAssetMaintenanceTest extends TestCase
10+
{
11+
public function testPageRenders()
12+
{
13+
$this->actingAs(User::factory()->superuser()->create())
14+
->get(route('maintenances.edit', AssetMaintenance::factory()->create()->id))
15+
->assertOk();
16+
}
17+
}
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
<?php
2+
3+
namespace Tests\Feature\AssetMaintenances\Ui;
4+
5+
use App\Models\AssetMaintenance;
6+
use App\Models\User;
7+
use Tests\TestCase;
8+
9+
class ShowAssetMaintenanceTest extends TestCase
10+
{
11+
public function testPageRenders()
12+
{
13+
$this->actingAs(User::factory()->superuser()->create())
14+
->get(route('maintenances.show', AssetMaintenance::factory()->create()->id))
15+
->assertOk();
16+
}
17+
}

tests/Feature/AssetModels/Ui/CreateAssetModelsTest.php

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,13 @@ public function testPermissionRequiredToCreateAssetModel()
1919
->assertForbidden();
2020
}
2121

22+
public function testPageRenders()
23+
{
24+
$this->actingAs(User::factory()->superuser()->create())
25+
->get(route('models.create'))
26+
->assertOk();
27+
}
28+
2229
public function testUserCanCreateAssetModels()
2330
{
2431
$this->assertFalse(AssetModel::where('name', 'Test Model')->exists());
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
<?php
2+
3+
namespace Tests\Feature\AssetModels\Ui;
4+
5+
use App\Models\AssetModel;
6+
use App\Models\User;
7+
use Tests\TestCase;
8+
9+
class ShowAssetModelsTest extends TestCase
10+
{
11+
public function testPageRenders()
12+
{
13+
$this->actingAs(User::factory()->superuser()->create())
14+
->get(route('models.show', AssetModel::factory()->create()->id))
15+
->assertOk();
16+
}
17+
}

0 commit comments

Comments
 (0)