comments implement
This commit is contained in:
1 parent
9e0bef2527
commit
4b6ecfbf5d
41 files changed
+1350
-13
No files matched your search
@@ -0,0 +1,18 @@
|
||||
import { describe, expect, it } from 'vitest';
|
||||
import { CommentContent } from './comment-content.vo.js';
|
||||
|
||||
describe('CommentContent', () => {
|
||||
it('trims the value', () => {
|
||||
expect(CommentContent.create(' hello ').value).toBe('hello');
|
||||
});
|
||||
|
||||
it('rejects empty content', () => {
|
||||
expect(() => CommentContent.create(' ')).toThrow('Комментарий не может быть пустым');
|
||||
});
|
||||
|
||||
it('rejects content longer than the limit', () => {
|
||||
expect(() => CommentContent.create('a'.repeat(CommentContent.MAX_LENGTH + 1))).toThrow(
|
||||
`Комментарий не может превышать ${CommentContent.MAX_LENGTH} символов`,
|
||||
);
|
||||
});
|
||||
});
|
||||
Reference in new issue
Block a user