From 307d70b369381d233f5eb29386f19ab92402fea7 Mon Sep 17 00:00:00 2001 From: Vera Kahn Date: Thu, 19 Dec 2024 12:09:30 -0500 Subject: [PATCH] rm argument from isUnfamiliarPatronType --- lib/available_delivery_location_types.js | 6 +++--- test/available_delivery_location_types.test.js | 3 +-- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/lib/available_delivery_location_types.js b/lib/available_delivery_location_types.js index 3177e0dc..43183395 100644 --- a/lib/available_delivery_location_types.js +++ b/lib/available_delivery_location_types.js @@ -9,7 +9,7 @@ class AvailableDeliveryLocationTypes { return this._getPatronTypeOf(patronID) .then((patronType) => { - if (this._isUnfamiliarPatronType(nyplCore.patronTypes(), patronType)) { + if (this._isUnfamiliarPatronType(patronType)) { return } const patronTypeData = nyplCore.patronTypes()[patronType] @@ -38,8 +38,8 @@ class AvailableDeliveryLocationTypes { }) } - static _isUnfamiliarPatronType (patronTypes, patronType) { - if (!patronTypes[patronType]) { + static _isUnfamiliarPatronType (patronType) { + if (!nyplCore.patronTypes()[patronType]) { logger.info(`Found the Patron Type: ${patronType} is not recognizable.`) return true } else { diff --git a/test/available_delivery_location_types.test.js b/test/available_delivery_location_types.test.js index 00787530..89c1f349 100644 --- a/test/available_delivery_location_types.test.js +++ b/test/available_delivery_location_types.test.js @@ -1,8 +1,7 @@ const fixtures = require('./fixtures') +const AvailableDeliveryLocationTypes = require('../lib/available_delivery_location_types.js') describe('AvailableDeliveryLocationTypes', function () { - const AvailableDeliveryLocationTypes = require('../lib/available_delivery_location_types.js') - before(function () { // Reroute these (and only these) api paths to local fixtures: fixtures.enableDataApiFixtures({