Add approve-and-live action for Live Show
This commit is contained in:
@@ -54,6 +54,33 @@ class LiveShowPhotoControllerTest extends TenantTestCase
|
||||
$response->assertJsonPath('error.code', 'photo_not_approved');
|
||||
}
|
||||
|
||||
public function test_live_show_approve_and_live_updates_gallery_and_live_status(): void
|
||||
{
|
||||
$event = Event::factory()->for($this->tenant)->create([
|
||||
'slug' => 'live-show-approve-live',
|
||||
]);
|
||||
|
||||
$photo = Photo::factory()->for($event)->create([
|
||||
'status' => 'pending',
|
||||
'live_status' => PhotoLiveStatus::PENDING,
|
||||
]);
|
||||
|
||||
$response = $this->authenticatedRequest(
|
||||
'POST',
|
||||
"/api/v1/tenant/events/{$event->slug}/live-show/photos/{$photo->id}/approve-and-live",
|
||||
['priority' => 9]
|
||||
);
|
||||
|
||||
$response->assertOk();
|
||||
$this->assertDatabaseHas('photos', [
|
||||
'id' => $photo->id,
|
||||
'status' => 'approved',
|
||||
'moderated_by' => $this->tenantUser->id,
|
||||
'live_status' => PhotoLiveStatus::APPROVED->value,
|
||||
'live_priority' => 9,
|
||||
]);
|
||||
}
|
||||
|
||||
public function test_live_show_approve_reject_and_clear_workflow(): void
|
||||
{
|
||||
$event = Event::factory()->for($this->tenant)->create([
|
||||
|
||||
Reference in New Issue
Block a user