Skip to content
Snippets Groups Projects
Commit 1c2c45f8 authored by emelko's avatar emelko
Browse files

Changes cervix value to check for opening and firmness value

parent 21d6e24f
No related branches found
No related tags found
No related merge requests found
......@@ -36,6 +36,6 @@ export default function (cycleDays, tempEvalEndIndex) {
return { detected: false }
}
function isClosedAndHard (cervixValue) {
return cervixValue.isClosed && cervixValue.isHard
function isClosedAndHard (cervix) {
return cervix.value.opening === 0 && cervix.value.firmness === 0
}
......@@ -112,8 +112,11 @@ function throwIfArgsAreNotInRequiredFormat(cycles) {
if (day.mucus) assert.equal(typeof day.mucus.value, 'number')
if (day.mucus) assert.ok(day.mucus.value >= 0)
if (day.mucus) assert.ok(day.mucus.value < 5)
if (day.cervix) assert.equal(typeof day.cervix.isClosed, 'boolean')
if (day.cervix) assert.equal(typeof day.cervix.isHard, 'boolean')
if (day.cervix) assert.equal(typeof day.cervix.value, 'object')
if (day.cervix) assert.ok(day.cervix.value.opening >= 0, "cervix opening value must be 0 or bigger")
if (day.cervix) assert.ok(day.cervix.value.opening <= 2, "cervix opening value must be 2 or smaller")
if (day.cervix) assert.ok(day.cervix.value.firmness >= 0, "cervix firmness value must be 0 or bigger")
if (day.cervix) assert.ok(day.cervix.value.firmness <= 1, "cervix firmness value must be 1 or smaller")
})
})
}
This diff is collapsed.
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment