diff --git a/tests/Feature/Livewire/Catalog/IndexTest.php b/tests/Feature/Livewire/Catalog/IndexTest.php
new file mode 100644
index 0000000..7defd78
--- /dev/null
+++ b/tests/Feature/Livewire/Catalog/IndexTest.php
@@ -0,0 +1,102 @@
+ Http::response('', 200),
+ ]);
+
+ $component = Volt::test('catalog.index');
+
+ $component->assertSee('No plugins available');
+});
+
+it('loads plugins from catalog URL', function () {
+ // Clear cache first to ensure fresh data
+ Cache::forget('catalog_plugins');
+
+ // Mock the HTTP response for the catalog URL
+ $catalogData = [
+ 'test-plugin' => [
+ 'name' => 'Test Plugin',
+ 'author' => ['name' => 'Test Author', 'github' => 'testuser'],
+ 'author_bio' => [
+ 'description' => 'A test plugin',
+ 'learn_more_url' => 'https://example.com',
+ ],
+ 'license' => 'MIT',
+ 'trmnlp' => [
+ 'zip_url' => 'https://example.com/plugin.zip',
+ ],
+ 'logo_url' => 'https://example.com/logo.png',
+ ],
+ ];
+
+ $yamlContent = Yaml::dump($catalogData);
+
+ // Override the default mock with specific data
+ Http::fake([
+ config('app.catalog_url') => Http::response($yamlContent, 200),
+ ]);
+
+ $component = Volt::test('catalog.index');
+
+ $component->assertSee('Test Plugin');
+ $component->assertSee('testuser');
+ $component->assertSee('A test plugin');
+ $component->assertSee('MIT');
+});
+
+it('shows error when plugin not found', function () {
+ $user = User::factory()->create();
+
+ $this->actingAs($user);
+
+ $component = Volt::test('catalog.index');
+
+ $component->call('installPlugin', 'non-existent-plugin');
+
+ // The component should dispatch an error notification
+ $component->assertHasErrors();
+});
+
+it('shows error when zip_url is missing', function () {
+ $user = User::factory()->create();
+
+ // Mock the HTTP response for the catalog URL without zip_url
+ $catalogData = [
+ 'test-plugin' => [
+ 'name' => 'Test Plugin',
+ 'author' => ['name' => 'Test Author'],
+ 'author_bio' => ['description' => 'A test plugin'],
+ 'license' => 'MIT',
+ 'trmnlp' => [],
+ ],
+ ];
+
+ $yamlContent = Yaml::dump($catalogData);
+
+ Http::fake([
+ config('app.catalog_url') => Http::response($yamlContent, 200),
+ ]);
+
+ $this->actingAs($user);
+
+ $component = Volt::test('catalog.index');
+
+ $component->call('installPlugin', 'test-plugin');
+
+ // The component should dispatch an error notification
+ $component->assertHasErrors();
+
+});
diff --git a/tests/Feature/PluginImportTest.php b/tests/Feature/PluginImportTest.php
index 9aeda6e..25325d2 100644
--- a/tests/Feature/PluginImportTest.php
+++ b/tests/Feature/PluginImportTest.php
@@ -94,7 +94,7 @@ it('throws exception for missing required files', function () {
$pluginImportService = new PluginImportService();
expect(fn () => $pluginImportService->importFromZip($zipFile, $user))
- ->toThrow(Exception::class, 'Invalid ZIP structure. Required files settings.yml and full.liquid/full.blade.php are missing.');
+ ->toThrow(Exception::class, 'Invalid ZIP structure. Required files settings.yml and full.liquid are missing.');
});
it('sets default values when settings are missing', function () {