feat: add unit and integration tests for rental management domain
- Introduced RentPaymentCorrectionTest and RentPaymentTest to validate payment and refund logic. - Added PhoneNumberTest to ensure proper normalization of phone numbers. - Created TenantTest to verify attachment management and tenant referencing. - Implemented ReplacementRentalApiJourneyIT for end-to-end testing of rental and payment workflows. - Documented architectural decisions in ADR-0014, emphasizing strict DDD boundaries and transaction management.
This commit is contained in:
1 parent
6ce0719a20
commit
e02ad54bcb
263 files changed
+10847
-7183
No files matched your search
@@ -1,11 +1,11 @@
|
||||
import { HttpClient } from '@angular/common/http';
|
||||
import { TestBed } from '@angular/core/testing';
|
||||
import { of, Subject, throwError } from 'rxjs';
|
||||
import { NEVER, of, Subject, throwError } from 'rxjs';
|
||||
import { vi } from 'vitest';
|
||||
import { SessionService } from './session.service';
|
||||
|
||||
describe('SessionService', () => {
|
||||
const http = { get: vi.fn() };
|
||||
const http = { get: vi.fn(), post: vi.fn() };
|
||||
|
||||
beforeEach(() => {
|
||||
vi.clearAllMocks();
|
||||
@@ -53,4 +53,15 @@ describe('SessionService', () => {
|
||||
expect(http.get).toHaveBeenCalledWith('/api/user');
|
||||
expect(service.username()).toBe('');
|
||||
});
|
||||
|
||||
it('posts logout with a truthful pending state', () => {
|
||||
const service = TestBed.inject(SessionService);
|
||||
service.status.set('authenticated');
|
||||
http.post.mockReturnValueOnce(NEVER);
|
||||
|
||||
service.logout();
|
||||
|
||||
expect(service.status()).toBe('signing-out');
|
||||
expect(http.post).toHaveBeenCalledWith('/logout', null, { responseType: 'text' });
|
||||
});
|
||||
});
|
||||
Reference in new issue
Block a user