Add service disclaimer component and Nostr validation links

-  Introduced reusable `<x-service-disclaimer>` component for better clarity and consistency on service pages.
- 🔗 Added `njump` links for Nostr profile validation in service listings and landing pages.
- 🧪 Included feature tests to verify disclaimer visibility and correct `njump` link rendering or omission for anonymous services.
This commit is contained in:
HolgerHatGarKeineNode
2026-06-25 14:12:21 +02:00
parent dc1d679e4b
commit 4c9dec42f2
4 changed files with 81 additions and 0 deletions
+38
View File
@@ -0,0 +1,38 @@
<?php
use App\Models\SelfHostedService;
use App\Models\User;
it('shows the disclaimer and njump link on the services index', function () {
SelfHostedService::factory()->for(
User::factory()->create(['nostr' => 'npub1example']),
'createdBy'
)->create();
$this->get(route('services.index', ['country' => 'de']))
->assertOk()
->assertSee('Keine Empfehlung von EINUNDZWANZIG')
->assertSee('npub')
->assertSee('https://njump.me/npub1example');
});
it('shows the disclaimer and njump link on the service landingpage', function () {
$service = SelfHostedService::factory()->for(
User::factory()->create(['nostr' => 'npub1example']),
'createdBy'
)->create();
$this->get(route('services.landingpage', ['country' => 'de', 'service' => $service->slug]))
->assertOk()
->assertSee('Keine Empfehlung von EINUNDZWANZIG')
->assertSee('https://njump.me/npub1example');
});
it('omits the njump link for anonymous services', function () {
$service = SelfHostedService::factory()->anonymous()->create();
$this->get(route('services.landingpage', ['country' => 'de', 'service' => $service->slug]))
->assertOk()
->assertSee('Keine Empfehlung von EINUNDZWANZIG')
->assertDontSee('njump.me');
});