Receber documentos privados e locais de disponibilidade nas candidaturas
tests / ci (push) Canceled after 0s
tests / ci (push) Canceled after 0s
This commit is contained in:
@@ -5,6 +5,7 @@ import { expect, test } from 'vitest';
|
||||
import Opportunity from '@/pages/candidate/opportunity';
|
||||
import Receipt from '@/pages/candidate/receipt';
|
||||
import Access from '@/pages/candidate/access';
|
||||
import { CandidateDocumentList } from '@/components/candidate-documents';
|
||||
|
||||
const page = {
|
||||
component: 'candidate/opportunity',
|
||||
@@ -29,8 +30,42 @@ const definition = {
|
||||
required: true,
|
||||
},
|
||||
],
|
||||
documents: [],
|
||||
documents: [
|
||||
{
|
||||
key: 'cv',
|
||||
label: 'Currículo obrigatório',
|
||||
required: true,
|
||||
formats: ['pdf', 'docx'],
|
||||
max_kb: 1024,
|
||||
},
|
||||
],
|
||||
};
|
||||
|
||||
test('received files use guarded download links and retain their fingerprint without a storage URL', () => {
|
||||
const html = renderToString(
|
||||
<CandidateDocumentList
|
||||
baseUrl="/candidaturas/1/submissoes/7"
|
||||
documents={{
|
||||
cv: {
|
||||
key: 'cv',
|
||||
name: 'curriculo.pdf',
|
||||
size: 2048,
|
||||
sha256: 'abc123',
|
||||
verification: 'format_checked',
|
||||
},
|
||||
}}
|
||||
/>,
|
||||
);
|
||||
expect(html).toContain('/candidaturas/1/submissoes/7/documentos/cv');
|
||||
expect(html).toContain('abc123');
|
||||
expect(html).toContain('autenticidade dependem da análise documental');
|
||||
expect(html).not.toContain('/storage/');
|
||||
expect(
|
||||
renderToString(
|
||||
<CandidateDocumentList baseUrl="/unused" documents={[]} />,
|
||||
),
|
||||
).toBe('');
|
||||
});
|
||||
test.each([true, false])(
|
||||
'actual submission form reuses geographic profile and requires email confirmation (%s)',
|
||||
(emailVerified) => {
|
||||
@@ -54,6 +89,13 @@ test.each([true, false])(
|
||||
data: {
|
||||
name: 'Nome do perfil',
|
||||
summary: 'Perfil fictício',
|
||||
additional_availability: [
|
||||
{
|
||||
province: 'Outra província',
|
||||
district: 'Outro distrito',
|
||||
locality: 'Outra localidade',
|
||||
},
|
||||
],
|
||||
availability: {
|
||||
province: 'Província do perfil',
|
||||
district: 'Distrito do perfil',
|
||||
@@ -68,6 +110,11 @@ test.each([true, false])(
|
||||
);
|
||||
expect(html).toContain('value="Nome do perfil"');
|
||||
expect(html).toContain('value="Distrito do perfil"');
|
||||
expect(html).toContain('Usar local guardado no perfil');
|
||||
expect(html).toContain('Outra localidade');
|
||||
expect(html).toContain('type="file"');
|
||||
expect(html).toContain('Currículo obrigatório');
|
||||
expect(html).toContain('accept=".pdf,.docx"');
|
||||
expect(html).toContain('Submeter candidatura e obter comprovativo');
|
||||
expect(html.includes('disabled=""')).toBe(!emailVerified);
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user