From 47ef669978e0849612d6133b1931f53d4ea514b5 Mon Sep 17 00:00:00 2001 From: ScottDormand96 Date: Mon, 27 Nov 2023 11:22:54 +0000 Subject: [PATCH] rename test and fix code smell --- .../src/entities/__tests__/recurring-payment.entity.spec.js | 4 ++-- .../src/services/recurring-payments.service.js | 4 +--- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/packages/dynamics-lib/src/entities/__tests__/recurring-payment.entity.spec.js b/packages/dynamics-lib/src/entities/__tests__/recurring-payment.entity.spec.js index 49a9fdb331..8ca272c0ee 100644 --- a/packages/dynamics-lib/src/entities/__tests__/recurring-payment.entity.spec.js +++ b/packages/dynamics-lib/src/entities/__tests__/recurring-payment.entity.spec.js @@ -47,7 +47,7 @@ describe('recurring payment entity', () => { return RecurringPayment.fromResponse(response, optionSetData) } - describe('cancelled data', () => { + describe('mappings with cancelled rp', () => { it('is a recurring payment', () => { const recurringPayment = getRecurringPayment() expect(recurringPayment).toBeInstanceOf(RecurringPayment) @@ -102,7 +102,7 @@ describe('recurring payment entity', () => { }) }) - describe('no cancelled data', () => { + describe('mappings without cancelled rp', () => { it('is a recurring payment', () => { const recurringPayment = getRecurringPayment({ defra_cancelleddate: null, defra_cancelledreason: null }) expect(recurringPayment).toBeInstanceOf(RecurringPayment) diff --git a/packages/sales-api-service/src/services/recurring-payments.service.js b/packages/sales-api-service/src/services/recurring-payments.service.js index fd16ea6b65..6a29e76b48 100644 --- a/packages/sales-api-service/src/services/recurring-payments.service.js +++ b/packages/sales-api-service/src/services/recurring-payments.service.js @@ -1,8 +1,6 @@ import { executeQuery, findDueRecurringPayments, RecurringPayment } from '@defra-fish/dynamics-lib' -export const getRecurringPayments = async date => { - return executeQuery(findDueRecurringPayments(date)) -} +export const getRecurringPayments = async date => executeQuery(findDueRecurringPayments(date)) /** * Process a recurring payment instruction