feat(rental): add inventory and condition reports (#7)
This commit is contained in:
1 parent
92d8a3e351
commit
e4be5cd05f
193 files changed
+9697
-483
No files matched your search
@@ -217,6 +217,64 @@ test('follows operating-system changes for the System theme', async ({ page }) =
|
||||
await expect(page.locator('html')).toHaveAttribute('data-theme', 'light');
|
||||
});
|
||||
|
||||
test('offers the native guided photo control for an entry condition report', async ({ page }) => {
|
||||
await mockUser(page, true);
|
||||
await page.route(
|
||||
(url) => url.pathname === '/api/leases/lease-1/condition-reports/ENTRY',
|
||||
async (route) => {
|
||||
await route.fulfill({
|
||||
contentType: 'application/json',
|
||||
json: {
|
||||
id: 'report-1',
|
||||
type: 'ENTRY',
|
||||
status: 'DRAFT',
|
||||
occurredOn: '2026-07-22',
|
||||
timeZone: 'Europe/Paris',
|
||||
participants: [],
|
||||
forwardingAddresses: [],
|
||||
zones: [
|
||||
{
|
||||
id: 'kitchen',
|
||||
privateAreaId: 'area-kitchen',
|
||||
label: 'Cuisine',
|
||||
equipment: 'NONE',
|
||||
},
|
||||
],
|
||||
observations: [{ subjectId: 'kitchen', state: 'BON_ETAT', observation: '' }],
|
||||
meterReadings: [],
|
||||
accessMeans: [],
|
||||
inventoryConditions: [],
|
||||
photos: [],
|
||||
zonePhotoAbsences: [],
|
||||
entryPhotoDispositions: [],
|
||||
supplements: [],
|
||||
entrySnapshot: null,
|
||||
revisions: [],
|
||||
currentRevision: null,
|
||||
finalization: null,
|
||||
deliveryAttestations: [],
|
||||
leaseRevisionNumber: 1,
|
||||
leaseRevisionFingerprint: 'lease-source',
|
||||
version: 0,
|
||||
},
|
||||
});
|
||||
},
|
||||
);
|
||||
|
||||
await page.goto('/leases/lease-1/condition-reports/ENTRY');
|
||||
|
||||
const kitchen = page.getByRole('article').filter({
|
||||
has: page.getByRole('heading', { name: 'Cuisine' }),
|
||||
});
|
||||
const photo = kitchen.getByLabel('Prendre ou choisir une photo');
|
||||
await expect(photo).toHaveAttribute(
|
||||
'accept',
|
||||
'image/jpeg,image/png,image/webp,image/heic,image/heif',
|
||||
);
|
||||
await expect(photo).toHaveAttribute('capture', 'environment');
|
||||
await expect(page.getByRole('heading', { name: 'Parcours photos guidé' })).toBeVisible();
|
||||
});
|
||||
|
||||
test('creates a tenant with an attachment and a lease with a guarantor', async ({ page }) => {
|
||||
const apartments = [
|
||||
{
|
||||
|
||||
Reference in new issue
Block a user