import { ReviewCommentImpl } from '../../../src/domain/entities/ReviewComment'; describe('ReviewComment Entity', () => { it('should create a review comment with required fields', () => { const comment = new ReviewCommentImpl() .id('comment-1') .filePath('src/test.ts') .message('This is a test comment') .severity('warning') .category('style') .build(); expect(comment.id).toBe('comment-1'); expect(comment.filePath).toBe('src/test.ts'); expect(comment.message).toBe('This is a test comment'); expect(comment.severity).toBe('warning'); expect(comment.category).toBe('style'); }); it('should create a review comment with optional fields', () => { const comment = new ReviewCommentImpl() .id('comment-2') .filePath('src/test.ts') .lineNumber(42) .message('This is a test comment with suggestion') .severity('error') .category('logic') .suggestion('Use a more descriptive variable name') .codeSnippet('const x = 1;') .metadata({ priority: 'high' }) .build(); expect(comment.lineNumber).toBe(42); expect(comment.suggestion).toBe('Use a more descriptive variable name'); expect(comment.codeSnippet).toBe('const x = 1;'); expect(comment.metadata).toEqual({ priority: 'high' }); }); it('should throw error when required fields are missing', () => { expect(() => { new ReviewCommentImpl() .filePath('src/test.ts') .message('Test comment') // Missing id, severity, category .build(); }).toThrow('Required fields missing for ReviewComment'); }); });