4840 multi workspace update user userworkspace inconsistent on delete set null constraint (#5373)

This commit is contained in:
martmull 2024-05-13 14:50:27 +02:00 committed by GitHub
parent 8576127b47
commit 0018ec78b0
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 4 additions and 4 deletions

View File

@ -14,6 +14,9 @@ module.exports = {
transform: { transform: {
'^.+\\.(t|j)s$': 'ts-jest', '^.+\\.(t|j)s$': 'ts-jest',
}, },
fakeTimers: {
enableGlobally: true,
},
collectCoverageFrom: ['**/*.(t|j)s'], collectCoverageFrom: ['**/*.(t|j)s'],
coverageDirectory: '../coverage', coverageDirectory: '../coverage',
}; };

View File

@ -160,9 +160,6 @@ describe('TokenService', () => {
}; };
const mockUser = { id: '1', email: 'user@example.com' }; const mockUser = { id: '1', email: 'user@example.com' };
const mockedNewDate = new Date();
jest.spyOn(global, 'Date').mockImplementation(() => mockedNewDate);
jest jest
.spyOn(appTokenRepository, 'findOne') .spyOn(appTokenRepository, 'findOne')
.mockResolvedValue(mockToken as AppToken); .mockResolvedValue(mockToken as AppToken);
@ -176,7 +173,7 @@ describe('TokenService', () => {
where: { where: {
value: hashedToken, value: hashedToken,
type: AppTokenType.PasswordResetToken, type: AppTokenType.PasswordResetToken,
expiresAt: MoreThan(mockedNewDate), expiresAt: MoreThan(new Date()),
revokedAt: IsNull(), revokedAt: IsNull(),
}, },
}); });