gruene-seele/tests/Feature/InventoryNoticesTest.php
Kevin Adametz 3ee2d756e9 Warenwirtschaft: AP-09 bis AP-13 (Produktbestand, Set-Produkte, Ausschuss, Konzepte)
- AP-09 Produktbestand inkl. Bewegungshistorie (product_stock_movements, ProductStockService)
- AP-10 Rohstoffbestand-Ansicht je Lager (RawMaterialStockController)
- AP-11 Bestandsschwellen / Out-of-Stock-Handling fuer Produkte und Shop
- AP-12 Ausgang/Ausschuss (stock_disposals, StockDisposalController, InventoryService)
- Set-Produkte (product_set_items) inkl. Aufloesung
- Produktentwicklung & Hinweise-Verwaltung (Notices)
- AP-13 Entwicklungskonzept Shop-Bestandsabzug im Plan dokumentiert
- Feature-Tests fuer neue Module + aktualisierter Entwicklungsplan

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-03 11:04:22 +00:00

41 lines
1.1 KiB
PHP

<?php
use App\User;
use Illuminate\Foundation\Testing\RefreshDatabase;
use Tests\TestCase;
uses(TestCase::class, RefreshDatabase::class);
function noticeUser(int $adminLevel = 8): User
{
$user = User::query()->create([
'email' => uniqid('notice_', true).'@test.example',
'password' => bcrypt('password'),
]);
$user->forceFill([
'admin' => $adminLevel,
'confirmed' => true,
'active' => true,
'wizard' => 100,
'blocked' => false,
])->save();
return $user->fresh();
}
test('hinweise-seite rendert das markdown gerendert als html', function () {
$this->actingAs(noticeUser(8), 'user');
$response = $this->get(route('admin.inventory.notices'));
$response->assertSuccessful();
$response->assertSee('Hinweise');
$response->assertSee('Entwicklungsstand', false);
$response->assertSee('<h2', false);
});
test('nicht-superadmin hat keinen zugriff auf hinweise-seite', function () {
$this->actingAs(noticeUser(7), 'user');
$this->get(route('admin.inventory.notices'))->assertRedirect('/home');
});