event implementation

This commit is contained in:
Čarodej
2021-11-19 17:08:49 +01:00
parent 496a6ea5a7
commit 7c5cb79677
32 changed files with 135 additions and 121 deletions

View File

@@ -50,8 +50,8 @@ class SignFlowTest extends TestCase
]);
$this->assertDatabaseHas('user_settings', [
'name' => 'John Doe',
'storage_capacity' => 12,
'name' => 'John Doe',
'max_storage_amount' => 12,
]);
Storage::disk('local')

View File

@@ -140,12 +140,12 @@ class UserAccountTest extends TestCase
'id' => (string) $user->id,
'type' => 'user',
'attributes' => [
'storage_capacity' => '5',
'email' => $user->email,
'role' => $user->role,
'two_factor_authentication' => false,
'folders' => [],
'storage' => [
'max_storage_amount' => '5',
'email' => $user->email,
'role' => $user->role,
'two_factor_authentication' => false,
'folders' => [],
'storage' => [
'used' => 0,
'used_formatted' => '0.00%',
'capacity' => '5',

View File

@@ -170,13 +170,13 @@ class AdminTest extends TestCase
->actingAs($admin)
->patchJson("/api/admin/users/$user->id/capacity", [
'attributes' => [
'storage_capacity' => 10,
'max_storage_amount' => 10,
],
])->assertStatus(200);
$this->assertDatabaseHas('user_settings', [
'user_id' => $user->id,
'storage_capacity' => 10,
'user_id' => $user->id,
'max_storage_amount' => 10,
]);
}
@@ -216,13 +216,13 @@ class AdminTest extends TestCase
$this
->actingAs($admin)
->postJson('/api/admin/users', [
'name' => 'John Doe',
'role' => 'user',
'email' => 'john@doe.com',
'password' => 'VerySecretPassword',
'storage_capacity' => 15,
'password_confirmation' => 'VerySecretPassword',
'avatar' => $avatar,
'name' => 'John Doe',
'role' => 'user',
'email' => 'john@doe.com',
'password' => 'VerySecretPassword',
'max_storage_amount' => 15,
'password_confirmation' => 'VerySecretPassword',
'avatar' => $avatar,
])->assertStatus(201);
$this->assertDatabaseHas('users', [

View File

@@ -1,7 +1,6 @@
<?php
namespace Tests\Domain\Admin;
use DB;
use Tests\TestCase;
use App\Users\Models\User;
use Laravel\Sanctum\Sanctum;

View File

@@ -112,7 +112,7 @@ class FileTest extends TestCase
->create();
$user->settings()->update([
'storage_capacity' => 1,
'max_storage_amount' => 1,
]);
File::factory(File::class)