Skip to content

Commit

Permalink
CTSKF-445 Fix spelling of sanitize in Sidebar.js and tests
Browse files Browse the repository at this point in the history
  • Loading branch information
mpw5 committed Nov 24, 2023
1 parent 521a1ad commit 2b7f8a6
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ moj.Modules.SideBar = {
const self = this
let selector
let value
this.sanitzeFeeToFloat()
this.sanitizeFeeToFloat()
$.each(this.totals, function (key, val) {
selector = '.total-' + key
value = moj.Helpers.Blocks.formatNumber(val)
Expand Down Expand Up @@ -136,7 +136,7 @@ moj.Modules.SideBar = {
})
},

sanitzeFeeToFloat: function () {
sanitizeFeeToFloat: function () {
const self = this
$.each(this.totals, function (key, val) {
if (typeof self.totals[key] === 'string') {
Expand Down
12 changes: 6 additions & 6 deletions spec/javascripts/modules-sidebar_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -232,10 +232,10 @@ describe('Modules.SideBar.js', function () {
expect($el.find('.total-grandTotal')[0].innerHTML).toBe('£333.00')
})

it('should call `sanitzeFeeToFloat`', function () {
spyOn(moj.Modules.SideBar, 'sanitzeFeeToFloat')
it('should call `sanitizeFeeToFloat`', function () {
spyOn(moj.Modules.SideBar, 'sanitizeFeeToFloat')
moj.Modules.SideBar.render()
expect(moj.Modules.SideBar.sanitzeFeeToFloat).toHaveBeenCalled()
expect(moj.Modules.SideBar.sanitizeFeeToFloat).toHaveBeenCalled()
})
})

Expand Down Expand Up @@ -388,8 +388,8 @@ describe('Modules.SideBar.js', function () {
})
})

describe('...sanitzeFeeToFloat', function () {
it('should sanitze the totals correctly', function () {
describe('...sanitizeFeeToFloat', function () {
it('should sanitize the totals correctly', function () {
const expected = {
fees: 10.20,
disbursements: 4558.99,
Expand All @@ -405,7 +405,7 @@ describe('Modules.SideBar.js', function () {
grandTotal: 0
}

moj.Modules.SideBar.sanitzeFeeToFloat()
moj.Modules.SideBar.sanitizeFeeToFloat()
expect(moj.Modules.SideBar.totals).toEqual(expected)
})
})
Expand Down

0 comments on commit 2b7f8a6

Please sign in to comment.