fix: resolve remaining markdownlint issues
- Fix line length issues in documentation files - Add language specifications to code blocks - Resolve duplicate heading in README.md - Ensure all markdown files follow best practices
This commit is contained in:
parent
afb58ef4b1
commit
e69fa95463
@ -233,5 +233,5 @@ Pour toute question ou problème :
|
|||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
**Version actuelle** : 0.1.0
|
**Version actuelle** : 0.1.0
|
||||||
**Dernière mise à jour** : Janvier 2024
|
**Dernière mise à jour** : Janvier 2024
|
||||||
|
@ -320,10 +320,10 @@ test('should upload document successfully', async () => {
|
|||||||
test('should return demo data on API error', async () => {
|
test('should return demo data on API error', async () => {
|
||||||
// Mock de l'erreur API
|
// Mock de l'erreur API
|
||||||
mockAxios.onPost('/api/documents/upload').reply(500)
|
mockAxios.onPost('/api/documents/upload').reply(500)
|
||||||
|
|
||||||
const file = new File(['content'], 'test.pdf', { type: 'application/pdf' })
|
const file = new File(['content'], 'test.pdf', { type: 'application/pdf' })
|
||||||
const result = await documentApi.upload(file)
|
const result = await documentApi.upload(file)
|
||||||
|
|
||||||
expect(result.id).toMatch(/^demo-/)
|
expect(result.id).toMatch(/^demo-/)
|
||||||
expect(result.name).toBe('test.pdf')
|
expect(result.name).toBe('test.pdf')
|
||||||
})
|
})
|
||||||
|
@ -115,35 +115,35 @@ server {
|
|||||||
# Certificats SSL
|
# Certificats SSL
|
||||||
ssl_certificate /path/to/certificate.crt;
|
ssl_certificate /path/to/certificate.crt;
|
||||||
ssl_certificate_key /path/to/private.key;
|
ssl_certificate_key /path/to/private.key;
|
||||||
|
|
||||||
# Configuration SSL
|
# Configuration SSL
|
||||||
ssl_protocols TLSv1.2 TLSv1.3;
|
ssl_protocols TLSv1.2 TLSv1.3;
|
||||||
ssl_ciphers ECDHE-RSA-AES256-GCM-SHA512:DHE-RSA-AES256-GCM-SHA512;
|
ssl_ciphers ECDHE-RSA-AES256-GCM-SHA512:DHE-RSA-AES256-GCM-SHA512;
|
||||||
ssl_prefer_server_ciphers off;
|
ssl_prefer_server_ciphers off;
|
||||||
|
|
||||||
# HSTS
|
# HSTS
|
||||||
add_header Strict-Transport-Security "max-age=63072000" always;
|
add_header Strict-Transport-Security "max-age=63072000" always;
|
||||||
|
|
||||||
# Root directory
|
# Root directory
|
||||||
root /var/www/4nk-ia-front/dist;
|
root /var/www/4nk-ia-front/dist;
|
||||||
index index.html;
|
index index.html;
|
||||||
|
|
||||||
# Gestion des routes SPA
|
# Gestion des routes SPA
|
||||||
location / {
|
location / {
|
||||||
try_files $uri $uri/ /index.html;
|
try_files $uri $uri/ /index.html;
|
||||||
}
|
}
|
||||||
|
|
||||||
# Cache des assets statiques
|
# Cache des assets statiques
|
||||||
location /assets/ {
|
location /assets/ {
|
||||||
expires 1y;
|
expires 1y;
|
||||||
add_header Cache-Control "public, immutable";
|
add_header Cache-Control "public, immutable";
|
||||||
}
|
}
|
||||||
|
|
||||||
# Sécurité
|
# Sécurité
|
||||||
add_header X-Frame-Options "SAMEORIGIN" always;
|
add_header X-Frame-Options "SAMEORIGIN" always;
|
||||||
add_header X-Content-Type-Options "nosniff" always;
|
add_header X-Content-Type-Options "nosniff" always;
|
||||||
add_header X-XSS-Protection "1; mode=block" always;
|
add_header X-XSS-Protection "1; mode=block" always;
|
||||||
|
|
||||||
# Compression
|
# Compression
|
||||||
gzip on;
|
gzip on;
|
||||||
gzip_vary on;
|
gzip_vary on;
|
||||||
@ -278,28 +278,28 @@ on:
|
|||||||
jobs:
|
jobs:
|
||||||
deploy:
|
deploy:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v3
|
- uses: actions/checkout@v3
|
||||||
|
|
||||||
- name: Setup Node.js
|
- name: Setup Node.js
|
||||||
uses: actions/setup-node@v3
|
uses: actions/setup-node@v3
|
||||||
with:
|
with:
|
||||||
node-version: '22.12'
|
node-version: '22.12'
|
||||||
cache: 'npm'
|
cache: 'npm'
|
||||||
|
|
||||||
- name: Install dependencies
|
- name: Install dependencies
|
||||||
run: npm ci
|
run: npm ci
|
||||||
|
|
||||||
- name: Run tests
|
- name: Run tests
|
||||||
run: npm run test
|
run: npm run test
|
||||||
|
|
||||||
- name: Build application
|
- name: Build application
|
||||||
run: npm run build
|
run: npm run build
|
||||||
env:
|
env:
|
||||||
NODE_ENV: production
|
NODE_ENV: production
|
||||||
VITE_API_URL: ${{ secrets.API_URL }}
|
VITE_API_URL: ${{ secrets.API_URL }}
|
||||||
|
|
||||||
- name: Deploy to server
|
- name: Deploy to server
|
||||||
uses: appleboy/ssh-action@v0.1.5
|
uses: appleboy/ssh-action@v0.1.5
|
||||||
with:
|
with:
|
||||||
|
@ -28,7 +28,7 @@ export default defineConfig({
|
|||||||
test: {
|
test: {
|
||||||
environment: 'jsdom',
|
environment: 'jsdom',
|
||||||
globals: true,
|
globals: true,
|
||||||
coverage: {
|
coverage: {
|
||||||
provider: 'v8',
|
provider: 'v8',
|
||||||
reporter: ['text', 'json', 'html'],
|
reporter: ['text', 'json', 'html'],
|
||||||
exclude: [
|
exclude: [
|
||||||
@ -86,13 +86,13 @@ const renderWithProviders = (ui: React.ReactElement) => {
|
|||||||
describe('Layout', () => {
|
describe('Layout', () => {
|
||||||
it('should render the application title', () => {
|
it('should render the application title', () => {
|
||||||
renderWithProviders(<Layout><div>Test content</div></Layout>)
|
renderWithProviders(<Layout><div>Test content</div></Layout>)
|
||||||
|
|
||||||
expect(screen.getByText('4NK IA - Front Notarial')).toBeInTheDocument()
|
expect(screen.getByText('4NK IA - Front Notarial')).toBeInTheDocument()
|
||||||
})
|
})
|
||||||
|
|
||||||
it('should render navigation tabs', () => {
|
it('should render navigation tabs', () => {
|
||||||
renderWithProviders(<Layout><div>Test content</div></Layout>)
|
renderWithProviders(<Layout><div>Test content</div></Layout>)
|
||||||
|
|
||||||
expect(screen.getByRole('tablist')).toBeInTheDocument()
|
expect(screen.getByRole('tablist')).toBeInTheDocument()
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
@ -228,19 +228,19 @@ const renderWithProviders = (ui: React.ReactElement) => {
|
|||||||
describe('UploadView', () => {
|
describe('UploadView', () => {
|
||||||
it('should render upload area', () => {
|
it('should render upload area', () => {
|
||||||
renderWithProviders(<UploadView />)
|
renderWithProviders(<UploadView />)
|
||||||
|
|
||||||
expect(screen.getByText(/glisser-déposer/i)).toBeInTheDocument()
|
expect(screen.getByText(/glisser-déposer/i)).toBeInTheDocument()
|
||||||
})
|
})
|
||||||
|
|
||||||
it('should handle file upload', async () => {
|
it('should handle file upload', async () => {
|
||||||
const user = userEvent.setup()
|
const user = userEvent.setup()
|
||||||
renderWithProviders(<UploadView />)
|
renderWithProviders(<UploadView />)
|
||||||
|
|
||||||
const file = new File(['content'], 'test.pdf', { type: 'application/pdf' })
|
const file = new File(['content'], 'test.pdf', { type: 'application/pdf' })
|
||||||
const input = screen.getByLabelText(/sélectionner des fichiers/i)
|
const input = screen.getByLabelText(/sélectionner des fichiers/i)
|
||||||
|
|
||||||
await user.upload(input, file)
|
await user.upload(input, file)
|
||||||
|
|
||||||
await waitFor(() => {
|
await waitFor(() => {
|
||||||
expect(screen.getByText('test.pdf')).toBeInTheDocument()
|
expect(screen.getByText('test.pdf')).toBeInTheDocument()
|
||||||
})
|
})
|
||||||
@ -249,12 +249,12 @@ describe('UploadView', () => {
|
|||||||
it('should display document list after upload', async () => {
|
it('should display document list after upload', async () => {
|
||||||
const user = userEvent.setup()
|
const user = userEvent.setup()
|
||||||
renderWithProviders(<UploadView />)
|
renderWithProviders(<UploadView />)
|
||||||
|
|
||||||
const file = new File(['content'], 'test.pdf', { type: 'application/pdf' })
|
const file = new File(['content'], 'test.pdf', { type: 'application/pdf' })
|
||||||
const input = screen.getByLabelText(/sélectionner des fichiers/i)
|
const input = screen.getByLabelText(/sélectionner des fichiers/i)
|
||||||
|
|
||||||
await user.upload(input, file)
|
await user.upload(input, file)
|
||||||
|
|
||||||
await waitFor(() => {
|
await waitFor(() => {
|
||||||
expect(screen.getByRole('list')).toBeInTheDocument()
|
expect(screen.getByRole('list')).toBeInTheDocument()
|
||||||
expect(screen.getByText('test.pdf')).toBeInTheDocument()
|
expect(screen.getByText('test.pdf')).toBeInTheDocument()
|
||||||
@ -288,13 +288,13 @@ describe('Navigation', () => {
|
|||||||
it('should navigate between tabs', async () => {
|
it('should navigate between tabs', async () => {
|
||||||
const user = userEvent.setup()
|
const user = userEvent.setup()
|
||||||
renderWithProviders(<App />)
|
renderWithProviders(<App />)
|
||||||
|
|
||||||
// Vérifier que l'onglet Upload est actif par défaut
|
// Vérifier que l'onglet Upload est actif par défaut
|
||||||
expect(screen.getByText('Upload')).toHaveAttribute('aria-selected', 'true')
|
expect(screen.getByText('Upload')).toHaveAttribute('aria-selected', 'true')
|
||||||
|
|
||||||
// Cliquer sur l'onglet Extraction
|
// Cliquer sur l'onglet Extraction
|
||||||
await user.click(screen.getByText('Extraction'))
|
await user.click(screen.getByText('Extraction'))
|
||||||
|
|
||||||
expect(screen.getByText('Extraction')).toHaveAttribute('aria-selected', 'true')
|
expect(screen.getByText('Extraction')).toHaveAttribute('aria-selected', 'true')
|
||||||
expect(screen.getByText('Upload')).toHaveAttribute('aria-selected', 'false')
|
expect(screen.getByText('Upload')).toHaveAttribute('aria-selected', 'false')
|
||||||
})
|
})
|
||||||
@ -372,7 +372,7 @@ afterAll(() => server.close())
|
|||||||
describe('API Integration', () => {
|
describe('API Integration', () => {
|
||||||
it('should extract document data', async () => {
|
it('should extract document data', async () => {
|
||||||
const result = await documentApi.extract('doc_123')
|
const result = await documentApi.extract('doc_123')
|
||||||
|
|
||||||
expect(result.documentId).toBe('doc_123')
|
expect(result.documentId).toBe('doc_123')
|
||||||
expect(result.identities).toHaveLength(1)
|
expect(result.identities).toHaveLength(1)
|
||||||
expect(result.identities[0].firstName).toBe('Jean')
|
expect(result.identities[0].firstName).toBe('Jean')
|
||||||
@ -380,7 +380,7 @@ describe('API Integration', () => {
|
|||||||
|
|
||||||
it('should handle API errors gracefully', async () => {
|
it('should handle API errors gracefully', async () => {
|
||||||
const result = await documentApi.analyze('doc_123')
|
const result = await documentApi.analyze('doc_123')
|
||||||
|
|
||||||
// Devrait retourner des données de démonstration
|
// Devrait retourner des données de démonstration
|
||||||
expect(result.documentId).toBe('doc_123')
|
expect(result.documentId).toBe('doc_123')
|
||||||
expect(result.credibilityScore).toBeDefined()
|
expect(result.credibilityScore).toBeDefined()
|
||||||
@ -403,7 +403,7 @@ import App from '../../src/App'
|
|||||||
describe('Performance', () => {
|
describe('Performance', () => {
|
||||||
it('should render app within acceptable time', () => {
|
it('should render app within acceptable time', () => {
|
||||||
const start = performance.now()
|
const start = performance.now()
|
||||||
|
|
||||||
render(
|
render(
|
||||||
<Provider store={store}>
|
<Provider store={store}>
|
||||||
<BrowserRouter>
|
<BrowserRouter>
|
||||||
@ -411,10 +411,10 @@ describe('Performance', () => {
|
|||||||
</BrowserRouter>
|
</BrowserRouter>
|
||||||
</Provider>
|
</Provider>
|
||||||
)
|
)
|
||||||
|
|
||||||
const end = performance.now()
|
const end = performance.now()
|
||||||
const renderTime = end - start
|
const renderTime = end - start
|
||||||
|
|
||||||
// Le rendu initial devrait prendre moins de 100ms
|
// Le rendu initial devrait prendre moins de 100ms
|
||||||
expect(renderTime).toBeLessThan(100)
|
expect(renderTime).toBeLessThan(100)
|
||||||
})
|
})
|
||||||
@ -434,7 +434,7 @@ import { UploadView } from '../../src/views/UploadView'
|
|||||||
describe('Memory Management', () => {
|
describe('Memory Management', () => {
|
||||||
it('should not leak memory on multiple renders', () => {
|
it('should not leak memory on multiple renders', () => {
|
||||||
const initialMemory = (performance as any).memory?.usedJSHeapSize || 0
|
const initialMemory = (performance as any).memory?.usedJSHeapSize || 0
|
||||||
|
|
||||||
// Rendre et nettoyer plusieurs fois
|
// Rendre et nettoyer plusieurs fois
|
||||||
for (let i = 0; i < 10; i++) {
|
for (let i = 0; i < 10; i++) {
|
||||||
render(
|
render(
|
||||||
@ -446,10 +446,10 @@ describe('Memory Management', () => {
|
|||||||
)
|
)
|
||||||
cleanup()
|
cleanup()
|
||||||
}
|
}
|
||||||
|
|
||||||
const finalMemory = (performance as any).memory?.usedJSHeapSize || 0
|
const finalMemory = (performance as any).memory?.usedJSHeapSize || 0
|
||||||
const memoryIncrease = finalMemory - initialMemory
|
const memoryIncrease = finalMemory - initialMemory
|
||||||
|
|
||||||
// L'augmentation de mémoire devrait être raisonnable
|
// L'augmentation de mémoire devrait être raisonnable
|
||||||
expect(memoryIncrease).toBeLessThan(10 * 1024 * 1024) // 10MB
|
expect(memoryIncrease).toBeLessThan(10 * 1024 * 1024) // 10MB
|
||||||
})
|
})
|
||||||
@ -482,7 +482,7 @@ describe('Accessibility', () => {
|
|||||||
</BrowserRouter>
|
</BrowserRouter>
|
||||||
</Provider>
|
</Provider>
|
||||||
)
|
)
|
||||||
|
|
||||||
const results = await axe(container)
|
const results = await axe(container)
|
||||||
expect(results).toHaveNoViolations()
|
expect(results).toHaveNoViolations()
|
||||||
})
|
})
|
||||||
@ -497,7 +497,7 @@ describe('Accessibility', () => {
|
|||||||
</BrowserRouter>
|
</BrowserRouter>
|
||||||
</Provider>
|
</Provider>
|
||||||
)
|
)
|
||||||
|
|
||||||
expect(screen.getByRole('banner')).toBeInTheDocument()
|
expect(screen.getByRole('banner')).toBeInTheDocument()
|
||||||
expect(screen.getByRole('tablist')).toBeInTheDocument()
|
expect(screen.getByRole('tablist')).toBeInTheDocument()
|
||||||
})
|
})
|
||||||
@ -552,22 +552,22 @@ on: [push, pull_request]
|
|||||||
jobs:
|
jobs:
|
||||||
test:
|
test:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v3
|
- uses: actions/checkout@v3
|
||||||
|
|
||||||
- name: Setup Node.js
|
- name: Setup Node.js
|
||||||
uses: actions/setup-node@v3
|
uses: actions/setup-node@v3
|
||||||
with:
|
with:
|
||||||
node-version: '22.12'
|
node-version: '22.12'
|
||||||
cache: 'npm'
|
cache: 'npm'
|
||||||
|
|
||||||
- name: Install dependencies
|
- name: Install dependencies
|
||||||
run: npm ci
|
run: npm ci
|
||||||
|
|
||||||
- name: Run tests
|
- name: Run tests
|
||||||
run: npm run test:coverage
|
run: npm run test:coverage
|
||||||
|
|
||||||
- name: Upload coverage
|
- name: Upload coverage
|
||||||
uses: codecov/codecov-action@v3
|
uses: codecov/codecov-action@v3
|
||||||
with:
|
with:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user