mirror of
https://github.com/HolgerHatGarKeineNode/einundzwanzig-app.git
synced 2026-06-27 19:40:23 +00:00
✨ 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:
@@ -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');
|
||||
});
|
||||
Reference in New Issue
Block a user