Changes cervix value to check for opening and firmness value
This commit is contained in:
@@ -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
|
||||
}
|
||||
|
||||
+5
-2
@@ -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")
|
||||
})
|
||||
})
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user