chore: update project documentation, audit reports, and initialize IDE configuration files
Some checks failed
CI / Lint → Typecheck → Test → Build (22) (push) Failing after 29s
CI / E2E Tests (push) Has been skipped
CodeQL Analysis / CodeQL (javascript-typescript) (push) Failing after 2m42s
Deploy / Build Web Image (push) Failing after 27s
Deploy / Build AI Services Image (push) Failing after 29s
E2E Tests / Playwright E2E (push) Failing after 43s
Deploy / Build API Image (push) Failing after 1m31s
Security Scanning / Dependency Audit (pnpm) (push) Failing after 6s
Security Scanning / Trivy Scan — API Image (push) Failing after 5m35s
Security Scanning / Trivy Scan — AI Services Image (push) Failing after 3m45s
Deploy / Deploy to Staging (push) Has been skipped
Deploy / Smoke Test Staging (push) Has been skipped
Deploy / Deploy to Production (push) Has been skipped
Deploy / Smoke Test Production (push) Has been skipped
Deploy / Rollback Staging (push) Has been skipped
Deploy / Rollback Production (push) Has been skipped
Security Scanning / Trivy Scan — Web Image (push) Failing after 13m51s
Security Scanning / Trivy Filesystem Scan (push) Failing after 14m46s
Security Scanning / Security Gate (push) Has been cancelled
Some checks failed
CI / Lint → Typecheck → Test → Build (22) (push) Failing after 29s
CI / E2E Tests (push) Has been skipped
CodeQL Analysis / CodeQL (javascript-typescript) (push) Failing after 2m42s
Deploy / Build Web Image (push) Failing after 27s
Deploy / Build AI Services Image (push) Failing after 29s
E2E Tests / Playwright E2E (push) Failing after 43s
Deploy / Build API Image (push) Failing after 1m31s
Security Scanning / Dependency Audit (pnpm) (push) Failing after 6s
Security Scanning / Trivy Scan — API Image (push) Failing after 5m35s
Security Scanning / Trivy Scan — AI Services Image (push) Failing after 3m45s
Deploy / Deploy to Staging (push) Has been skipped
Deploy / Smoke Test Staging (push) Has been skipped
Deploy / Deploy to Production (push) Has been skipped
Deploy / Smoke Test Production (push) Has been skipped
Deploy / Rollback Staging (push) Has been skipped
Deploy / Rollback Production (push) Has been skipped
Security Scanning / Trivy Scan — Web Image (push) Failing after 13m51s
Security Scanning / Trivy Filesystem Scan (push) Failing after 14m46s
Security Scanning / Security Gate (push) Has been cancelled
This commit is contained in:
@@ -1,80 +1,80 @@
|
||||
# Test Coverage Audit - Quick Reference Guide
|
||||
# Kiểm Toán Độ Phủ Kiểm Thử - Tài Liệu Tham Khảo Nhanh
|
||||
|
||||
**Generated:** April 10, 2026
|
||||
**Repository:** GoodGo Platform AI Monorepo
|
||||
**Modules Audited:** Listings, Auth, Search
|
||||
**Ngày tạo:** 10 tháng 4 năm 2026
|
||||
**Kho lưu trữ:** GoodGo Platform AI Monorepo
|
||||
**Các module được kiểm toán:** Listings, Auth, Search
|
||||
|
||||
---
|
||||
|
||||
## 📊 Coverage Overview
|
||||
## 📊 Tổng Quan Độ Phủ
|
||||
|
||||
| Module | Source Files | Test Files | Coverage | Status |
|
||||
| Module | Tệp nguồn | Tệp kiểm thử | Độ phủ | Trạng thái |
|
||||
|--------|:----:|:----:|:---:|:---:|
|
||||
| **Listings** | 42 | 13 | **31%** | ⚠️ Low |
|
||||
| **Auth** | 56 | 21 | **38%** | ⚠️ Low |
|
||||
| **Search** | 22 | 10 | **45%** | ⚠️ Low |
|
||||
| **TOTAL** | **120** | **44** | **37%** | ⚠️ Low |
|
||||
| **Listings** | 42 | 13 | **31%** | ⚠️ Thấp |
|
||||
| **Auth** | 56 | 21 | **38%** | ⚠️ Thấp |
|
||||
| **Search** | 22 | 10 | **45%** | ⚠️ Thấp |
|
||||
| **TỔNG CỘNG** | **120** | **44** | **37%** | ⚠️ Thấp |
|
||||
|
||||
---
|
||||
|
||||
## 🔴 CRITICAL - Must Test First (11 files)
|
||||
## 🔴 NGHIÊM TRỌNG - Phải Kiểm Thử Trước (11 tệp)
|
||||
|
||||
### AUTH Module - Security Critical (4 files)
|
||||
### Module AUTH - Nghiêm trọng về Bảo mật (4 tệp)
|
||||
```
|
||||
1. presentation/guards/jwt-auth.guard.ts
|
||||
└─ Why: Token validation security
|
||||
└─ Test: Valid tokens, expired, invalid signatures
|
||||
└─ Lý do: Bảo mật xác thực token
|
||||
└─ Kiểm thử: Token hợp lệ, đã hết hạn, chữ ký không hợp lệ
|
||||
|
||||
2. presentation/guards/roles.guard.ts
|
||||
└─ Why: Authorization enforcement
|
||||
└─ Test: Admin access, user access, denied access
|
||||
└─ Lý do: Thực thi phân quyền
|
||||
└─ Kiểm thử: Truy cập admin, truy cập người dùng, truy cập bị từ chối
|
||||
|
||||
3. infrastructure/repositories/prisma-user.repository.ts
|
||||
└─ Why: Primary user data access
|
||||
└─ Test: CRUD operations, user lookup queries
|
||||
└─ Lý do: Truy cập dữ liệu người dùng chính
|
||||
└─ Kiểm thử: Các thao tác CRUD, truy vấn tìm kiếm người dùng
|
||||
|
||||
4. infrastructure/strategies/jwt.strategy.ts
|
||||
└─ Why: JWT authentication
|
||||
└─ Test: Token validation, user extraction
|
||||
└─ Lý do: Xác thực JWT
|
||||
└─ Kiểm thử: Xác thực token, trích xuất thông tin người dùng
|
||||
```
|
||||
|
||||
### LISTINGS Module - Business Logic Critical (4 files)
|
||||
### Module LISTINGS - Nghiêm trọng về Logic Nghiệp vụ (4 tệp)
|
||||
```
|
||||
5. infrastructure/services/prisma-duplicate-detector.ts
|
||||
└─ Why: Core duplicate detection
|
||||
└─ Test: Database queries, similarity logic
|
||||
└─ Lý do: Phát hiện trùng lặp cốt lõi
|
||||
└─ Kiểm thử: Truy vấn cơ sở dữ liệu, logic tương đồng
|
||||
|
||||
6. infrastructure/services/prisma-price-validator.ts
|
||||
└─ Why: Price validation logic
|
||||
└─ Test: Price ranges, validation rules
|
||||
└─ Lý do: Logic xác thực giá
|
||||
└─ Kiểm thử: Khoảng giá, quy tắc xác thực
|
||||
|
||||
7. infrastructure/repositories/prisma-listing.repository.ts
|
||||
└─ Why: Primary listing data access
|
||||
└─ Test: CRUD operations, complex queries
|
||||
└─ Lý do: Truy cập dữ liệu tin đăng chính
|
||||
└─ Kiểm thử: Các thao tác CRUD, truy vấn phức tạp
|
||||
|
||||
8. domain/services/moderation.service.ts
|
||||
└─ Why: Moderation business rules
|
||||
└─ Test: Approval/rejection logic, scoring
|
||||
└─ Lý do: Quy tắc nghiệp vụ kiểm duyệt
|
||||
└─ Kiểm thử: Logic phê duyệt/từ chối, chấm điểm
|
||||
```
|
||||
|
||||
### SEARCH Module - Integration Critical (2 files)
|
||||
### Module SEARCH - Nghiêm trọng về Tích hợp (2 tệp)
|
||||
```
|
||||
9. infrastructure/services/typesense-client.service.ts
|
||||
└─ Why: Search engine integration
|
||||
└─ Test: Client init, connection, errors
|
||||
└─ Lý do: Tích hợp công cụ tìm kiếm
|
||||
└─ Kiểm thử: Khởi tạo client, kết nối, lỗi
|
||||
|
||||
10. infrastructure/services/postgres-search.repository.ts
|
||||
└─ Why: Fallback search implementation
|
||||
└─ Test: Query building, fallback logic
|
||||
└─ Lý do: Triển khai tìm kiếm dự phòng
|
||||
└─ Kiểm thử: Xây dựng truy vấn, logic dự phòng
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## 📋 Complete Listings Module Files
|
||||
## 📋 Danh Sách Đầy Đủ Tệp Module Listings
|
||||
|
||||
### ✅ Already Tested (13 files)
|
||||
### ✅ Đã Kiểm Thử (13 tệp)
|
||||
|
||||
**Application Layer (8):**
|
||||
**Tầng Application (8):**
|
||||
- ✓ create-listing.handler.spec.ts
|
||||
- ✓ get-listing.handler.spec.ts
|
||||
- ✓ get-pending-moderation.handler.spec.ts
|
||||
@@ -84,16 +84,16 @@
|
||||
- ✓ update-listing-status.handler.spec.ts
|
||||
- ✓ upload-media.handler.spec.ts
|
||||
|
||||
**Domain Layer (5):**
|
||||
**Tầng Domain (5):**
|
||||
- ✓ duplicate-detector.spec.ts
|
||||
- ✓ listing-events.spec.ts
|
||||
- ✓ listing.entity.spec.ts
|
||||
- ✓ property.entity.spec.ts
|
||||
- ✓ value-objects.spec.ts
|
||||
|
||||
### ❌ Missing Tests (29 files)
|
||||
### ❌ Chưa Có Kiểm Thử (29 tệp)
|
||||
|
||||
**Domain Layer (10):**
|
||||
**Tầng Domain (10):**
|
||||
- ✗ domain/services/moderation.service.ts [TIER 1]
|
||||
- ✗ domain/repositories/listing.repository.ts (interface)
|
||||
- ✗ domain/repositories/property.repository.ts (interface)
|
||||
@@ -101,14 +101,14 @@
|
||||
- ✗ domain/events/listing-approved.event.ts
|
||||
- ✗ domain/events/listing-sold.event.ts
|
||||
- ✗ domain/events/listing-status-changed.event.ts
|
||||
- ✗ domain/entities/* (already has tests - consolidate if needed)
|
||||
- ✗ domain/value-objects/* (already has tests - consolidate if needed)
|
||||
- ✗ domain/services/duplicate-detector.ts (has handler test, needs unit test)
|
||||
- ✗ domain/entities/* (đã có kiểm thử - hợp nhất nếu cần)
|
||||
- ✗ domain/value-objects/* (đã có kiểm thử - hợp nhất nếu cần)
|
||||
- ✗ domain/services/duplicate-detector.ts (có kiểm thử handler, cần kiểm thử đơn vị)
|
||||
|
||||
**Application Layer (0 - All Covered):**
|
||||
All handlers and commands are tested.
|
||||
**Tầng Application (0 - Đã Phủ Toàn Bộ):**
|
||||
Tất cả các handler và command đều đã được kiểm thử.
|
||||
|
||||
**Infrastructure Layer (6):**
|
||||
**Tầng Infrastructure (6):**
|
||||
- ✗ infrastructure/services/prisma-duplicate-detector.ts [TIER 1]
|
||||
- ✗ infrastructure/services/prisma-price-validator.ts [TIER 1]
|
||||
- ✗ infrastructure/services/media-storage.service.ts
|
||||
@@ -116,7 +116,7 @@ All handlers and commands are tested.
|
||||
- ✗ infrastructure/repositories/prisma-property.repository.ts
|
||||
- ✗ infrastructure/repositories/listing-read.queries.ts
|
||||
|
||||
**Presentation Layer (13):**
|
||||
**Tầng Presentation (13):**
|
||||
- ✗ listings.module.ts
|
||||
- ✗ presentation/controllers/listings.controller.ts
|
||||
- ✗ presentation/dto/create-listing.dto.ts
|
||||
@@ -126,11 +126,11 @@ All handlers and commands are tested.
|
||||
|
||||
---
|
||||
|
||||
## 📋 Complete Auth Module Files
|
||||
## 📋 Danh Sách Đầy Đủ Tệp Module Auth
|
||||
|
||||
### ✅ Already Tested (21 files)
|
||||
### ✅ Đã Kiểm Thử (21 tệp)
|
||||
|
||||
**Application Layer (12):**
|
||||
**Tầng Application (12):**
|
||||
- ✓ cancel-user-deletion.handler.spec.ts
|
||||
- ✓ export-user-data.handler.spec.ts
|
||||
- ✓ force-delete-user.handler.spec.ts
|
||||
@@ -143,33 +143,33 @@ All handlers and commands are tested.
|
||||
- ✓ request-user-deletion.handler.spec.ts
|
||||
- ✓ verify-kyc.handler.spec.ts
|
||||
|
||||
**Infrastructure Layer (4):**
|
||||
**Tầng Infrastructure (4):**
|
||||
- ✓ google-oauth.strategy.spec.ts
|
||||
- ✓ oauth.service.spec.ts
|
||||
- ✓ token.service.spec.ts
|
||||
- ✓ zalo-oauth.strategy.spec.ts
|
||||
|
||||
**Domain Layer (5):**
|
||||
**Tầng Domain (5):**
|
||||
- ✓ auth-events.spec.ts
|
||||
- ✓ email.vo.spec.ts
|
||||
- ✓ hashed-password.vo.spec.ts
|
||||
- ✓ phone.vo.spec.ts
|
||||
- ✓ user.entity.spec.ts
|
||||
|
||||
**Integration (1):**
|
||||
**Tích hợp (1):**
|
||||
- ✓ auth.integration.spec.ts
|
||||
|
||||
### ❌ Missing Tests (35 files)
|
||||
### ❌ Chưa Có Kiểm Thử (35 tệp)
|
||||
|
||||
**Infrastructure Layer (6):**
|
||||
**Tầng Infrastructure (6):**
|
||||
- ✗ infrastructure/strategies/jwt.strategy.ts [TIER 1]
|
||||
- ✗ infrastructure/strategies/local.strategy.ts
|
||||
- ✗ infrastructure/repositories/prisma-user.repository.ts [TIER 1]
|
||||
- ✗ infrastructure/repositories/prisma-refresh-token.repository.ts
|
||||
|
||||
**Presentation Layer (14):**
|
||||
- ✗ presentation/guards/jwt-auth.guard.ts [TIER 1 - CRITICAL]
|
||||
- ✗ presentation/guards/roles.guard.ts [TIER 1 - CRITICAL]
|
||||
**Tầng Presentation (14):**
|
||||
- ✗ presentation/guards/jwt-auth.guard.ts [TIER 1 - NGHIÊM TRỌNG]
|
||||
- ✗ presentation/guards/roles.guard.ts [TIER 1 - NGHIÊM TRỌNG]
|
||||
- ✗ presentation/guards/local-auth.guard.ts
|
||||
- ✗ presentation/guards/google-oauth.guard.ts
|
||||
- ✗ presentation/decorators/current-user.decorator.ts
|
||||
@@ -184,53 +184,53 @@ All handlers and commands are tested.
|
||||
- ✗ presentation/dto/force-delete-user.dto.ts
|
||||
- ✗ presentation/dto/request-deletion.dto.ts
|
||||
|
||||
**Other (15):**
|
||||
**Khác (15):**
|
||||
- ✗ auth.module.ts
|
||||
|
||||
---
|
||||
|
||||
## 📋 Complete Search Module Files
|
||||
## 📋 Danh Sách Đầy Đủ Tệp Module Search
|
||||
|
||||
### ✅ Already Tested (10 files)
|
||||
### ✅ Đã Kiểm Thử (10 tệp)
|
||||
|
||||
**Application Layer (4):**
|
||||
**Tầng Application (4):**
|
||||
- ✓ geo-search.handler.spec.ts
|
||||
- ✓ reindex-all.handler.spec.ts
|
||||
- ✓ search-properties.handler.spec.ts
|
||||
- ✓ sync-listing.handler.spec.ts
|
||||
|
||||
**Infrastructure Layer (4):**
|
||||
**Tầng Infrastructure (4):**
|
||||
- ✓ listing-approved.handler.spec.ts
|
||||
- ✓ listing-indexer.service.spec.ts
|
||||
- ✓ resilient-search.repository.spec.ts
|
||||
- ✓ typesense-search.repository.spec.ts
|
||||
|
||||
**Domain Layer (1):**
|
||||
**Tầng Domain (1):**
|
||||
- ✓ search-domain.spec.ts
|
||||
|
||||
**Presentation Layer (1):**
|
||||
**Tầng Presentation (1):**
|
||||
- ✓ search.controller.spec.ts
|
||||
|
||||
### ❌ Missing Tests (12 files)
|
||||
### ❌ Chưa Có Kiểm Thử (12 tệp)
|
||||
|
||||
**Infrastructure Layer (3):**
|
||||
**Tầng Infrastructure (3):**
|
||||
- ✗ infrastructure/services/typesense-client.service.ts [TIER 1]
|
||||
- ✗ infrastructure/services/postgres-search.repository.ts [TIER 1]
|
||||
- ✗ infrastructure/event-handlers/listing-status-changed.handler.ts
|
||||
|
||||
**Presentation Layer (2):**
|
||||
**Tầng Presentation (2):**
|
||||
- ✗ presentation/dto/geo-search.dto.ts
|
||||
- ✗ presentation/dto/search-properties.dto.ts
|
||||
|
||||
**Other (1):**
|
||||
**Khác (1):**
|
||||
- ✗ search.module.ts
|
||||
|
||||
---
|
||||
|
||||
## 🎯 Implementation Roadmap
|
||||
## 🎯 Lộ Trình Triển Khai
|
||||
|
||||
### Week 1 - Critical Security & Business Logic (11 files)
|
||||
**Time: ~20-25 hours**
|
||||
### Tuần 1 - Bảo mật Nghiêm trọng & Logic Nghiệp vụ (11 tệp)
|
||||
**Thời gian: ~20-25 giờ**
|
||||
|
||||
- [ ] **AUTH** - jwt-auth.guard.spec.ts (3h)
|
||||
- [ ] **AUTH** - roles.guard.spec.ts (3h)
|
||||
@@ -243,8 +243,8 @@ All handlers and commands are tested.
|
||||
- [ ] **SEARCH** - typesense-client.service.spec.ts (2.5h)
|
||||
- [ ] **SEARCH** - postgres-search.repository.spec.ts (2.5h)
|
||||
|
||||
### Week 2-3 - High Priority Infrastructure (9 files)
|
||||
**Time: ~15-18 hours**
|
||||
### Tuần 2-3 - Infrastructure Ưu tiên Cao (9 tệp)
|
||||
**Thời gian: ~15-18 giờ**
|
||||
|
||||
- [ ] **AUTH** - local.strategy.spec.ts (2.5h)
|
||||
- [ ] **AUTH** - prisma-refresh-token.repository.spec.ts (2.5h)
|
||||
@@ -255,8 +255,8 @@ All handlers and commands are tested.
|
||||
- [ ] **LISTINGS** - media-storage.service.spec.ts (2h)
|
||||
- [ ] **SEARCH** - listing-status-changed.handler.spec.ts (2h)
|
||||
|
||||
### Week 4 - Medium Priority (Controllers, Decorators)
|
||||
**Time: ~12-15 hours**
|
||||
### Tuần 4 - Ưu tiên Trung bình (Controller, Decorator)
|
||||
**Thời gian: ~12-15 giờ**
|
||||
|
||||
- [ ] **AUTH** - auth.controller.spec.ts (2.5h)
|
||||
- [ ] **AUTH** - oauth.controller.spec.ts (2.5h)
|
||||
@@ -264,24 +264,24 @@ All handlers and commands are tested.
|
||||
- [ ] **AUTH** - current-user.decorator.spec.ts (1.5h)
|
||||
- [ ] **AUTH** - roles.decorator.spec.ts (1.5h)
|
||||
- [ ] **LISTINGS** - listings.controller.spec.ts (2.5h)
|
||||
- [ ] **SEARCH** - Nothing here (controller already tested)
|
||||
- [ ] **SEARCH** - Không có gì ở đây (controller đã được kiểm thử)
|
||||
|
||||
### Week 5+ - DTOs, Module Configuration, E2E Tests
|
||||
**Time: ~10+ hours**
|
||||
### Tuần 5+ - DTO, Cấu hình Module, Kiểm thử E2E
|
||||
**Thời gian: ~10+ giờ**
|
||||
|
||||
- [ ] All DTO validation tests (3-4 files per module)
|
||||
- [ ] Module configuration tests
|
||||
- [ ] End-to-end integration tests
|
||||
- [ ] Full user flow tests
|
||||
- [ ] Tất cả kiểm thử xác thực DTO (3-4 tệp mỗi module)
|
||||
- [ ] Kiểm thử cấu hình module
|
||||
- [ ] Kiểm thử tích hợp end-to-end
|
||||
- [ ] Kiểm thử luồng người dùng hoàn chỉnh
|
||||
|
||||
---
|
||||
|
||||
## 🧪 Test Type Guidelines
|
||||
## 🧪 Hướng Dẫn Loại Kiểm Thử
|
||||
|
||||
### Unit Tests (50 minutes per file avg)
|
||||
**For:** Services, repositories, value objects, entities
|
||||
### Kiểm Thử Đơn Vị (trung bình 50 phút mỗi tệp)
|
||||
**Dành cho:** Service, repository, value object, entity
|
||||
```typescript
|
||||
// Test structure
|
||||
// Cấu trúc kiểm thử
|
||||
describe('ServiceName', () => {
|
||||
let service: ServiceName;
|
||||
let mockDependency: Mock;
|
||||
@@ -296,13 +296,13 @@ describe('ServiceName', () => {
|
||||
});
|
||||
```
|
||||
|
||||
### Integration Tests (60 minutes per file avg)
|
||||
**For:** Repositories, event handlers, strategies
|
||||
### Kiểm Thử Tích Hợp (trung bình 60 phút mỗi tệp)
|
||||
**Dành cho:** Repository, event handler, strategy
|
||||
```typescript
|
||||
// Test structure - usually with database/real service
|
||||
// Cấu trúc kiểm thử - thường dùng với cơ sở dữ liệu/dịch vụ thực
|
||||
describe('RepositoryName', () => {
|
||||
let repository: RepositoryName;
|
||||
let prisma: PrismaClient; // or real client
|
||||
let prisma: PrismaClient; // hoặc client thực
|
||||
|
||||
beforeEach(async () => {
|
||||
await setupTestDatabase();
|
||||
@@ -315,10 +315,10 @@ describe('RepositoryName', () => {
|
||||
});
|
||||
```
|
||||
|
||||
### Guard/Decorator Tests (30 minutes per file avg)
|
||||
**For:** Guards, decorators, middleware
|
||||
### Kiểm Thử Guard/Decorator (trung bình 30 phút mỗi tệp)
|
||||
**Dành cho:** Guard, decorator, middleware
|
||||
```typescript
|
||||
// Test structure
|
||||
// Cấu trúc kiểm thử
|
||||
describe('GuardName', () => {
|
||||
let guard: GuardName;
|
||||
let mockExecutionContext: Mock;
|
||||
@@ -328,10 +328,10 @@ describe('GuardName', () => {
|
||||
});
|
||||
```
|
||||
|
||||
### Controller Tests (40 minutes per file avg)
|
||||
**For:** REST controllers
|
||||
### Kiểm Thử Controller (trung bình 40 phút mỗi tệp)
|
||||
**Dành cho:** REST controller
|
||||
```typescript
|
||||
// Test structure
|
||||
// Cấu trúc kiểm thử
|
||||
describe('ControllerName', () => {
|
||||
let controller: ControllerName;
|
||||
let mockService: Mock;
|
||||
@@ -341,10 +341,10 @@ describe('ControllerName', () => {
|
||||
});
|
||||
```
|
||||
|
||||
### DTO Tests (20 minutes per file avg)
|
||||
**For:** Data validation objects
|
||||
### Kiểm Thử DTO (trung bình 20 phút mỗi tệp)
|
||||
**Dành cho:** Đối tượng xác thực dữ liệu
|
||||
```typescript
|
||||
// Test structure - focus on validation
|
||||
// Cấu trúc kiểm thử - tập trung vào xác thực
|
||||
describe('DtoName', () => {
|
||||
it('should validate correct data', () => {});
|
||||
it('should reject invalid email', () => {});
|
||||
@@ -354,60 +354,59 @@ describe('DtoName', () => {
|
||||
|
||||
---
|
||||
|
||||
## 📊 Coverage by Architectural Layer
|
||||
## 📊 Độ Phủ theo Tầng Kiến Trúc
|
||||
|
||||
### Domain Layer
|
||||
| Category | Listings | Auth | Search | Total | Coverage |
|
||||
### Tầng Domain
|
||||
| Danh mục | Listings | Auth | Search | Tổng | Độ phủ |
|
||||
|----------|:---:|:---:|:---:|:---:|:---:|
|
||||
| Entities | 3/3 ✓ | 1/1 ✓ | - | 4/4 | **100%** |
|
||||
| Value Objects | 3/3 ✓ | 3/3 ✓ | 2/2 ✓ | 8/8 | **100%** |
|
||||
| Services | 2/3 | - | - | 2/3 | **67%** |
|
||||
| Repositories | 0/3 | 0/2 | 0/1 | 0/6 | **0%** |
|
||||
| Events | 1/4 | 1/4 | - | 2/8 | **25%** |
|
||||
| **Total Domain** | **9/16** | **5/10** | **2/3** | **16/29** | **55%** |
|
||||
| Entity | 3/3 ✓ | 1/1 ✓ | - | 4/4 | **100%** |
|
||||
| Value Object | 3/3 ✓ | 3/3 ✓ | 2/2 ✓ | 8/8 | **100%** |
|
||||
| Service | 2/3 | - | - | 2/3 | **67%** |
|
||||
| Repository | 0/3 | 0/2 | 0/1 | 0/6 | **0%** |
|
||||
| Event | 1/4 | 1/4 | - | 2/8 | **25%** |
|
||||
| **Tổng Domain** | **9/16** | **5/10** | **2/3** | **16/29** | **55%** |
|
||||
|
||||
### Application Layer
|
||||
| Category | Listings | Auth | Search | Total | Coverage |
|
||||
### Tầng Application
|
||||
| Danh mục | Listings | Auth | Search | Tổng | Độ phủ |
|
||||
|----------|:---:|:---:|:---:|:---:|:---:|
|
||||
| Handlers | 8/8 ✓ | 12/12 ✓ | 8/8 ✓ | 28/28 | **100%** |
|
||||
| Commands | - | - | - | - | **100%** |
|
||||
| Queries | - | - | - | - | **100%** |
|
||||
| **Total App** | **8/8** | **12/12** | **8/8** | **28/28** | **100%** |
|
||||
| Handler | 8/8 ✓ | 12/12 ✓ | 8/8 ✓ | 28/28 | **100%** |
|
||||
| Command | - | - | - | - | **100%** |
|
||||
| Query | - | - | - | - | **100%** |
|
||||
| **Tổng App** | **8/8** | **12/12** | **8/8** | **28/28** | **100%** |
|
||||
|
||||
### Infrastructure Layer
|
||||
| Category | Listings | Auth | Search | Total | Coverage |
|
||||
### Tầng Infrastructure
|
||||
| Danh mục | Listings | Auth | Search | Tổng | Độ phủ |
|
||||
|----------|:---:|:---:|:---:|:---:|:---:|
|
||||
| Repositories | 0/3 | 0/2 | 0/2 | 0/7 | **0%** |
|
||||
| Services | 1/3 | 2/2 ✓ | 3/5 | 6/10 | **60%** |
|
||||
| Strategies | - | 2/4 | - | 2/4 | **50%** |
|
||||
| Event Handlers | - | - | 1/2 | 1/2 | **50%** |
|
||||
| **Total Infra** | **1/6** | **4/8** | **4/9** | **9/23** | **39%** |
|
||||
| Repository | 0/3 | 0/2 | 0/2 | 0/7 | **0%** |
|
||||
| Service | 1/3 | 2/2 ✓ | 3/5 | 6/10 | **60%** |
|
||||
| Strategy | - | 2/4 | - | 2/4 | **50%** |
|
||||
| Event Handler | - | - | 1/2 | 1/2 | **50%** |
|
||||
| **Tổng Infra** | **1/6** | **4/8** | **4/9** | **9/23** | **39%** |
|
||||
|
||||
### Presentation Layer
|
||||
| Category | Listings | Auth | Search | Total | Coverage |
|
||||
### Tầng Presentation
|
||||
| Danh mục | Listings | Auth | Search | Tổng | Độ phủ |
|
||||
|----------|:---:|:---:|:---:|:---:|:---:|
|
||||
| Controllers | 0/1 | 0/3 | 1/1 ✓ | 1/5 | **20%** |
|
||||
| Guards | - | 0/4 | - | 0/4 | **0%** |
|
||||
| Decorators | - | 0/2 | - | 0/2 | **0%** |
|
||||
| DTOs | 0/4 | 0/6 | 0/2 | 0/12 | **0%** |
|
||||
| **Total Presentation** | **0/5** | **0/15** | **1/3** | **1/23** | **4%** |
|
||||
| Controller | 0/1 | 0/3 | 1/1 ✓ | 1/5 | **20%** |
|
||||
| Guard | - | 0/4 | - | 0/4 | **0%** |
|
||||
| Decorator | - | 0/2 | - | 0/2 | **0%** |
|
||||
| DTO | 0/4 | 0/6 | 0/2 | 0/12 | **0%** |
|
||||
| **Tổng Presentation** | **0/5** | **0/15** | **1/3** | **1/23** | **4%** |
|
||||
|
||||
### Summary
|
||||
| Layer | Files | Tested | Coverage |
|
||||
### Tóm Tắt
|
||||
| Tầng | Tệp | Đã kiểm thử | Độ phủ |
|
||||
|-------|:---:|:---:|:---:|
|
||||
| **Domain** | 29 | 16 | 55% |
|
||||
| **Application** | 28 | 28 | 100% ✓ |
|
||||
| **Infrastructure** | 23 | 9 | 39% |
|
||||
| **Presentation** | 23 | 1 | 4% |
|
||||
| **TOTAL** | **103** | **54** | **52%** |
|
||||
| **TỔNG CỘNG** | **103** | **54** | **52%** |
|
||||
|
||||
---
|
||||
|
||||
## 📝 Notes
|
||||
|
||||
- Coverage percentages exclude index.ts barrel files
|
||||
- Commands/Queries are tested via their handlers
|
||||
- Abstract repository interfaces are not tested (only implementations)
|
||||
- Integration tests marked separately from unit tests
|
||||
- Estimated times assume Vitest/Jest experience
|
||||
## 📝 Ghi Chú
|
||||
|
||||
- Tỷ lệ phần trăm độ phủ không tính các tệp barrel index.ts
|
||||
- Command/Query được kiểm thử thông qua các handler tương ứng
|
||||
- Các interface repository trừu tượng không được kiểm thử (chỉ kiểm thử phần triển khai)
|
||||
- Kiểm thử tích hợp được đánh dấu riêng biệt so với kiểm thử đơn vị
|
||||
- Thời gian ước tính giả định có kinh nghiệm với Vitest/Jest
|
||||
|
||||
Reference in New Issue
Block a user