mirror of
https://github.com/HolgerHatGarKeineNode/einundzwanzig-app.git
synced 2025-12-13 23:56:47 +00:00
🛠️ Add services index and landing page components with dynamic links and new Polish translations
This commit is contained in:
22
tests/Feature/Livewire/Services/CreateTest.php
Normal file
22
tests/Feature/Livewire/Services/CreateTest.php
Normal file
@@ -0,0 +1,22 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
use App\Enums\SelfHostedServiceType;
|
||||
use App\Models\SelfHostedService;
|
||||
use App\Models\User;
|
||||
use Livewire\Volt\Volt;
|
||||
|
||||
it('creates a self hosted service', function () {
|
||||
$user = User::factory()->create();
|
||||
|
||||
$component = Volt::test('services.create')
|
||||
->actingAs($user)
|
||||
->set('name', 'My Node')
|
||||
->set('type', SelfHostedServiceType::Mempool->value)
|
||||
->set('url_clearnet', 'https://example.com')
|
||||
->set('contact_url', 'https://contact.example.com')
|
||||
->call('save');
|
||||
|
||||
expect(SelfHostedService::where('name', 'My Node')->exists())->toBeTrue();
|
||||
});
|
||||
15
tests/Feature/Livewire/Services/IndexTest.php
Normal file
15
tests/Feature/Livewire/Services/IndexTest.php
Normal file
@@ -0,0 +1,15 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
use App\Models\SelfHostedService;
|
||||
use Livewire\Volt\Volt;
|
||||
|
||||
it('renders services index', function () {
|
||||
SelfHostedService::factory()->count(2)->create();
|
||||
|
||||
$component = Volt::test('services.index');
|
||||
|
||||
$component->assertStatus(200)
|
||||
->assertSee('Self Hosted Services');
|
||||
});
|
||||
Reference in New Issue
Block a user