commit compras1 2811
tests / ci (push) Waiting to run

This commit is contained in:
2026-11-28 07:11:35 +02:00
parent d58b75c87a
commit eb32c74c56
202 changed files with 17463 additions and 1526 deletions
+12
View File
@@ -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));