-
+ @if ($project->icon_path)
+
 }})
+ @else
+
+ @endif
{{ $project->name }}
@@ -42,7 +48,12 @@
-
+ @if ($project->icon_path)
+
+ @else
+
+ @endif
{{ $project->name }}
{{ $project->description ?: 'No description' }}
{{ $project->environment_variables()->count() }} {{ Str::plural('variable', $project->environment_variables()->count()) }}
diff --git a/tests/Feature/ProjectIconTest.php b/tests/Feature/ProjectIconTest.php
index 6f5357c5c..3599c0b4b 100644
--- a/tests/Feature/ProjectIconTest.php
+++ b/tests/Feature/ProjectIconTest.php
@@ -3,6 +3,7 @@
use App\Livewire\Dashboard;
use App\Livewire\Project\Edit;
use App\Livewire\Project\Index;
+use App\Livewire\SharedVariables\Project\Index as SharedVariablesProjectIndex;
use App\Models\InstanceSettings;
use App\Models\Project;
use App\Models\Team;
@@ -113,3 +114,19 @@ it('displays the project icon on the dashboard', function () {
'v' => $this->project->updated_at->timestamp,
]).'"');
});
+
+it('displays the project icon in shared variables project views', function () {
+ $this->project->forceFill([
+ 'icon_path' => "project-icons/{$this->project->uuid}/icon.jpg",
+ 'icon_storage_type' => 'local',
+ ])->save();
+
+ $iconUrl = route('project.icon', [
+ 'project_uuid' => $this->project->uuid,
+ 'v' => $this->project->updated_at->timestamp,
+ ]);
+
+ $component = Livewire::test(SharedVariablesProjectIndex::class);
+
+ expect(substr_count($component->html(), 'src="'.$iconUrl.'"'))->toBe(2);
+});