From c66c50835adb2fa76574df90bc8aa3da6303564a Mon Sep 17 00:00:00 2001 From: Saeed Vaziry Date: Wed, 27 Mar 2024 13:32:25 +0100 Subject: [PATCH] fix tests --- app/Enums/Database.php | 4 +++- resources/views/services/partials/actions/mariadb.blade.php | 1 + resources/views/services/partials/actions/mysql.blade.php | 1 + tests/Feature/ApplicationTest.php | 4 ++-- tests/Feature/ConsoleTest.php | 1 + tests/Feature/CronjobTest.php | 1 + tests/Feature/DatabaseBackupTest.php | 1 + tests/Feature/DatabaseTest.php | 1 + tests/Feature/DatabaseUserTest.php | 1 + tests/Feature/FirewallTest.php | 1 + tests/Feature/LogsTest.php | 1 + tests/Feature/NotificationChannelsTest.php | 1 + tests/Feature/ProfileTest.php | 1 + tests/Feature/ProjectsTest.php | 1 + tests/Feature/QueuesTest.php | 2 +- tests/Feature/ServerKeysTest.php | 1 + tests/Feature/ServerProvidersTest.php | 1 + tests/Feature/ServicesTest.php | 3 +++ tests/Feature/SitesTest.php | 4 ++-- tests/Feature/SshKeysTest.php | 1 + tests/Feature/SslTest.php | 4 ++-- tests/Feature/StorageProvidersTest.php | 1 + 22 files changed, 29 insertions(+), 8 deletions(-) create mode 100644 resources/views/services/partials/actions/mariadb.blade.php create mode 100644 resources/views/services/partials/actions/mysql.blade.php diff --git a/app/Enums/Database.php b/app/Enums/Database.php index bdf2f4d1..351ae69b 100644 --- a/app/Enums/Database.php +++ b/app/Enums/Database.php @@ -10,7 +10,9 @@ final class Database const MYSQL80 = 'mysql80'; - const MARIADB = 'mariadb'; + const MARIADB103 = 'mariadb103'; + + const MARIADB104 = 'mariadb104'; const POSTGRESQL12 = 'postgresql12'; diff --git a/resources/views/services/partials/actions/mariadb.blade.php b/resources/views/services/partials/actions/mariadb.blade.php new file mode 100644 index 00000000..36d30486 --- /dev/null +++ b/resources/views/services/partials/actions/mariadb.blade.php @@ -0,0 +1 @@ +@include("services.partials.unit-actions") diff --git a/resources/views/services/partials/actions/mysql.blade.php b/resources/views/services/partials/actions/mysql.blade.php new file mode 100644 index 00000000..36d30486 --- /dev/null +++ b/resources/views/services/partials/actions/mysql.blade.php @@ -0,0 +1 @@ +@include("services.partials.unit-actions") diff --git a/tests/Feature/ApplicationTest.php b/tests/Feature/ApplicationTest.php index c1ba120a..b8f0cb8e 100644 --- a/tests/Feature/ApplicationTest.php +++ b/tests/Feature/ApplicationTest.php @@ -23,7 +23,7 @@ public function test_visit_application() 'site' => $this->site, ]) ) - ->assertOk() + ->assertSuccessful() ->assertSee($this->site->domain); } @@ -88,7 +88,7 @@ public function test_deploy(): void 'server' => $this->server, 'site' => $this->site, ])) - ->assertOk() + ->assertSuccessful() ->assertSee('test commit message'); $deployment = $this->site->deployments()->first(); diff --git a/tests/Feature/ConsoleTest.php b/tests/Feature/ConsoleTest.php index 5153bb53..0c34d8b4 100644 --- a/tests/Feature/ConsoleTest.php +++ b/tests/Feature/ConsoleTest.php @@ -15,6 +15,7 @@ public function test_see_console(): void $this->actingAs($this->user); $this->get(route('servers.console', $this->server)) + ->assertSuccessful() ->assertSeeText('Headless Console'); } diff --git a/tests/Feature/CronjobTest.php b/tests/Feature/CronjobTest.php index 614646c7..bfd5b90c 100644 --- a/tests/Feature/CronjobTest.php +++ b/tests/Feature/CronjobTest.php @@ -22,6 +22,7 @@ public function test_see_cronjobs_list() ]); $this->get(route('servers.cronjobs', $this->server)) + ->assertSuccessful() ->assertSeeText($cronjob->frequencyLabel()); } diff --git a/tests/Feature/DatabaseBackupTest.php b/tests/Feature/DatabaseBackupTest.php index 81be50f8..5843363a 100644 --- a/tests/Feature/DatabaseBackupTest.php +++ b/tests/Feature/DatabaseBackupTest.php @@ -98,6 +98,7 @@ public function test_see_backups_list(): void ]); $this->get(route('servers.databases.backups', [$this->server, $backup])) + ->assertSuccessful() ->assertSee($backup->database->name); } diff --git a/tests/Feature/DatabaseTest.php b/tests/Feature/DatabaseTest.php index 21c7ffab..3b62a0bf 100644 --- a/tests/Feature/DatabaseTest.php +++ b/tests/Feature/DatabaseTest.php @@ -66,6 +66,7 @@ public function test_see_databases_list(): void ]); $this->get(route('servers.databases', $this->server)) + ->assertSuccessful() ->assertSee($database->name); } diff --git a/tests/Feature/DatabaseUserTest.php b/tests/Feature/DatabaseUserTest.php index 2859c691..969e25dc 100644 --- a/tests/Feature/DatabaseUserTest.php +++ b/tests/Feature/DatabaseUserTest.php @@ -58,6 +58,7 @@ public function test_see_database_users_list(): void ]); $this->get(route('servers.databases', $this->server)) + ->assertSuccessful() ->assertSee($databaseUser->username); } diff --git a/tests/Feature/FirewallTest.php b/tests/Feature/FirewallTest.php index cbe09206..068fac1f 100644 --- a/tests/Feature/FirewallTest.php +++ b/tests/Feature/FirewallTest.php @@ -41,6 +41,7 @@ public function test_see_firewall_rules(): void ]); $this->get(route('servers.firewall', $this->server)) + ->assertSuccessful() ->assertSee($rule->source) ->assertSee($rule->port); } diff --git a/tests/Feature/LogsTest.php b/tests/Feature/LogsTest.php index 5efc102a..175ff436 100644 --- a/tests/Feature/LogsTest.php +++ b/tests/Feature/LogsTest.php @@ -20,6 +20,7 @@ public function test_see_logs() ]); $this->get(route('servers.logs', $this->server)) + ->assertSuccessful() ->assertSeeText($log->type); } } diff --git a/tests/Feature/NotificationChannelsTest.php b/tests/Feature/NotificationChannelsTest.php index 192a9449..18c8c982 100644 --- a/tests/Feature/NotificationChannelsTest.php +++ b/tests/Feature/NotificationChannelsTest.php @@ -194,6 +194,7 @@ public function test_see_channels_list(): void $channel = \App\Models\NotificationChannel::factory()->create(); $this->get(route('notification-channels')) + ->assertSuccessful() ->assertSee($channel->provider); } diff --git a/tests/Feature/ProfileTest.php b/tests/Feature/ProfileTest.php index 4e2a34a0..d0309d25 100644 --- a/tests/Feature/ProfileTest.php +++ b/tests/Feature/ProfileTest.php @@ -16,6 +16,7 @@ public function test_profile_page_is_displayed(): void $this ->get(route('profile')) + ->assertSuccessful() ->assertSee('Profile Information') ->assertSee('Update Password') ->assertSee('Two Factor Authentication'); diff --git a/tests/Feature/ProjectsTest.php b/tests/Feature/ProjectsTest.php index fcf9d892..6b60d3e6 100644 --- a/tests/Feature/ProjectsTest.php +++ b/tests/Feature/ProjectsTest.php @@ -32,6 +32,7 @@ public function test_see_projects_list(): void ]); $this->get(route('projects')) + ->assertSuccessful() ->assertSee($project->name); } diff --git a/tests/Feature/QueuesTest.php b/tests/Feature/QueuesTest.php index 7b39c696..cd327126 100644 --- a/tests/Feature/QueuesTest.php +++ b/tests/Feature/QueuesTest.php @@ -27,7 +27,7 @@ public function test_see_queues() 'site' => $this->site, ]) ) - ->assertOk() + ->assertSuccessful() ->assertSee($queue->command); } diff --git a/tests/Feature/ServerKeysTest.php b/tests/Feature/ServerKeysTest.php index 2d40d84b..e4f6c861 100644 --- a/tests/Feature/ServerKeysTest.php +++ b/tests/Feature/ServerKeysTest.php @@ -27,6 +27,7 @@ public function test_see_server_keys() ]); $this->get(route('servers.ssh-keys', $this->server)) + ->assertSuccessful() ->assertSeeText('My first key'); } diff --git a/tests/Feature/ServerProvidersTest.php b/tests/Feature/ServerProvidersTest.php index 1272e731..85b5b75e 100644 --- a/tests/Feature/ServerProvidersTest.php +++ b/tests/Feature/ServerProvidersTest.php @@ -70,6 +70,7 @@ public function test_see_providers_list(): void ]); $this->get(route('server-providers')) + ->assertSuccessful() ->assertSee($provider->profile); } diff --git a/tests/Feature/ServicesTest.php b/tests/Feature/ServicesTest.php index f65c93af..c7a85861 100644 --- a/tests/Feature/ServicesTest.php +++ b/tests/Feature/ServicesTest.php @@ -16,6 +16,8 @@ public function test_see_services_list(): void $this->actingAs($this->user); $this->get(route('servers.services', $this->server)) + ->assertSuccessful() + ->assertSee('mysql') ->assertSee('nginx') ->assertSee('php') ->assertSee('supervisor') @@ -242,6 +244,7 @@ public static function data(): array ['redis'], ['ufw'], ['php'], + ['mysql'], ]; } } diff --git a/tests/Feature/SitesTest.php b/tests/Feature/SitesTest.php index 4de43e42..ab842766 100644 --- a/tests/Feature/SitesTest.php +++ b/tests/Feature/SitesTest.php @@ -57,7 +57,7 @@ public function test_see_sites_list(): void $this->get(route('servers.sites', [ 'server' => $this->server, ])) - ->assertOk() + ->assertSuccessful() ->assertSee($site->domain); } @@ -178,7 +178,7 @@ public function test_see_logs(): void 'server' => $this->server, 'site' => $this->site, ])) - ->assertOk() + ->assertSuccessful() ->assertSee('Logs'); } } diff --git a/tests/Feature/SshKeysTest.php b/tests/Feature/SshKeysTest.php index 51e3e215..154d542c 100644 --- a/tests/Feature/SshKeysTest.php +++ b/tests/Feature/SshKeysTest.php @@ -29,6 +29,7 @@ public function test_get_public_keys_list(): void ]); $this->get(route('ssh-keys')) + ->assertSuccessful() ->assertSee($key->name); } diff --git a/tests/Feature/SslTest.php b/tests/Feature/SslTest.php index 0358ef37..1101c757 100644 --- a/tests/Feature/SslTest.php +++ b/tests/Feature/SslTest.php @@ -25,7 +25,7 @@ public function test_see_ssls_list() 'server' => $this->server, 'site' => $this->site, ])) - ->assertOk() + ->assertSuccessful() ->assertSee($ssl->type); } @@ -37,7 +37,7 @@ public function test_see_ssls_list_with_no_ssls() 'server' => $this->server, 'site' => $this->site, ])) - ->assertOk() + ->assertSuccessful() ->assertSeeText(__("You don't have any SSL certificates yet!")); } diff --git a/tests/Feature/StorageProvidersTest.php b/tests/Feature/StorageProvidersTest.php index 190b17d0..a4577f93 100644 --- a/tests/Feature/StorageProvidersTest.php +++ b/tests/Feature/StorageProvidersTest.php @@ -41,6 +41,7 @@ public function test_see_providers_list(): void ]); $this->get(route('storage-providers')) + ->assertSuccessful() ->assertSee($provider->profile); }