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
@@ -0,0 +1,20 @@
|
||||
import { TestBed } from '@angular/core/testing';
|
||||
import { vi } from 'vitest';
|
||||
import { PrivateAreaEditor } from './private-area-editor';
|
||||
|
||||
describe('PrivateAreaEditor', () => {
|
||||
it('adds a stable private area and derives the main-room count from its family', () => {
|
||||
const fixture = TestBed.createComponent(PrivateAreaEditor);
|
||||
fixture.componentRef.setInput('areas', []);
|
||||
const changed = vi.fn();
|
||||
fixture.componentInstance.areasChanged.subscribe(changed);
|
||||
|
||||
fixture.componentInstance.addArea();
|
||||
|
||||
expect(changed).toHaveBeenCalledWith([
|
||||
expect.objectContaining({ family: 'PIECE_PRINCIPALE', subtype: 'OTHER' }),
|
||||
]);
|
||||
fixture.componentRef.setInput('areas', changed.mock.calls[0][0]);
|
||||
expect(fixture.componentInstance.mainRoomCount()).toBe(1);
|
||||
});
|
||||
});
|
||||
Reference in new issue
Block a user