@@ -205,6 +205,18 @@ test('catalogue requires explicit minimum and supports optimistic audited update
|
||||
$this->postJson('/equipamentos/pecas', $payload)->assertUnprocessable()->assertJsonValidationErrors('version');
|
||||
});
|
||||
|
||||
test('equipment preparation consultation protects browser history without catalogue or stock writes', function () {
|
||||
$before = [];
|
||||
foreach (['equipment', 'spare_parts', 'equipment_spare_parts', 'stock_operations', 'stock_movements', 'audit_logs'] as $table) {
|
||||
$before[$table] = DB::table($table)->orderBy('id')->get()->map(fn (object $row) => (array) $row)->all();
|
||||
}
|
||||
$response = $this->get('/equipamentos')->assertOk()->assertViewHas('page', fn (array $page) => $page['encryptHistory'] === true);
|
||||
expect($response->headers->get('Cache-Control'))->toContain('private')->toContain('no-store');
|
||||
foreach ($before as $table => $rows) {
|
||||
expect(DB::table($table)->orderBy('id')->get()->map(fn (object $row) => (array) $row)->all())->toBe($rows);
|
||||
}
|
||||
});
|
||||
|
||||
test('warehouse stock drives minimum alert without duplicate inventory balances', function () {
|
||||
app(ReceiptWorkflow::class)->confirm($this->f['receiver'], $this->f['order'], receiptPayload($this->f, '1.000'));
|
||||
$this->get('/equipamentos')->assertInertia(fn (Assert $p) => $p->component('equipment/index')->where('parts.0.balance_milli', 1000)->where('parts.0.below_minimum', true));
|
||||
|
||||
Reference in New Issue
Block a user