diff --git a/tests/Feature/Assets/Ui/CloneAssetTest.php b/tests/Feature/Assets/Ui/CloneAssetTest.php new file mode 100644 index 0000000000..ad06561d19 --- /dev/null +++ b/tests/Feature/Assets/Ui/CloneAssetTest.php @@ -0,0 +1,37 @@ +create(); + $this->actingAs(User::factory()->create()) + ->get(route('clone/hardware', $asset)) + ->assertForbidden(); + } + + public function testPageCanBeAccessed(): void + { + $asset = Asset::factory()->create(); + $response = $this->actingAs(User::factory()->createAssets()->create()) + ->get(route('clone/hardware', $asset)); + $response->assertStatus(200); + } + + public function testAssetCanBeCloned() + { + $asset_to_clone = Asset::factory()->create(['name'=>'Asset to clone']); + $this->actingAs(User::factory()->createAssets()->create()) + ->get(route('clone/hardware', $asset_to_clone)) + ->assertOk() + ->assertSee([ + 'Asset to clone' + ], false);; + } +}