Revert "Renaming test cycles to be more explicit abt what they do"

This reverts commit 969da1d163.
This commit is contained in:
emelko
2018-09-10 12:09:37 +02:00
parent 21dba52753
commit 2f42840faa
2 changed files with 16 additions and 16 deletions
+2 -2
View File
@@ -15,7 +15,7 @@ function convertToSymptoFormat(val) {
return sympto return sympto
} }
export const cervixShiftAndFhmOnSameDay = [ export const idealCycle = [
{ date: '2018-08-01', bleeding: 1, cervix: { opening: 1, firmness: 1 } }, { 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-02', bleeding: 2, cervix: { opening: 1, firmness: 1 } },
{ date: '2018-08-03', temperature: 36.6, bleeding: 2, cervix: { opening: 2, 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 } } { date: '2018-04-24', temperature: 36.75, cervix: { opening: 0, firmness: 0 } }
].map(convertToSymptoFormat) ].map(convertToSymptoFormat)
export const noOvulationDetected = [ export const noInfertilePhaseDetected = [
{ date: '2018-03-08', bleeding: 3 }, { date: '2018-03-08', bleeding: 3 },
{ date: '2018-03-09', bleeding: 3 }, { date: '2018-03-09', bleeding: 3 },
{ date: '2018-03-10', bleeding: 3 }, { date: '2018-03-10', bleeding: 3 },
+14 -14
View File
@@ -1,14 +1,14 @@
import chai from 'chai' import chai from 'chai'
import getSensiplanStatus from '../../lib/sympto' import getSensiplanStatus from '../../lib/sympto'
import { import {
cervixShiftAndFhmOnSameDay, idealCycle,
cycleWithFhmNoCervixShift, cycleWithFhmNoCervixShift,
cycleWithoutFhm, cycleWithoutFhm,
cycleWithoutAnyShifts, cycleWithoutAnyShifts,
tempAndCervixEvalEndOnSameDay, tempAndCervixEvalEndOnSameDay,
tempShift3DaysAfterCervixShift, tempShift3DaysAfterCervixShift,
cervixShift2DaysAfterTempShift, cervixShift2DaysAfterTempShift,
noOvulationDetected, noInfertilePhaseDetected,
fiveDayCycle fiveDayCycle
} from './cervix-temp-fixtures' } from './cervix-temp-fixtures'
@@ -51,7 +51,7 @@ describe('sympto', () => {
}) })
it('with temp and cervix shifts detects only peri- and post-ovulatory phases', () => { it('with temp and cervix shifts detects only peri- and post-ovulatory phases', () => {
const status = getSensiplanStatus({ const status = getSensiplanStatus({
cycle: cervixShiftAndFhmOnSameDay, cycle: idealCycle,
previousCycle: cycleWithoutFhm, previousCycle: cycleWithoutFhm,
secondarySymptom: 'cervix' secondarySymptom: 'cervix'
}) })
@@ -62,12 +62,12 @@ describe('sympto', () => {
expect(status.phases.periOvulatory).to.eql({ expect(status.phases.periOvulatory).to.eql({
start: { date: '2018-08-01' }, start: { date: '2018-08-01' },
end: { date: '2018-08-15', time: '18:00' }, end: { date: '2018-08-15', time: '18:00' },
cycleDays: cervixShiftAndFhmOnSameDay cycleDays: idealCycle
.filter(({date}) => date <= '2018-08-15') .filter(({date}) => date <= '2018-08-15')
}) })
expect(status.phases.postOvulatory).to.eql({ expect(status.phases.postOvulatory).to.eql({
start: { date: '2018-08-15', time: '18:00' }, start: { date: '2018-08-15', time: '18:00' },
cycleDays: cervixShiftAndFhmOnSameDay cycleDays: idealCycle
.filter(({date}) => date >= '2018-08-15') .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', () => { it('with no shifts detects only peri-ovulatory in 3-day long cycle according to 5-day rule', () => {
const status = getSensiplanStatus({ const status = getSensiplanStatus({
cycle: fiveDayCycle, cycle: fiveDayCycle,
previousCycle: cervixShiftAndFhmOnSameDay, previousCycle: idealCycle,
secondarySymptom: 'cervix' secondarySymptom: 'cervix'
}) })
expect(Object.keys(status.phases).length).to.eql(1) 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', () => { it('with no shifts detects pre- and peri-ovulatory phase according to 5-day-rule', () => {
const status = getSensiplanStatus({ const status = getSensiplanStatus({
cycle: cycleWithoutAnyShifts, cycle: cycleWithoutAnyShifts,
previousCycle: cervixShiftAndFhmOnSameDay, previousCycle: idealCycle,
secondarySymptom: 'cervix' secondarySymptom: 'cervix'
}) })
@@ -109,7 +109,7 @@ describe('sympto', () => {
it('with evaluation of temperature and cervix end on same day', () => { it('with evaluation of temperature and cervix end on same day', () => {
const status = getSensiplanStatus({ const status = getSensiplanStatus({
cycle: tempAndCervixEvalEndOnSameDay, cycle: tempAndCervixEvalEndOnSameDay,
previousCycle: cervixShiftAndFhmOnSameDay, previousCycle: idealCycle,
secondarySymptom: 'cervix' secondarySymptom: 'cervix'
}) })
expect(Object.keys(status.phases).length).to.eql(3) 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', () => { it('when temperature shift happens 3 days after cervix shift', () => {
const status = getSensiplanStatus({ const status = getSensiplanStatus({
cycle: tempShift3DaysAfterCervixShift, cycle: tempShift3DaysAfterCervixShift,
previousCycle: cervixShiftAndFhmOnSameDay, previousCycle: idealCycle,
secondarySymptom: 'cervix' secondarySymptom: 'cervix'
}) })
expect(Object.keys(status.phases).length).to.eql(3) 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', () => { it('when cervix shift happens 2 days after temperature shift', () => {
const status = getSensiplanStatus({ const status = getSensiplanStatus({
cycle: cervixShift2DaysAfterTempShift, cycle: cervixShift2DaysAfterTempShift,
previousCycle: cervixShiftAndFhmOnSameDay, previousCycle: idealCycle,
secondarySymptom: 'cervix' secondarySymptom: 'cervix'
}) })
expect(Object.keys(status.phases).length).to.eql(3) expect(Object.keys(status.phases).length).to.eql(3)
@@ -201,19 +201,19 @@ describe('sympto', () => {
}) })
it('when no infertile phase can be detected', () => { it('when no infertile phase can be detected', () => {
const status = getSensiplanStatus({ const status = getSensiplanStatus({
cycle: noOvulationDetected, cycle: noInfertilePhaseDetected,
previousCycle: cervixShiftAndFhmOnSameDay, previousCycle: idealCycle,
secondarySymptom: 'cervix' secondarySymptom: 'cervix'
}) })
expect(Object.keys(status.phases).length).to.eql(2) expect(Object.keys(status.phases).length).to.eql(2)
expect(status.phases.preOvulatory).to.eql({ expect(status.phases.preOvulatory).to.eql({
cycleDays: noOvulationDetected cycleDays: noInfertilePhaseDetected
.filter(({date}) => date <= '2018-03-12'), .filter(({date}) => date <= '2018-03-12'),
start: { date: '2018-03-08' }, start: { date: '2018-03-08' },
end: { date: '2018-03-12' } end: { date: '2018-03-12' }
}) })
expect(status.phases.periOvulatory).to.eql({ expect(status.phases.periOvulatory).to.eql({
cycleDays: noOvulationDetected cycleDays: noInfertilePhaseDetected
.filter(({date}) => date > '2018-03-12'), .filter(({date}) => date > '2018-03-12'),
start: { date: '2018-03-13' } start: { date: '2018-03-13' }
}) })