Skip to content

Commit

Permalink
Fix: Controller unit test for postMarkForSupplementaryBilling
Browse files Browse the repository at this point in the history
  • Loading branch information
Beckyrose200 committed Oct 24, 2024
1 parent eb81d3d commit f97f330
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions test/internal/modules/view-licences/controller.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ experiment('internal/modules/billing/controllers/bills-tab', () => {
response: sandbox.stub().returns(),
redirect: sandbox.stub()
}
sandbox.stub(services.water.licences, 'postMarkLicenceForSupplementaryBilling').resolves()
sandbox.stub(services.system.licences, 'supplementary').resolves()
sandbox.stub(services.system.returns, 'supplementary').resolves()
sandbox.stub(services.water.licences, 'getDocumentByLicenceId').resolves({
metadata: {},
system_external_id: 'test id'
Expand Down Expand Up @@ -439,8 +439,8 @@ experiment('internal/modules/billing/controllers/bills-tab', () => {
await controller.postMarkLicenceForSupplementaryBilling(request, h)
})

test('calls system', () => {
expect(services.system.licences.supplementary.calledWith(tempReturnId)).to.be.true()
test('calls system with the returnId', () => {
expect(services.system.returns.supplementary.calledWith(tempReturnId)).to.be.true()
})
})

Expand Down Expand Up @@ -468,8 +468,8 @@ experiment('internal/modules/billing/controllers/bills-tab', () => {
await controller.postMarkLicenceForSupplementaryBilling(request, h)
})

test('calls the backend', () => {
expect(services.water.licences.postMarkLicenceForSupplementaryBilling.calledWith(tempLicenceId)).to.be.true()
test('calls system with the licenceId', () => {
expect(services.system.licences.supplementary.calledWith(tempLicenceId)).to.be.true()
})

test('returns the correct view data objects', async () => {
Expand Down

0 comments on commit f97f330

Please sign in to comment.