@@ -9,6 +9,7 @@ use App\Models\User;
|
||||
use App\Services\ExternalPaymentWorkflow;
|
||||
use App\Services\RequisitionWorkflow;
|
||||
use App\Services\SupplierBankWorkflow;
|
||||
use App\Services\SupplierPayables;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
use Illuminate\Validation\ValidationException;
|
||||
|
||||
@@ -204,3 +205,16 @@ test('financial role is reloaded after the company lock rather than trusting a s
|
||||
$this->post('/facturas/'.$this->f['invoice']->id.'/pagamentos', $this->data)->assertForbidden();
|
||||
expect(ExternalPayment::query()->count())->toBe(0);
|
||||
});
|
||||
|
||||
test('payables trial stays unavailable outside its isolated database even with a source configured', function () {
|
||||
config(['common-payables.source_instance' => 'synthetic-source']);
|
||||
|
||||
expect(SupplierPayables::enabled())->toBeFalse();
|
||||
$this->get('/obrigacoes-fornecedores')->assertForbidden();
|
||||
$this->getJson('/api/supplier-payables')->assertForbidden();
|
||||
$this->postJson('/api/supplier-payables/prepare', ['id' => $this->f['invoice']->id, 'reason' => 'Ensaio isolado'])->assertForbidden();
|
||||
$this->postJson('/api/supplier-payables/validate', ['id' => $this->f['invoice']->id, 'reason' => 'Ensaio isolado'])->assertForbidden();
|
||||
|
||||
confirmTestPayment($this, registerTestPayment($this));
|
||||
expect(app(ExternalPaymentWorkflow::class)->outstanding($this->f['invoice']))->toBe(2000);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user