Skip to content

Commit

Permalink
jest: Fix test breakage
Browse files Browse the repository at this point in the history
  • Loading branch information
sashko9807 committed Oct 19, 2023
1 parent ed56cfc commit 3f48f56
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 5 deletions.
3 changes: 0 additions & 3 deletions apps/api/src/auth/auth.service.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@ describe('AuthService', () => {
email: '[email protected]',
emailConfirmed: false,
phone: null,
company: null,
picture: null,
createdAt: new Date('2021-10-07T13:38:11.097Z'),
updatedAt: new Date('2021-10-07T13:38:11.097Z'),
Expand Down Expand Up @@ -424,7 +423,6 @@ describe('AuthService', () => {
email,
emailConfirmed: false,
phone: null,
company: null,
picture: null,
createdAt: new Date('2021-10-07T13:38:11.097Z'),
updatedAt: new Date('2021-10-07T13:38:11.097Z'),
Expand Down Expand Up @@ -473,7 +471,6 @@ describe('AuthService', () => {
email,
emailConfirmed: false,
phone: null,
company: null,
picture: null,
createdAt: new Date('2021-10-07T13:38:11.097Z'),
updatedAt: new Date('2021-10-07T13:38:11.097Z'),
Expand Down
4 changes: 3 additions & 1 deletion apps/api/src/auth/register.controller.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import { Test, TestingModule } from '@nestjs/testing'
import { AuthService } from './auth.service'
import { RegisterController } from './register.controller'
import { RegisterDto } from './dto/register.dto'
import { CompanyModule } from '../company/company.module'

describe('RegisterController', () => {
let controller: RegisterController
Expand All @@ -21,6 +22,7 @@ describe('RegisterController', () => {
const module: TestingModule = await Test.createTestingModule({
controllers: [RegisterController],
providers: [AuthService, AuthServiceProvider],
imports: [CompanyModule],
}).compile()

controller = module.get<RegisterController>(RegisterController)
Expand All @@ -34,7 +36,7 @@ describe('RegisterController', () => {
describe('createUser', () => {
const registerDto = new RegisterDto()
it('should call createUser', async () => {
expect(await controller.register(registerDto))
expect(await controller.registerIndividual(registerDto))
expect(spyService.createUser).toHaveBeenCalled()
expect(spyService.createUser).toHaveBeenCalledWith(registerDto)
})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ import { SchedulerRegistry } from '@nestjs/schedule'
import { EmailService } from '../email/email.service'
import { TemplateService } from '../email/template.service'
import { MarketingNotificationsModule } from '../notifications/notifications.module'
import { AffiliateService } from '../affiliate/affiliate.service'

const bankTransactionsMock = [
{
Expand Down Expand Up @@ -145,6 +146,7 @@ describe('BankTransactionsController', () => {
SchedulerRegistry,
EmailService,
TemplateService,
AffiliateService,
],
}).compile()

Expand Down
5 changes: 4 additions & 1 deletion apps/api/src/campaign/campaign.controller.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,6 @@ describe('CampaignController', () => {
email: '[email protected]',
emailConfirmed: false,
phone: null,
company: null,
picture: null,
createdAt: new Date('2021-10-07T13:38:11.097Z'),
updatedAt: new Date('2021-10-07T13:38:11.097Z'),
Expand Down Expand Up @@ -226,6 +225,7 @@ describe('CampaignController', () => {
blockedAmount: 0,
withdrawnAmount: 0,
donors: 2,
guaranteedAmount: 0,
},
},
])
Expand Down Expand Up @@ -263,6 +263,7 @@ describe('CampaignController', () => {
blockedAmount: 0,
withdrawnAmount: 0,
donors: 2,
guaranteedAmount: 0,
},
},
])
Expand All @@ -287,6 +288,7 @@ describe('CampaignController', () => {
reachedAmount: 110,
currentAmount: 0,
blockedAmount: 0,
guaranteedAmount: 0,
withdrawnAmount: 0,
donors: 2,
},
Expand Down Expand Up @@ -325,6 +327,7 @@ describe('CampaignController', () => {
blockedAmount: 0,
withdrawnAmount: 0,
donors: 2,
guaranteedAmount: 0,
},
},
})
Expand Down

0 comments on commit 3f48f56

Please sign in to comment.