Add another test

This commit is contained in:
Julia Friesel
2018-07-13 09:09:12 +02:00
parent f4aca1f412
commit 125fd84d59
2 changed files with 58 additions and 1 deletions
+36 -1
View File
@@ -15,7 +15,8 @@ import {
mucusPeak5DaysAfterFhm,
mucusPeakTwoDaysBeforeFhm,
fhmOnDay12,
fhmOnDay15
fhmOnDay15,
mucusPeakSlightlyBeforeTempShift
} from './fixtures'
const expect = chai.expect
@@ -223,6 +224,40 @@ describe('sympto', () => {
})
})
it('another example for mucus peak before temp shift', () => {
const status = getSensiplanStatus({
cycle: mucusPeakSlightlyBeforeTempShift,
previousCycles: [cycleWithFhm]
})
expect(status.temperatureShift).to.be.an('object')
expect(status.mucusShift).to.be.an('object')
expect(status.assumeFertility).to.be.false()
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: mucusPeakSlightlyBeforeTempShift
.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: mucusPeakSlightlyBeforeTempShift
.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: mucusPeakSlightlyBeforeTempShift
.filter(({date}) => date >= '2018-06-17')
})
})
it('with another mucus peak 5 days after fHM ignores it', () => {
const status = getSensiplanStatus({
cycle: mucusPeak5DaysAfterFhm,