Skip to content

Commit

Permalink
test: 🧪 test cases for user entity
Browse files Browse the repository at this point in the history
  • Loading branch information
zhumeisongsong committed Nov 14, 2024
1 parent 5557035 commit e2749bf
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions libs/user/domain/src/lib/user.entity.spec.ts
Original file line number Diff line number Diff line change
@@ -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');
});
});

0 comments on commit e2749bf

Please sign in to comment.