feat(rental): add inventory and condition reports (#7)

This commit is contained in:
nessar authored and Nessar committed 2026-08-17 14:18:16 +02:00
1 parent 92d8a3e351
commit e4be5cd05f
193 files changed
+9697 -483

No files matched your search

@@ -199,6 +199,7 @@ describe('LeaseCard', () => {
expect(text).toContain('Modifier');
expect(text).toContain('Supprimer');
expect(text).toContain('Finaliser le bail');
expect(text).not.toContain('État des lieux d’entrée');
expect(text).not.toContain('Activer');
const finalization = [...fixture.nativeElement.querySelectorAll('button')].find((button) =>
button.textContent.includes('Finaliser le bail'),
@@ -206,6 +207,26 @@ describe('LeaseCard', () => {
finalization.click();
expect(requested).toHaveBeenCalledWith('lease-1');
fixture.componentRef.setInput('revision', {
number: 1,
templateVersion: 'FR-MEUBLE-2025-01',
sourceFingerprint: 'source',
sha256: 'sha256',
generatedAt: '2026-01-01T10:00:00Z',
authorId: 'owner-1',
annexes: [],
warningCodes: [],
warnings: [],
});
fixture.detectChanges();
const conditionReportRequested = vi.fn();
fixture.componentInstance.conditionReportRequested.subscribe(conditionReportRequested);
const entryReport = [...fixture.nativeElement.querySelectorAll('button')].find((button) =>
button.textContent.includes('État des lieux d’entrée'),
);
entryReport.click();
expect(conditionReportRequested).toHaveBeenCalledWith({ leaseId: 'lease-1', type: 'ENTRY' });
fixture.componentRef.setInput('lease', {
...fixture.componentInstance.lease(),
status: 'ACTIVE',