@@ -0,0 +1,17 @@
|
||||
<?php
|
||||
|
||||
use Inertia\Testing\AssertableInertia as Assert;
|
||||
|
||||
require_once __DIR__.'/../Support/ReceiptFixture.php';
|
||||
|
||||
test('older synthetic order remains readable and printable without rewriting its incomplete snapshot', function () {
|
||||
$f = receiptFixture();
|
||||
$order = $f['order'];
|
||||
$before = $order->fresh()->toArray();
|
||||
$this->actingAs($f['issuer']);
|
||||
$this->get('/ordens')->assertOk()->assertInertia(fn (Assert $page) => $page->where('orders.data.0.id', $order->id));
|
||||
$this->get('/ordens/'.$order->id)->assertOk()->assertInertia(fn (Assert $page) => $page->where('snapshotComplete', false)->where('order.snapshot', $order->snapshot));
|
||||
$this->get('/ordens/'.$order->id.'/imprimir')->assertOk()->assertSee('Documento original incompleto.')->assertSee($order->number)->assertSee('100,00 MZN')->assertDontSee('Matriz de avaliação congelada');
|
||||
expect($order->fresh()->toArray())->toBe($before);
|
||||
$this->actingAs(receiptFixture()['issuer'])->get('/ordens/'.$order->id.'/imprimir')->assertNotFound();
|
||||
});
|
||||
Reference in New Issue
Block a user