From 2f42840faab33a66410d8a4e2927b02e15de98b1 Mon Sep 17 00:00:00 2001 From: emelko Date: Mon, 10 Sep 2018 12:09:37 +0200 Subject: [PATCH] Revert "Renaming test cycles to be more explicit abt what they do" This reverts commit 969da1d16346edae005459c07003826c84cda190. --- test/sympto/cervix-temp-fixtures.js | 4 ++-- test/sympto/cervix-temp.spec.js | 28 ++++++++++++++-------------- 2 files changed, 16 insertions(+), 16 deletions(-) diff --git a/test/sympto/cervix-temp-fixtures.js b/test/sympto/cervix-temp-fixtures.js index c7e7df3..0c8ae85 100644 --- a/test/sympto/cervix-temp-fixtures.js +++ b/test/sympto/cervix-temp-fixtures.js @@ -15,7 +15,7 @@ function convertToSymptoFormat(val) { return sympto } -export const cervixShiftAndFhmOnSameDay = [ +export const idealCycle = [ { date: '2018-08-01', bleeding: 1, cervix: { opening: 1, firmness: 1 } }, { date: '2018-08-02', bleeding: 2, cervix: { opening: 1, firmness: 1 } }, { date: '2018-08-03', temperature: 36.6, bleeding: 2, cervix: { opening: 2, firmness: 1 } }, @@ -189,7 +189,7 @@ export const cervixShift2DaysAfterTempShift = [ { date: '2018-04-24', temperature: 36.75, cervix: { opening: 0, firmness: 0 } } ].map(convertToSymptoFormat) -export const noOvulationDetected = [ +export const noInfertilePhaseDetected = [ { date: '2018-03-08', bleeding: 3 }, { date: '2018-03-09', bleeding: 3 }, { date: '2018-03-10', bleeding: 3 }, diff --git a/test/sympto/cervix-temp.spec.js b/test/sympto/cervix-temp.spec.js index 3f20a5e..6b06ddd 100644 --- a/test/sympto/cervix-temp.spec.js +++ b/test/sympto/cervix-temp.spec.js @@ -1,14 +1,14 @@ import chai from 'chai' import getSensiplanStatus from '../../lib/sympto' import { - cervixShiftAndFhmOnSameDay, + idealCycle, cycleWithFhmNoCervixShift, cycleWithoutFhm, cycleWithoutAnyShifts, tempAndCervixEvalEndOnSameDay, tempShift3DaysAfterCervixShift, cervixShift2DaysAfterTempShift, - noOvulationDetected, + noInfertilePhaseDetected, fiveDayCycle } from './cervix-temp-fixtures' @@ -51,7 +51,7 @@ describe('sympto', () => { }) it('with temp and cervix shifts detects only peri- and post-ovulatory phases', () => { const status = getSensiplanStatus({ - cycle: cervixShiftAndFhmOnSameDay, + cycle: idealCycle, previousCycle: cycleWithoutFhm, secondarySymptom: 'cervix' }) @@ -62,12 +62,12 @@ describe('sympto', () => { expect(status.phases.periOvulatory).to.eql({ start: { date: '2018-08-01' }, end: { date: '2018-08-15', time: '18:00' }, - cycleDays: cervixShiftAndFhmOnSameDay + cycleDays: idealCycle .filter(({date}) => date <= '2018-08-15') }) expect(status.phases.postOvulatory).to.eql({ start: { date: '2018-08-15', time: '18:00' }, - cycleDays: cervixShiftAndFhmOnSameDay + cycleDays: idealCycle .filter(({date}) => date >= '2018-08-15') }) }) @@ -76,7 +76,7 @@ describe('sympto', () => { it('with no shifts detects only peri-ovulatory in 3-day long cycle according to 5-day rule', () => { const status = getSensiplanStatus({ cycle: fiveDayCycle, - previousCycle: cervixShiftAndFhmOnSameDay, + previousCycle: idealCycle, secondarySymptom: 'cervix' }) expect(Object.keys(status.phases).length).to.eql(1) @@ -89,7 +89,7 @@ describe('sympto', () => { it('with no shifts detects pre- and peri-ovulatory phase according to 5-day-rule', () => { const status = getSensiplanStatus({ cycle: cycleWithoutAnyShifts, - previousCycle: cervixShiftAndFhmOnSameDay, + previousCycle: idealCycle, secondarySymptom: 'cervix' }) @@ -109,7 +109,7 @@ describe('sympto', () => { it('with evaluation of temperature and cervix end on same day', () => { const status = getSensiplanStatus({ cycle: tempAndCervixEvalEndOnSameDay, - previousCycle: cervixShiftAndFhmOnSameDay, + previousCycle: idealCycle, secondarySymptom: 'cervix' }) expect(Object.keys(status.phases).length).to.eql(3) @@ -139,7 +139,7 @@ describe('sympto', () => { it('when temperature shift happens 3 days after cervix shift', () => { const status = getSensiplanStatus({ cycle: tempShift3DaysAfterCervixShift, - previousCycle: cervixShiftAndFhmOnSameDay, + previousCycle: idealCycle, secondarySymptom: 'cervix' }) expect(Object.keys(status.phases).length).to.eql(3) @@ -171,7 +171,7 @@ describe('sympto', () => { it('when cervix shift happens 2 days after temperature shift', () => { const status = getSensiplanStatus({ cycle: cervixShift2DaysAfterTempShift, - previousCycle: cervixShiftAndFhmOnSameDay, + previousCycle: idealCycle, secondarySymptom: 'cervix' }) expect(Object.keys(status.phases).length).to.eql(3) @@ -201,19 +201,19 @@ describe('sympto', () => { }) it('when no infertile phase can be detected', () => { const status = getSensiplanStatus({ - cycle: noOvulationDetected, - previousCycle: cervixShiftAndFhmOnSameDay, + cycle: noInfertilePhaseDetected, + previousCycle: idealCycle, secondarySymptom: 'cervix' }) expect(Object.keys(status.phases).length).to.eql(2) expect(status.phases.preOvulatory).to.eql({ - cycleDays: noOvulationDetected + cycleDays: noInfertilePhaseDetected .filter(({date}) => date <= '2018-03-12'), start: { date: '2018-03-08' }, end: { date: '2018-03-12' } }) expect(status.phases.periOvulatory).to.eql({ - cycleDays: noOvulationDetected + cycleDays: noInfertilePhaseDetected .filter(({date}) => date > '2018-03-12'), start: { date: '2018-03-13' } })