mirror of
https://github.com/HolgerHatGarKeineNode/einundzwanzig-app.git
synced 2026-06-27 19:40:23 +00:00
4c9dec42f2
- ➕ 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.
39 lines
1.3 KiB
PHP
39 lines
1.3 KiB
PHP
<?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');
|
|
});
|