Adds test for mucus and temp tracking:
* late mucus shift and therefore no postovu phase
This commit is contained in:
@@ -191,6 +191,50 @@ export const mucusPeakOnLastDayOfTempEval = [
|
|||||||
{ date: '2018-06-26', temperature: 36.8, mucus: 1 },
|
{ date: '2018-06-26', temperature: 36.8, mucus: 1 },
|
||||||
].map(convertToSymptoFormat)
|
].map(convertToSymptoFormat)
|
||||||
|
|
||||||
|
export const mucusPeakAfterLastDayOfTempEval = [
|
||||||
|
{ 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-05', temperature: 36.55 },
|
||||||
|
{ date: '2018-06-06', temperature: 36.7, mucus: 0 },
|
||||||
|
{ date: '2018-06-09', temperature: 36.5, mucus: 1 },
|
||||||
|
{ date: '2018-06-10', temperature: 36.4, mucus: 2 },
|
||||||
|
{ date: '2018-06-13', temperature: 36.45, mucus: 2 },
|
||||||
|
{ date: '2018-06-14', temperature: 36.5, mucus: 2 },
|
||||||
|
{ date: '2018-06-15', temperature: 36.55, mucus: 1 },
|
||||||
|
{ date: '2018-06-16', temperature: 36.7, mucus: 2 },
|
||||||
|
{ date: '2018-06-17', temperature: 36.65, mucus: 2 },
|
||||||
|
{ date: '2018-06-18', temperature: 36.75, mucus: 2 },
|
||||||
|
{ date: '2018-06-19', temperature: 36.8, mucus: 2 },
|
||||||
|
{ date: '2018-06-20', temperature: 36.9, mucus: 2 },
|
||||||
|
{ date: '2018-06-21', temperature: 36.8, mucus: 3 },
|
||||||
|
{ date: '2018-06-22', temperature: 36.9, mucus: 2 },
|
||||||
|
{ date: '2018-06-25', temperature: 36.9, mucus: 1 },
|
||||||
|
{ date: '2018-06-26', temperature: 36.8, mucus: 1 },
|
||||||
|
].map(convertToSymptoFormat)
|
||||||
|
|
||||||
|
export const mucusPeakOnAndAfterLastDayOfTempEval = [
|
||||||
|
{ 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-05', temperature: 36.55 },
|
||||||
|
{ date: '2018-06-06', temperature: 36.7, mucus: 0 },
|
||||||
|
{ date: '2018-06-09', temperature: 36.5, mucus: 1 },
|
||||||
|
{ date: '2018-06-10', temperature: 36.4, mucus: 2 },
|
||||||
|
{ date: '2018-06-13', temperature: 36.45, mucus: 2 },
|
||||||
|
{ date: '2018-06-14', temperature: 36.5, mucus: 2 },
|
||||||
|
{ date: '2018-06-15', temperature: 36.55, mucus: 1 },
|
||||||
|
{ date: '2018-06-16', temperature: 36.7, mucus: 2 },
|
||||||
|
{ date: '2018-06-17', temperature: 36.65, mucus: 2 },
|
||||||
|
{ date: '2018-06-18', temperature: 36.75, mucus: 2 },
|
||||||
|
{ date: '2018-06-19', temperature: 36.8, mucus: 2 },
|
||||||
|
{ date: '2018-06-20', temperature: 36.9, mucus: 3 },
|
||||||
|
{ date: '2018-06-21', temperature: 36.8, mucus: 3 },
|
||||||
|
{ date: '2018-06-22', temperature: 36.9, mucus: 2 },
|
||||||
|
{ date: '2018-06-25', temperature: 36.9, mucus: 1 },
|
||||||
|
{ date: '2018-06-26', temperature: 36.8, mucus: 1 },
|
||||||
|
].map(convertToSymptoFormat)
|
||||||
|
|
||||||
export const mucusPeakTwoDaysBeforeFhm = [
|
export const mucusPeakTwoDaysBeforeFhm = [
|
||||||
{ date: '2018-06-01', temperature: 36.6, bleeding: 2 },
|
{ date: '2018-06-01', temperature: 36.6, bleeding: 2 },
|
||||||
{ date: '2018-06-02', temperature: 36.65 },
|
{ date: '2018-06-02', temperature: 36.65 },
|
||||||
|
|||||||
@@ -12,6 +12,8 @@ import {
|
|||||||
cycleWithMucusOnFirstDay,
|
cycleWithMucusOnFirstDay,
|
||||||
mucusPeakAndFhmOnSameDay,
|
mucusPeakAndFhmOnSameDay,
|
||||||
mucusPeakOnLastDayOfTempEval,
|
mucusPeakOnLastDayOfTempEval,
|
||||||
|
mucusPeakAfterLastDayOfTempEval,
|
||||||
|
mucusPeakOnAndAfterLastDayOfTempEval,
|
||||||
fhm5DaysAfterMucusPeak,
|
fhm5DaysAfterMucusPeak,
|
||||||
mucusPeak5DaysAfterFhm,
|
mucusPeak5DaysAfterFhm,
|
||||||
mucusPeakTwoDaysBeforeFhm,
|
mucusPeakTwoDaysBeforeFhm,
|
||||||
@@ -174,7 +176,7 @@ describe('sympto', () => {
|
|||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
it('with fhM 2 days before mucus peak waits for end of mucus eval', () => {
|
it('with mucus peak 3 days after fhM waits for end of mucus eval', () => {
|
||||||
const status = getSensiplanStatus({
|
const status = getSensiplanStatus({
|
||||||
cycle: mucusPeakOnLastDayOfTempEval,
|
cycle: mucusPeakOnLastDayOfTempEval,
|
||||||
previousCycle: cycleWithFhm
|
previousCycle: cycleWithFhm
|
||||||
@@ -207,6 +209,44 @@ describe('sympto', () => {
|
|||||||
.filter(({date}) => date >= '2018-06-25')
|
.filter(({date}) => date >= '2018-06-25')
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
it('with mucus peak 4 days after fhM detects no postovu phase', () => {
|
||||||
|
const status = getSensiplanStatus({
|
||||||
|
cycle: mucusPeakAfterLastDayOfTempEval,
|
||||||
|
previousCycle: cycleWithFhm
|
||||||
|
})
|
||||||
|
|
||||||
|
expect(Object.keys(status.phases).length).to.eql(2)
|
||||||
|
expect(status.phases.preOvulatory).to.eql({
|
||||||
|
start: { date: '2018-06-01' },
|
||||||
|
end: { date: '2018-06-05' },
|
||||||
|
cycleDays: mucusPeakAfterLastDayOfTempEval
|
||||||
|
.filter(({date}) => date <= '2018-06-05')
|
||||||
|
})
|
||||||
|
expect(status.phases.periOvulatory).to.eql({
|
||||||
|
start: { date: '2018-06-06' },
|
||||||
|
cycleDays: mucusPeakAfterLastDayOfTempEval
|
||||||
|
.filter(({date}) => date > '2018-06-05')
|
||||||
|
})
|
||||||
|
})
|
||||||
|
it('with mucus peak 3 and 4 days after fhM detects no postovu phase', () => {
|
||||||
|
const status = getSensiplanStatus({
|
||||||
|
cycle: mucusPeakOnAndAfterLastDayOfTempEval,
|
||||||
|
previousCycle: cycleWithFhm
|
||||||
|
})
|
||||||
|
|
||||||
|
expect(Object.keys(status.phases).length).to.eql(2)
|
||||||
|
expect(status.phases.preOvulatory).to.eql({
|
||||||
|
start: { date: '2018-06-01' },
|
||||||
|
end: { date: '2018-06-05' },
|
||||||
|
cycleDays: mucusPeakOnAndAfterLastDayOfTempEval
|
||||||
|
.filter(({date}) => date <= '2018-06-05')
|
||||||
|
})
|
||||||
|
expect(status.phases.periOvulatory).to.eql({
|
||||||
|
start: { date: '2018-06-06' },
|
||||||
|
cycleDays: mucusPeakOnAndAfterLastDayOfTempEval
|
||||||
|
.filter(({date}) => date > '2018-06-05')
|
||||||
|
})
|
||||||
|
})
|
||||||
it('another example for mucus peak before temp shift', () => {
|
it('another example for mucus peak before temp shift', () => {
|
||||||
const status = getSensiplanStatus({
|
const status = getSensiplanStatus({
|
||||||
cycle: mucusPeakSlightlyBeforeTempShift,
|
cycle: mucusPeakSlightlyBeforeTempShift,
|
||||||
|
|||||||
Reference in New Issue
Block a user