feat: phase 6 — dashboard widgets, sales & stock reports, user management, activity log

This commit is contained in:
sean
2026-08-25 19:25:40 +07:00
parent 28937a786e
commit feba1ec839
18 changed files with 1011 additions and 5 deletions
+41
View File
@@ -0,0 +1,41 @@
<?php
namespace Tests\Feature\Phase6;
use App\Filament\Widgets\CriticalStock;
use App\Models\User;
use Livewire\Livewire;
use Tests\Support\InsForgeFake;
use Tests\TestCase;
class WidProbe extends TestCase
{
public function test_probe(): void
{
InsForgeFake::reset();
InsForgeFake::fakeRest();
InsForgeFake::seed('products', [
'id' => 'p-1', 'code' => 'BERAS-001', 'name' => 'Beras Premium',
'cost_price' => 13000, 'stock_minimum' => 50, 'is_active' => true,
]);
$user = new User;
$user->forceFill(['id' => 'u1', 'role' => 'operator', 'is_active' => true]);
$this->actingAs($user);
InsForgeFake::seed('stocks', [
'id' => 's1',
'product_id' => 'p-1',
'quantity' => 5,
'products' => ['code' => 'BERAS-001', 'name' => 'Beras Premium', 'stock_minimum' => 50, 'cost_price' => 13000],
]);
$html = Livewire::test(CriticalStock::class)->html();
echo 'len=', strlen($html), "\n";
echo 'Beras: ', str_contains($html, 'Beras Premium') ? 'Y' : 'N', "\n";
echo 'kritis: ', str_contains($html, 'kritis') ? 'Y' : 'N', "\n";
echo 'no-data: ', str_contains($html, 'tidak ada data') || str_contains($html, 'empty') ? 'Y' : 'N', "\n";
$this->assertTrue(true);
}
}