- 83 Komponenten: Livewire\Volt\Component → Livewire\Component
- 73 Routen (admin, auth, customer): Volt::route() → Route::livewire()
- 88 Testdateien: Volt::test/actingAs → Livewire::test/actingAs
- VoltServiceProvider gelöscht; composer remove livewire/volt
- config/livewire.php auf v4-Schlüssel (component_layout, component_placeholder,
component_locations, make_command: SFC ohne ⚡). Der alte Schlüssel layout war
wirkungslos; alle gerouteten Komponenten setzen ihr Layout selbst.
- CLAUDE.md, AGENTS.md, boost.json, .cursorrules, Skill volt-development
- Roadmap: erledigt; Larastan erfasst SFCs weiterhin nicht (Blade-Dateien)
Suite 2.325 grün, einer übersprungen; Larastan und Pint ohne Meldung;
route:cache und view:cache laufen.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
79 lines
3.3 KiB
PHP
79 lines
3.3 KiB
PHP
<?php
|
|
|
|
use App\Enums\EmailSuppressionReason;
|
|
use App\Models\Company;
|
|
use App\Models\Contact;
|
|
use App\Models\EmailSuppression;
|
|
use App\Models\User;
|
|
use App\Services\Mail\EmailSuppressionService;
|
|
use Database\Seeders\RolesAndPermissionsSeeder;
|
|
use Illuminate\Support\Facades\Mail;
|
|
use Livewire\Livewire;
|
|
use Tests\TestCase;
|
|
|
|
/**
|
|
* Roadmap 1b.6, Schritt 4: nicht erreichbare Newsrooms im Admin markiert,
|
|
* nicht beanspruchbar, Freigabe im Admin.
|
|
*/
|
|
beforeEach(function (): void {
|
|
/** @var TestCase $this */
|
|
$this->seed(RolesAndPermissionsSeeder::class);
|
|
Mail::fake();
|
|
});
|
|
|
|
function suppressionAdmin(): User
|
|
{
|
|
$admin = User::factory()->create(['is_active' => true]);
|
|
$admin->assignRole('admin');
|
|
test()->actingAs($admin);
|
|
|
|
return $admin;
|
|
}
|
|
|
|
test('a newsroom whose only address bounced is not claimable and says why', function () {
|
|
/** @var TestCase $this */
|
|
Company::factory()->create(['portal' => 'businessportal24', 'slug' => 'tot-gmbh', 'email' => 'presse@tot.example', 'name' => 'Tot GmbH']);
|
|
app(EmailSuppressionService::class)->suppress('presse@tot.example', EmailSuppressionReason::HardBounce, 'imap');
|
|
|
|
$this->get('https://businessportal24.test/de/newsroom/tot-gmbh/verwalten')
|
|
->assertOk()
|
|
->assertSeeText('nicht mehr erreichbar')
|
|
->assertDontSeeText('Anmeldelink senden');
|
|
|
|
$this->post('https://businessportal24.test/de/newsroom/tot-gmbh/verwalten')->assertSessionHas('newsroom-claim-unreachable');
|
|
Mail::assertNothingQueued();
|
|
});
|
|
|
|
test('the admin company page marks unreachable company and contact addresses', function () {
|
|
/** @var TestCase $this */
|
|
suppressionAdmin();
|
|
$company = Company::factory()->create(['email' => 'presse@tot.example']);
|
|
Contact::factory()->for($company)->create(['email' => 'kontakt@tot.example', 'portal' => $company->portal->value]);
|
|
app(EmailSuppressionService::class)->suppress('presse@tot.example', EmailSuppressionReason::HardBounce, 'imap');
|
|
app(EmailSuppressionService::class)->suppress('kontakt@tot.example', EmailSuppressionReason::HardBounce, 'imap');
|
|
|
|
Livewire::test('admin.companies.show', ['id' => $company->id])
|
|
->assertSee('E-Mail nicht erreichbar')
|
|
->call('setTab', 'contacts')
|
|
->assertSee('kontakt@tot.example')
|
|
->assertSeeInOrder(['nicht erreichbar', 'kontakt@tot.example']);
|
|
});
|
|
|
|
test('the suppression list shows, releases and manually suppresses addresses', function () {
|
|
/** @var TestCase $this */
|
|
$admin = suppressionAdmin();
|
|
app(EmailSuppressionService::class)->suppress('presse@tot.example', EmailSuppressionReason::HardBounce, 'imap');
|
|
|
|
$component = Livewire::test('admin.mail.suppressions')
|
|
->assertSee('presse@tot.example')
|
|
->assertSee('Postfach existiert nicht');
|
|
|
|
$component->call('release', EmailSuppression::query()->firstOrFail()->id);
|
|
expect(app(EmailSuppressionService::class)->isSuppressed('presse@tot.example'))->toBeFalse()
|
|
->and(EmailSuppression::query()->first()->released_by_user_id)->toBe($admin->id);
|
|
|
|
$component->set('newEmail', 'Neu@Tot.example')->set('newNote', 'von Hand')->call('suppress')->assertHasNoErrors();
|
|
expect(app(EmailSuppressionService::class)->isSuppressed('neu@tot.example'))->toBeTrue();
|
|
|
|
$this->get(route('admin.mail.suppressions'))->assertOk()->assertSeeText('Mail-Sperrliste');
|
|
});
|