Skip to content

Commit

Permalink
test: 🧪 pass test cases
Browse files Browse the repository at this point in the history
  • Loading branch information
zhumeisongsong committed Nov 18, 2024
1 parent d4b4671 commit 68b3e36
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
13 changes: 13 additions & 0 deletions libs/users/presentation/dto/src/lib/user.dto.spec.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import { UserDto } from './user.dto';

describe('UserDto', () => {
it('should create a new UserDto instance', () => {
const id = '123';
const name = 'Test User';
const userDto = new UserDto(id, name);

expect(userDto).toBeDefined();
expect(userDto.id).toBe(id);
expect(userDto.name).toBe(name);
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ describe('UsersResolver', () => {
it('should return undefined if user not found', () => {
jest.spyOn(service, 'findById').mockReturnValue(undefined);

expect(resolver.getUser('2')).toBeUndefined();
expect(resolver.getUser('2')).toBeNull();
expect(service.findById).toHaveBeenCalledWith('2');
});
});
Expand Down

0 comments on commit 68b3e36

Please sign in to comment.