feat: phase 6 — dashboard widgets, sales & stock reports, user management, activity log
This commit is contained in:
@@ -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);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user