mirror of
https://github.com/VueFileManager/vuefilemanager.git
synced 2026-04-18 08:12:15 +00:00
team invitation notification with broadcasting
This commit is contained in:
@@ -386,12 +386,11 @@ class FileTest extends TestCase
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* @test
|
||||
*/
|
||||
/**
|
||||
* @test
|
||||
*/
|
||||
public function it_store_file_exif_data_after_file_upload()
|
||||
{
|
||||
|
||||
$file = UploadedFile::fake()
|
||||
->image('fake-image.jpg', 2000, 2000);
|
||||
|
||||
@@ -417,5 +416,4 @@ class FileTest extends TestCase
|
||||
'width' => 2000,
|
||||
]);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -1,11 +1,10 @@
|
||||
<?php
|
||||
|
||||
namespace Tests\Domain\Notifications;
|
||||
|
||||
use App\Users\Models\User;
|
||||
use Tests\TestCase;
|
||||
use Str;
|
||||
use DB;
|
||||
use Str;
|
||||
use Tests\TestCase;
|
||||
use App\Users\Models\User;
|
||||
|
||||
class NotificationsTest extends TestCase
|
||||
{
|
||||
@@ -131,4 +130,4 @@ class NotificationsTest extends TestCase
|
||||
|
||||
$this->assertDatabaseCount('notifications', 0);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
<?php
|
||||
|
||||
namespace Tests\Domain\Settings;
|
||||
|
||||
use Storage;
|
||||
|
||||
@@ -62,11 +62,41 @@ class TeamManagementTest extends TestCase
|
||||
'permission' => 'can-view',
|
||||
]);
|
||||
|
||||
DB::table('notifications')
|
||||
->insert([
|
||||
'id' => Str::uuid(),
|
||||
'type' => 'Domain\UploadRequest\Notifications\UploadRequestFulfilledNotification',
|
||||
'notifiable_type' => 'App\Users\Models\User',
|
||||
'notifiable_id' => $member->id,
|
||||
'data' => json_encode([
|
||||
'type' => 'team-invitation',
|
||||
'title' => 'New Team Invitation',
|
||||
'description' => 'Jane Doe invite you to join into Team Folder..',
|
||||
'action' => [
|
||||
'type' => 'invitation',
|
||||
'params' => [
|
||||
'type' => 'invitation',
|
||||
'params' => [
|
||||
'id' => $invitation->id,
|
||||
],
|
||||
],
|
||||
],
|
||||
]),
|
||||
'created_at' => now(),
|
||||
'updated_at' => now(),
|
||||
]);
|
||||
|
||||
$this
|
||||
->actingAs($member)
|
||||
->putJson("/api/teams/invitations/{$invitation->id}")
|
||||
->assertNoContent();
|
||||
|
||||
// Get notification
|
||||
$notification = json_decode(DB::table('notifications')->first()->data);
|
||||
|
||||
// Check if action is null
|
||||
$this->assertEquals(null, $notification->action);
|
||||
|
||||
$this
|
||||
->assertDatabaseHas('team_folder_invitations', [
|
||||
'parent_id' => $folder->id,
|
||||
@@ -174,11 +204,41 @@ class TeamManagementTest extends TestCase
|
||||
'permission' => 'can-edit',
|
||||
]);
|
||||
|
||||
DB::table('notifications')
|
||||
->insert([
|
||||
'id' => Str::uuid(),
|
||||
'type' => 'Domain\UploadRequest\Notifications\UploadRequestFulfilledNotification',
|
||||
'notifiable_type' => 'App\Users\Models\User',
|
||||
'notifiable_id' => $member->id,
|
||||
'data' => json_encode([
|
||||
'type' => 'team-invitation',
|
||||
'title' => 'New Team Invitation',
|
||||
'description' => 'Jane Doe invite you to join into Team Folder..',
|
||||
'action' => [
|
||||
'type' => 'invitation',
|
||||
'params' => [
|
||||
'type' => 'invitation',
|
||||
'params' => [
|
||||
'id' => $invitation->id,
|
||||
],
|
||||
],
|
||||
],
|
||||
]),
|
||||
'created_at' => now(),
|
||||
'updated_at' => now(),
|
||||
]);
|
||||
|
||||
$this
|
||||
->actingAs($member)
|
||||
->deleteJson("/api/teams/invitations/{$invitation->id}")
|
||||
->assertNoContent();
|
||||
|
||||
// Get notification
|
||||
$notification = json_decode(DB::table('notifications')->first()->data);
|
||||
|
||||
// Check if action is null
|
||||
$this->assertEquals(null, $notification->action);
|
||||
|
||||
$this
|
||||
->assertDatabaseHas('team_folder_invitations', [
|
||||
'parent_id' => $folder->id,
|
||||
|
||||
@@ -1,8 +1,6 @@
|
||||
<?php
|
||||
|
||||
namespace Tests\Domain\UploadRequest;
|
||||
|
||||
use Domain\UploadRequest\Notifications\UploadRequestFulfilledNotification;
|
||||
use Storage;
|
||||
use Notification;
|
||||
use Tests\TestCase;
|
||||
@@ -12,6 +10,7 @@ use Illuminate\Http\UploadedFile;
|
||||
use Domain\UploadRequest\Models\UploadRequest;
|
||||
use Support\Scheduler\Actions\ExpireUnfilledUploadRequestAction;
|
||||
use Domain\UploadRequest\Notifications\UploadRequestNotification;
|
||||
use Domain\UploadRequest\Notifications\UploadRequestFulfilledNotification;
|
||||
|
||||
class UploadRequestTest extends TestCase
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user