Skip to content

Commit cc5631c

Browse files
committed
fix: #25 fix init tests after changes
1 parent 9e2acdf commit cc5631c

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

api/src/controllers/auth/__tests__/auth.controller.spec.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ import { getUserStub } from '../../../__mocks__/user.stub';
1919
import { DatabaseServiceProvider } from '../../../services/database/database.service';
2020
import { ModuleRef } from '@nestjs/core';
2121
import { TokenServiceProvider } from '../../../services/token/token.service';
22+
import { v4 } from 'uuid';
2223

2324
describe('AuthController', () => {
2425
const appWrap = {} as AppWrap;
@@ -187,12 +188,13 @@ describe('AuthController', () => {
187188
refreshCookie: '2',
188189
refreshToken: '2',
189190
});
191+
const confirmUuid = v4();
190192
const response = await request(appWrap.app.getHttpServer())
191193
.post('/api/auth/confirm-email')
192194
.set('Content-Type', 'application/x-www-form-urlencoded')
193-
.send({ confirmUuid: '123' });
195+
.send({ confirmUuid });
194196

195-
expect(authService.confirmEmail).toBeCalledWith('123');
197+
expect(authService.confirmEmail).toBeCalledWith(confirmUuid);
196198
expect(response.statusCode).toEqual(200);
197199
expect(response.body).toEqual({
198200
success: true,

api/src/controllers/user/__tests__/user.controller.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ describe('UserController', () => {
117117

118118
expect(response.statusCode).toEqual(200);
119119
expect(omit(['created'], response.body.data)).toEqual(
120-
omit(['refreshToken', 'created'], user),
120+
omit(['refreshToken', 'created', 'emailConfirm', 'hash'], user),
121121
);
122122
});
123123
});

0 commit comments

Comments
 (0)