mirror of
https://github.com/VueFileManager/vuefilemanager.git
synced 2026-04-05 18:23:48 +00:00
- admin registration fixes
- alert popup refactoring
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
<?php
|
||||
|
||||
namespace Tests\App\Users;
|
||||
|
||||
use Storage;
|
||||
@@ -38,6 +39,7 @@ class SignFlowTest extends TestCase
|
||||
});
|
||||
|
||||
$this->postJson('api/register', [
|
||||
'role' => 'admin',
|
||||
'email' => 'john@doe.com',
|
||||
'password' => 'SecretPassword',
|
||||
'password_confirmation' => 'SecretPassword',
|
||||
@@ -48,6 +50,7 @@ class SignFlowTest extends TestCase
|
||||
->assertDatabaseHas('users', [
|
||||
'email' => 'john@doe.com',
|
||||
'email_verified_at' => null,
|
||||
'role' => 'user',
|
||||
])
|
||||
->assertDatabaseHas('user_settings', [
|
||||
'first_name' => 'John',
|
||||
@@ -99,6 +102,7 @@ class SignFlowTest extends TestCase
|
||||
]);
|
||||
|
||||
$this->postJson('api/register', [
|
||||
'role' => 'admin',
|
||||
'email' => 'john@doe.com',
|
||||
'password' => 'SecretPassword',
|
||||
'password_confirmation' => 'SecretPassword',
|
||||
@@ -108,6 +112,7 @@ class SignFlowTest extends TestCase
|
||||
$this
|
||||
->assertDatabaseCount('transactions', 0)
|
||||
->assertDatabaseHas('users', [
|
||||
'role' => 'user',
|
||||
'email' => 'john@doe.com',
|
||||
])
|
||||
->assertDatabaseHas('subscriptions', [
|
||||
@@ -162,6 +167,7 @@ class SignFlowTest extends TestCase
|
||||
]);
|
||||
|
||||
$this->postJson('api/register', [
|
||||
'role' => 'admin',
|
||||
'email' => 'john@doe.com',
|
||||
'password' => 'SecretPassword',
|
||||
'password_confirmation' => 'SecretPassword',
|
||||
@@ -172,6 +178,7 @@ class SignFlowTest extends TestCase
|
||||
|
||||
$this
|
||||
->assertDatabaseHas('users', [
|
||||
'role' => 'user',
|
||||
'email' => 'john@doe.com',
|
||||
])
|
||||
->assertDatabaseHas('subscriptions', [
|
||||
@@ -206,7 +213,7 @@ class SignFlowTest extends TestCase
|
||||
public function it_try_register_when_registration_is_disabled()
|
||||
{
|
||||
Setting::updateOrCreate([
|
||||
'name' => 'registration',
|
||||
'name' => 'registration',
|
||||
], [
|
||||
'value' => 0,
|
||||
]);
|
||||
@@ -333,6 +340,7 @@ class SignFlowTest extends TestCase
|
||||
'email' => $user->email,
|
||||
]);
|
||||
}
|
||||
|
||||
/**
|
||||
* @test
|
||||
*/
|
||||
@@ -358,7 +366,7 @@ class SignFlowTest extends TestCase
|
||||
|
||||
$this
|
||||
->assertDatabaseHas('users', [
|
||||
'email' => 'john@doe.com',
|
||||
'email' => 'john@doe.com',
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -121,46 +121,10 @@ class AdminTest extends TestCase
|
||||
->actingAs($admin)
|
||||
->getJson("/api/admin/users/$user->id/storage")
|
||||
->assertStatus(200)
|
||||
->assertExactJson([
|
||||
'data' => [
|
||||
'id' => $user->id,
|
||||
'type' => 'storage',
|
||||
'attributes' => [
|
||||
'used' => '5.00MB',
|
||||
'capacity' => '1GB',
|
||||
'percentage' => 0.5,
|
||||
],
|
||||
'meta' => [
|
||||
'images' => [
|
||||
'used' => '1.00MB',
|
||||
'percentage' => 0.1,
|
||||
],
|
||||
'audios' => [
|
||||
'used' => '1.00MB',
|
||||
'percentage' => 0.1,
|
||||
],
|
||||
'videos' => [
|
||||
'used' => '1.00MB',
|
||||
'percentage' => 0.1,
|
||||
],
|
||||
'documents' => [
|
||||
'used' => '1.00MB',
|
||||
'percentage' => 0.1,
|
||||
],
|
||||
'others' => [
|
||||
'used' => '1.00MB',
|
||||
'percentage' => 0.1,
|
||||
],
|
||||
'traffic' => [
|
||||
'chart' => [
|
||||
'download' => [],
|
||||
'upload' => [],
|
||||
],
|
||||
'download' => '0B',
|
||||
'upload' => '0B',
|
||||
],
|
||||
],
|
||||
],
|
||||
->assertJsonFragment([
|
||||
'used' => '5.00MB',
|
||||
'capacity' => '1GB',
|
||||
'percentage' => 0.5,
|
||||
]);
|
||||
}
|
||||
|
||||
|
||||
@@ -23,28 +23,18 @@ class DashboardTest extends TestCase
|
||||
->actingAs($user)
|
||||
->getJson('/api/admin/dashboard')
|
||||
->assertStatus(200)
|
||||
->assertExactJson([
|
||||
->assertJsonFragment([
|
||||
'app' => [
|
||||
'earnings' => '$0.00',
|
||||
'isRunningCron' => false,
|
||||
'license' => 'extended',
|
||||
'version' => config('vuefilemanager.version'),
|
||||
],
|
||||
'disk' => [
|
||||
'download' => [
|
||||
'records' => [],
|
||||
'total' => '0B',
|
||||
],
|
||||
'upload' => [
|
||||
'records' => [],
|
||||
'total' => '0B',
|
||||
],
|
||||
'used' => '2.00MB',
|
||||
],
|
||||
'users' => [
|
||||
'total' => 1,
|
||||
'usersPremiumTotal' => 0,
|
||||
],
|
||||
'used' => '2.00MB',
|
||||
]);
|
||||
}
|
||||
|
||||
|
||||
@@ -103,7 +103,7 @@ class HomepageTest extends TestCase
|
||||
->get("/api/og-site/$share->token")
|
||||
->assertStatus(200)
|
||||
->assertSee('Fake Image')
|
||||
->assertSee('md-fake-image.jpg');
|
||||
->assertSee('lg-fake-image.jpg');
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -72,7 +72,9 @@ class SetupWizardTest extends TestCase
|
||||
'storageLimitation' => 1,
|
||||
'defaultStorage' => 10,
|
||||
'logo' => UploadedFile::fake()->image('fake-logo.jpg'),
|
||||
'logo_dark' => UploadedFile::fake()->image('fake-logo-dark.jpg'),
|
||||
'logo_horizontal' => UploadedFile::fake()->image('fake-logo-horizontal.jpg'),
|
||||
'logo_horizontal_dark' => UploadedFile::fake()->image('fake-logo-horizontal-dark.jpg'),
|
||||
'favicon' => UploadedFile::fake()->image('fake-favicon.jpg'),
|
||||
])->assertStatus(204);
|
||||
|
||||
@@ -168,7 +170,7 @@ class SetupWizardTest extends TestCase
|
||||
|
||||
$this->assertDatabaseHas('settings', [
|
||||
'name' => 'license',
|
||||
'value' => 'Regular',
|
||||
'value' => 'regular',
|
||||
]);
|
||||
|
||||
$this->assertDatabaseHas('settings', [
|
||||
|
||||
Reference in New Issue
Block a user