Skip to content

Commit 81772c0

Browse files
committed
fix: unit tests
1 parent ac7f0e4 commit 81772c0

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

test/unit/ResourceBookingService.test.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -447,7 +447,7 @@ describe('resourceBooking service test', () => {
447447
expect(esClientSearch.calledOnce).to.be.true
448448
expect(result).to.deep.eq(data.result)
449449
})
450-
it('T25:Search resource bookin from DB', async () => {
450+
it('T25:Search resource booking from DB', async () => {
451451
const data = testData.T25
452452
const ESClient = commonData.ESClient
453453
ESClient.search = () => {}
@@ -456,7 +456,7 @@ describe('resourceBooking service test', () => {
456456
return data.resourceBookingFindAll
457457
})
458458
const stubResourceBookingCount = sinon.stub(ResourceBooking, 'count').callsFake(async () => {
459-
return data.resourceBookingFindAll.length
459+
return data.resourceBookingCount
460460
})
461461
const result = await service.searchResourceBookings(commonData.userWithManagePermission, data.criteria)
462462
expect(esClientSearch.calledOnce).to.be.true

test/unit/common/ResourceBookingData.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1229,6 +1229,8 @@ const T25 = {
12291229
updatedAt: '2021-05-08T18:47:37.268Z'
12301230
}
12311231
],
1232+
resourceBookingCount: [{ id: 'fbe133dd-0e36-4d0c-8197-49307b13ce75', count: 1 },
1233+
{ id: '60e99790-8da0-4596-badc-29a06feb78a0', count: 1 }],
12321234
criteria: {},
12331235
result: {
12341236
fromDb: true,

0 commit comments

Comments
 (0)