From d16feb6d58fbe4fdc6b93411026ae76b2a6b7149 Mon Sep 17 00:00:00 2001 From: emelko <ml.kochsiek@mailbox.org> Date: Wed, 5 Sep 2018 16:03:27 +0200 Subject: [PATCH] Renaming cervixPeak in cervixPeakBeforeShift bc it mustn't be the highest cervix value --- lib/sympto/cervix.js | 2 +- test/sympto/cervix-temp.spec.js | 2 +- test/sympto/cervix.spec.js | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/sympto/cervix.js b/lib/sympto/cervix.js index 2e0dff42..9a596451 100644 --- a/lib/sympto/cervix.js +++ b/lib/sympto/cervix.js @@ -27,7 +27,7 @@ export default function (cycleDays, tempEvalEndIndex) { if (onlyClosedAndHardUntilEndOfTempEval) { return { detected: true, - cervixPeak: day, + cervixPeakBeforeShift: day, evaluationCompleteDay: threeFollowingDays[threeFollowingDays.length - 1] } } diff --git a/test/sympto/cervix-temp.spec.js b/test/sympto/cervix-temp.spec.js index a610d656..17e20898 100644 --- a/test/sympto/cervix-temp.spec.js +++ b/test/sympto/cervix-temp.spec.js @@ -142,9 +142,9 @@ describe('sympto', () => { start: { date: '2018-06-17', time: '18:00' }, cycleDays: tempAndCervixEvalEndOnSameDay .filter(({date}) => date >= '2018-06-17') + expect(status.cervixShift.cervixPeakBeforeShift.date).to.eql('2018-06-14') }) expect(status.cervixShift.detected).to.be.true() - expect(status.cervixShift.cervixPeak.date).to.eql('2018-06-14') expect(status.cervixShift.evaluationCompleteDay.date).to.eql('2018-06-17') }) diff --git a/test/sympto/cervix.spec.js b/test/sympto/cervix.spec.js index 9bcc2a21..6c43cb90 100644 --- a/test/sympto/cervix.spec.js +++ b/test/sympto/cervix.spec.js @@ -35,7 +35,7 @@ describe('sympto', () => { const status = getCervixStatus(values) expect(status).to.eql({ detected: true, - cervixPeak: { + cervixPeakBeforeShift: { date: 13, cervix: { isHard: true, @@ -58,7 +58,7 @@ describe('sympto', () => { const status = getCervixStatus(values) expect(status).to.eql({ detected: true, - cervixPeak: { + cervixPeakBeforeShift: { date: 0, cervix: { isHard: false, -- GitLab