Prepara proposta navegável de recomendação antes da adjudicação
This commit is contained in:
@@ -3,17 +3,19 @@
|
||||
use App\Models\User;
|
||||
use Inertia\Testing\AssertableInertia as Assert;
|
||||
|
||||
test('visual consultation is accessible without authentication', function () {
|
||||
$this->get('/consulta')->assertOk()->assertInertia(fn (Assert $page) => $page
|
||||
->component('preview/index')
|
||||
test('visual consultation is accessible without authentication', function (string $path, string $component) {
|
||||
$this->get($path)->assertOk()->assertInertia(fn (Assert $page) => $page
|
||||
->component($component)
|
||||
->where('auth.user', null)
|
||||
->missing('suppliers')->missing('requisitions')->missing('documents'));
|
||||
->missing('suppliers')->missing('requisitions')->missing('documents')
|
||||
->missing('adoptions')->missing('policies')->missing('recommendations'));
|
||||
$this->assertGuest();
|
||||
});
|
||||
})->with([['/consulta', 'preview/index'], ['/proposta/qualificacao', 'preview/qualification'], ['/proposta/admissao', 'preview/admission'], ['/proposta/recomendacao', 'preview/recommendation']]);
|
||||
|
||||
test('preview does not expose authenticated account data or log it out', function () {
|
||||
$user = User::factory()->create();
|
||||
$this->actingAs($user)->get('/consulta')->assertOk()->assertInertia(fn (Assert $page) => $page->where('auth.user', null));
|
||||
$this->get('/proposta/recomendacao')->assertOk()->assertInertia(fn (Assert $page) => $page->where('auth.user', null)->missing('recommendations')->missing('policies')->missing('documents'));
|
||||
$this->assertAuthenticatedAs($user);
|
||||
});
|
||||
|
||||
@@ -24,5 +26,6 @@ test('consultation creates no business access or mutation endpoint', function ()
|
||||
}
|
||||
$this->post('/fornecedores', ['name' => 'Tentativa pública'])->assertRedirect('/login');
|
||||
$this->post('/consulta', [])->assertStatus(405);
|
||||
$this->post('/proposta/recomendacao', [])->assertStatus(405);
|
||||
expect(User::query()->count())->toBe(0);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user