From e2749bf07b5642a646fc327977a4d53cdc12029f Mon Sep 17 00:00:00 2001 From: zhumeisongsong Date: Thu, 14 Nov 2024 16:16:50 +0900 Subject: [PATCH] =?UTF-8?q?test:=20=F0=9F=A7=AA=20test=20cases=20for=20use?= =?UTF-8?q?r=20entity?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- libs/user/domain/src/lib/user.entity.spec.ts | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 libs/user/domain/src/lib/user.entity.spec.ts diff --git a/libs/user/domain/src/lib/user.entity.spec.ts b/libs/user/domain/src/lib/user.entity.spec.ts new file mode 100644 index 0000000..7e91f5c --- /dev/null +++ b/libs/user/domain/src/lib/user.entity.spec.ts @@ -0,0 +1,15 @@ +import { User } from './user.entity'; + +describe('User Entity', () => { + it('should create a user with id and name', () => { + const user = new User('1', 'John Doe'); + expect(user.id).toBe('1'); + expect(user.name).toBe('John Doe'); + }); + + it('should allow updating the name', () => { + const user = new User('1', 'John Doe'); + user.name = 'Jane Doe'; + expect(user.name).toBe('Jane Doe'); + }); +}); \ No newline at end of file