Ignore highest quality after end of eval
This commit is contained in:
@@ -5,7 +5,7 @@ import periodInfo from '../lib/period-length'
|
||||
|
||||
const expect = chai.expect
|
||||
|
||||
describe.only('getPeriodLengthStats', () => {
|
||||
describe('getPeriodLengthStats', () => {
|
||||
it('works for a simple odd-numbered array', () => {
|
||||
const periodLengths = [99, 5, 1, 2, 100]
|
||||
const result = periodInfo(periodLengths)
|
||||
|
||||
@@ -298,4 +298,27 @@ export const mucusPeakSlightlyBeforeTempShift = [
|
||||
{ date: '2018-06-20', temperature: 36.75, mucus: 1},
|
||||
{ date: '2018-06-21', temperature: 36.8, mucus: 1},
|
||||
{ date: '2018-06-22', temperature: 36.8, mucus: 1}
|
||||
].map(convertToSymptoFormat)
|
||||
|
||||
|
||||
export const highestMucusQualityAfterEndOfEval = [
|
||||
{ date: '2018-06-01', temperature: 36.6, bleeding: 2 },
|
||||
{ date: '2018-06-02', temperature: 36.65 },
|
||||
{ date: '2018-06-04', temperature: 36.6 },
|
||||
{ date: '2018-06-07', temperature: 36.4, mucus: 1 },
|
||||
{ date: '2018-06-08', temperature: 36.35, mucus: 2},
|
||||
{ date: '2018-06-09', temperature: 36.4, mucus: 2},
|
||||
{ date: '2018-06-10', temperature: 36.45, mucus: 2},
|
||||
{ date: '2018-06-11', temperature: 36.4, mucus: 2},
|
||||
{ date: '2018-06-12', temperature: 36.45, mucus: 2},
|
||||
{ date: '2018-06-13', temperature: 36.45, mucus: 3},
|
||||
{ date: '2018-06-14', temperature: 36.55, mucus: 2},
|
||||
{ date: '2018-06-15', temperature: 36.6, mucus: 2},
|
||||
{ date: '2018-06-16', temperature: 36.6, mucus: 2},
|
||||
{ date: '2018-06-17', temperature: 36.55, mucus: 2},
|
||||
{ date: '2018-06-18', temperature: 36.6, mucus: 1},
|
||||
{ date: '2018-06-19', temperature: 36.7, mucus: 4},
|
||||
{ date: '2018-06-20', temperature: 36.75, mucus: 1},
|
||||
{ date: '2018-06-21', temperature: 36.8, mucus: 1},
|
||||
{ date: '2018-06-22', temperature: 36.8, mucus: 1}
|
||||
].map(convertToSymptoFormat)
|
||||
@@ -17,7 +17,8 @@ import {
|
||||
mucusPeakTwoDaysBeforeFhm,
|
||||
fhmOnDay12,
|
||||
fhmOnDay15,
|
||||
mucusPeakSlightlyBeforeTempShift
|
||||
mucusPeakSlightlyBeforeTempShift,
|
||||
highestMucusQualityAfterEndOfEval
|
||||
} from './fixtures'
|
||||
|
||||
const expect = chai.expect
|
||||
@@ -360,6 +361,40 @@ describe('sympto', () => {
|
||||
.filter(({date}) => date >= '2018-06-21')
|
||||
})
|
||||
})
|
||||
|
||||
it('with highest quality after end of eval', () => {
|
||||
const status = getSensiplanStatus({
|
||||
cycle: highestMucusQualityAfterEndOfEval,
|
||||
previousCycle: cycleWithFhm
|
||||
})
|
||||
|
||||
expect(status.temperatureShift).to.be.an('object')
|
||||
expect(status.mucusShift).to.be.an('object')
|
||||
|
||||
expect(Object.keys(status.phases).length).to.eql(3)
|
||||
expect(status.phases.preOvulatory).to.eql({
|
||||
start: { date: '2018-06-01' },
|
||||
end: { date: '2018-06-05' },
|
||||
cycleDays: highestMucusQualityAfterEndOfEval
|
||||
.filter(({date}) => date <= '2018-06-05')
|
||||
})
|
||||
expect(status.phases.periOvulatory).to.eql({
|
||||
start: { date: '2018-06-06' },
|
||||
end: { date: '2018-06-17', time: '18:00' },
|
||||
cycleDays: highestMucusQualityAfterEndOfEval
|
||||
.filter(({date}) => {
|
||||
return date > '2018-06-05' && date <= '2018-06-17'
|
||||
})
|
||||
})
|
||||
expect(status.phases.postOvulatory).to.eql({
|
||||
start: {
|
||||
date: '2018-06-17',
|
||||
time: '18:00'
|
||||
},
|
||||
cycleDays: highestMucusQualityAfterEndOfEval
|
||||
.filter(({date}) => date >= '2018-06-17')
|
||||
})
|
||||
})
|
||||
})
|
||||
|
||||
describe('applying the minus-8 rule', () => {
|
||||
|
||||
Reference in New Issue
Block a user