delete only howdy share links in demo mode

This commit is contained in:
Čarodej
2022-04-04 17:49:18 +02:00
parent 3d9272b05e
commit 80b2371868
2 changed files with 50 additions and 1 deletions

View File

@@ -0,0 +1,41 @@
<?php
namespace Tests\Support\Demo;
use App\Users\Models\User;
use Domain\Sharing\Models\Share;
use Support\Demo\Actions\DeleteAllSharedLinksAction;
use Tests\TestCase;
class DemoTest extends TestCase
{
/**
* @test
*/
public function it_delete_howdy_shared_links()
{
$user = User::factory()
->hasSettings()
->create();
$howdy = User::factory()
->hasSettings()
->create([
'email' => 'howdy@hi5ve.digital',
]);
Share::factory()
->create(['user_id' => $user->id]);
Share::factory()
->create(['user_id' => $howdy->id]);
resolve(DeleteAllSharedLinksAction::class)();
$this->assertDatabaseHas('shares', [
'user_id' => $user->id,
])->assertDatabaseMissing('shares', [
'user_id' => $howdy->id,
]);
}
}