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 and counts 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); expect($customer->fresh()->press_release_quota_used_this_month)->toBe(1); });