diff --git a/app/presenters/bill-licences/view-standard-charge-transaction.presenter.js b/app/presenters/bill-licences/view-standard-charge-transaction.presenter.js index e46d9c2bff..67d961b791 100644 --- a/app/presenters/bill-licences/view-standard-charge-transaction.presenter.js +++ b/app/presenters/bill-licences/view-standard-charge-transaction.presenter.js @@ -77,7 +77,9 @@ function _adjustments ( adjustments.push('Two-part tariff (0.5)') } - if (section130Agreement === 'true') { + // NOTE: Not only is this 'boolean' value held in a string field in the DB, when the legacy code sets the value + // it likes to add a space to the end! + if (section130Agreement.trim() === 'true') { adjustments.push('Canal and River Trust (0.5)') } diff --git a/test/presenters/bill-licences/view-standard-charge-transaction.presenter.test.js b/test/presenters/bill-licences/view-standard-charge-transaction.presenter.test.js index 213ebe6c9c..374424f7a7 100644 --- a/test/presenters/bill-licences/view-standard-charge-transaction.presenter.test.js +++ b/test/presenters/bill-licences/view-standard-charge-transaction.presenter.test.js @@ -136,9 +136,9 @@ describe('View Standard Charge Transaction presenter', () => { }) }) - describe("when the section 130 agreement is 'true' (they stored it as a string!)", () => { + describe("when the section 130 agreement is 'true ' (they stored it as a string!)", () => { beforeEach(() => { - transaction.section130Agreement = 'true' + transaction.section130Agreement = 'true ' }) it("returns 'Canal and River Trust (0.5)'", () => {