Skip to content

Commit 93c3b8a

Browse files
author
vinhdq
committed
test: add more test cases for product entity
1 parent debd553 commit 93c3b8a

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

src/domain/product/entities/__tests__/product.entity.spec.ts

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -145,4 +145,15 @@ describe('Product Entity', () => {
145145
expect(() => product.increaseStock(0)).toThrow('Quantity must be a positive integer.');
146146
expect(() => product.decreaseStock(0)).toThrow('Quantity must be a positive integer.');
147147
});
148+
149+
it('should create product with optional images and tags', () => {
150+
const product = new Product({
151+
...baseProps,
152+
images: ['https://example.com/img1.png'],
153+
tags: ['featured', 'tech'],
154+
});
155+
156+
expect(product.images).toEqual(['https://example.com/img1.png']);
157+
expect(product.tags).toEqual(['featured', 'tech']);
158+
});
148159
});

0 commit comments

Comments
 (0)