seed(RolesAndPermissionsSeeder::class); // Klassifikations-Job nicht inline ausführen, damit der Submit hier nur den // Übergang nach „review" prüft (KI-Routing siehe ClassificationJobTest). Queue::fake(); }); test('customer show renders the publish confirmation modal with legal note and quota', function () { /** @var TestCase $this */ ['customer' => $customer, 'pr' => $pr] = makeCustomerForShowPhase8a(); $customer->update(['press_release_quota' => 3, 'press_release_quota_used_this_month' => 1]); $this->actingAs($customer); LivewireVolt::test('customer.press-releases.show', ['id' => $pr->id]) ->assertSee('Pressemitteilung zur Prüfung einreichen') ->assertSee('Mit dem Einreichen versichern Sie:') ->assertSee('PM-Kontingent diesen Monat') ->assertSee('2 / 3'); }); test('submitting from the show modal moves the draft into review without consuming quota', function () { /** @var TestCase $this */ ['customer' => $customer, 'pr' => $pr] = makeCustomerForShowPhase8a(); $customer->update(['press_release_quota' => 3, 'press_release_quota_used_this_month' => 0]); $this->actingAs($customer); LivewireVolt::test('customer.press-releases.show', ['id' => $pr->id]) ->call('submitForReview') ->assertHasNoErrors(); expect($pr->fresh()->status)->toBe(PressReleaseStatus::Review); // Slot-Verbrauch erst bei Veröffentlichung (Decision-Update §3.2). expect($customer->fresh()->press_release_quota_used_this_month)->toBe(0); }); test('the modal shows a booking notice instead of the submit flow when the gate is enforced', function () { /** @var TestCase $this */ config()->set('billing.enforce_booking', true); ['customer' => $customer, 'pr' => $pr] = makeCustomerForShowPhase8a(); $this->actingAs($customer); LivewireVolt::test('customer.press-releases.show', ['id' => $pr->id]) ->assertSee('Buchung erforderlich') ->assertDontSee('Mit dem Einreichen versichern Sie:'); });