- redesign the dashboard
- add search bar
- Mobile-friendly design
This commit is contained in:
Saeed Vaziry
2024-03-21 15:57:57 +01:00
committed by GitHub
parent 7949165648
commit d3aaf2a6fa
55 changed files with 1175 additions and 1009 deletions

View File

@ -0,0 +1,58 @@
<?php
namespace Tests\Feature;
use Illuminate\Foundation\Testing\RefreshDatabase;
use Tests\TestCase;
class SearchTest extends TestCase
{
use RefreshDatabase;
public function test_search_server(): void
{
$this->actingAs($this->user);
$this->get(route('search', ['q' => $this->server->name]))
->assertOk()
->assertJson([
'results' => [
[
'type' => 'server',
'url' => route('servers.show', ['server' => $this->site->server]),
'text' => $this->server->name,
'project' => $this->server->project->name,
],
],
]);
}
public function test_search_site(): void
{
$this->actingAs($this->user);
$this->get(route('search', ['q' => $this->site->domain]))
->assertOk()
->assertJson([
'results' => [
[
'type' => 'site',
'url' => route('servers.sites.show', ['server' => $this->site->server, 'site' => $this->site]),
'text' => $this->site->domain,
'project' => $this->site->server->project->name,
],
],
]);
}
public function test_search_has_no_results(): void
{
$this->actingAs($this->user);
$this->get(route('search', ['q' => 'nothing-will-found']))
->assertOk()
->assertJson([
'results' => [],
]);
}
}

View File

@ -31,6 +31,7 @@ public function setUp(): void
config()->set('filesystems.disks.key-pairs.root', storage_path('app/key-pairs-test'));
$this->user = User::factory()->create();
$this->user->createDefaultProject();
\App\Models\NotificationChannel::factory()->create([
'provider' => NotificationChannel::EMAIL,
@ -60,6 +61,7 @@ private function setupServer(): void
{
$this->server = Server::factory()->create([
'user_id' => $this->user->id,
'project_id' => $this->user->current_project_id,
]);
$keys = $this->server->sshKey();