From c6e8c992841de4d7d34ea5230df9bf7446aac168 Mon Sep 17 00:00:00 2001 From: Mark Whitaker Date: Fri, 24 Nov 2023 15:50:53 +0000 Subject: [PATCH] CTSKF-445 Fix spelling of sanitize in Sidebar.js and tests --- .../modules/external_users/claims/SideBar.js | 4 ++-- spec/javascripts/modules-sidebar_spec.js | 12 ++++++------ 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/app/webpack/javascripts/modules/external_users/claims/SideBar.js b/app/webpack/javascripts/modules/external_users/claims/SideBar.js index 34ef5c04af..7f6a098f34 100644 --- a/app/webpack/javascripts/modules/external_users/claims/SideBar.js +++ b/app/webpack/javascripts/modules/external_users/claims/SideBar.js @@ -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) @@ -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') { diff --git a/spec/javascripts/modules-sidebar_spec.js b/spec/javascripts/modules-sidebar_spec.js index edcd1b15aa..43a76b588a 100644 --- a/spec/javascripts/modules-sidebar_spec.js +++ b/spec/javascripts/modules-sidebar_spec.js @@ -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() }) }) @@ -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, @@ -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) }) })