From f5ac24d81a79a0bfa0dc34fdc560f56a8d3551e2 Mon Sep 17 00:00:00 2001 From: Kevin Nowaczyk Date: Thu, 8 Jan 2026 13:55:07 -0500 Subject: [PATCH 1/4] Update buildingpart.test.js #149 --- test/buildingpart.test.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/test/buildingpart.test.js b/test/buildingpart.test.js index 16f6c55..e022b8f 100644 --- a/test/buildingpart.test.js +++ b/test/buildingpart.test.js @@ -67,6 +67,10 @@ test('Constructor', () => { expect(errors.length).toBe(0); }); +test('Normalize Length', () => { + expect(BuildingPart.normalizeLength('5km')).toBe(5000); +}); + window.printError = printError; var errors = []; From befa6deca0e88e23c78afec11140c06179853cd1 Mon Sep 17 00:00:00 2001 From: Kevin Nowaczyk Date: Thu, 8 Jan 2026 13:58:05 -0500 Subject: [PATCH 2/4] Update buildingpart.test.js --- test/buildingpart.test.js | 1 + 1 file changed, 1 insertion(+) diff --git a/test/buildingpart.test.js b/test/buildingpart.test.js index e022b8f..4d2c2aa 100644 --- a/test/buildingpart.test.js +++ b/test/buildingpart.test.js @@ -69,6 +69,7 @@ test('Constructor', () => { test('Normalize Length', () => { expect(BuildingPart.normalizeLength('5km')).toBe(5000); + expect(BuildingPart.normalizeLength('1mi')).toBe(1609.344); }); window.printError = printError; From 96311148e81ce65f7b051d56298f0311b171ab4e Mon Sep 17 00:00:00 2001 From: Kevin Nowaczyk Date: Thu, 8 Jan 2026 14:00:11 -0500 Subject: [PATCH 3/4] Update buildingpart.test.js --- test/buildingpart.test.js | 1 + 1 file changed, 1 insertion(+) diff --git a/test/buildingpart.test.js b/test/buildingpart.test.js index 4d2c2aa..2814eaa 100644 --- a/test/buildingpart.test.js +++ b/test/buildingpart.test.js @@ -70,6 +70,7 @@ test('Constructor', () => { test('Normalize Length', () => { expect(BuildingPart.normalizeLength('5km')).toBe(5000); expect(BuildingPart.normalizeLength('1mi')).toBe(1609.344); + expect(BuildingPart.normalizeLength('1nmi')).toBe(1852); }); window.printError = printError; From c15cb169a94a6f0dcc5cc455c3bc5e536ab4f390 Mon Sep 17 00:00:00 2001 From: Kevin Nowaczyk Date: Thu, 8 Jan 2026 14:02:15 -0500 Subject: [PATCH 4/4] Update buildingpart.js --- src/buildingpart.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/buildingpart.js b/src/buildingpart.js index 3f642ce..1e7cdd3 100644 --- a/src/buildingpart.js +++ b/src/buildingpart.js @@ -360,14 +360,14 @@ class BuildingPart { // remove final character. return parseFloat(length.substring(0, length.length - 2)) * 1000; } - if (length.includes('mi')){ - // remove final character. - return parseFloat(length.substring(0, length.length - 2)) * 5280 * 12 * 2.54 / 100; - } if (length.includes('nmi')){ // remove final character. return parseFloat(length.substring(0, length.length - 3)) * 1852; } + if (length.includes('mi')){ + // remove final character. + return parseFloat(length.substring(0, length.length - 2)) * 5280 * 12 * 2.54 / 100; + } if (length.includes('m')){ // remove final character. return parseFloat(length.substring(0, length.length - 1));