diff --git a/db/fixtures.js b/db/fixtures.js index fd4a949..56ce08a 100644 --- a/db/fixtures.js +++ b/db/fixtures.js @@ -1,16 +1,26 @@ function convertToSymptoFormat(val) { const sympto = { date: val.date } + if (val.bleeding) sympto.bleeding = { + value: val.bleeding, + exclude: false + } if (val.temperature) sympto.temperature = { value: val.temperature, + time: '08:00', exclude: false } if (val.mucus) sympto.mucus = { value: val.mucus, - exclude: false, feeling: val.mucus, - texture: val.mucus + texture: val.mucus, + exclude: false + } + if (val.cervix && typeof val.cervix.opening === 'number' && typeof val.cervix.firmness === 'number') sympto.cervix = { + opening: val.cervix.opening, + firmness: val.cervix.firmness, + position: -1, + exclude: false } - if (val.bleeding) sympto.bleeding = { value: val.bleeding, exclude: false } return sympto } @@ -75,7 +85,7 @@ export const cycleWithTempAndNoMucusShift = [ { date: '2018-05-27', temperature: 36.9, mucus: 4 } ].map(convertToSymptoFormat).reverse() -export const cycleWithFhmCervix = [ +export const cervixShiftAndFhmOnSameDay = [ { date: '2018-08-01', bleeding: 2 }, { date: '2018-08-02', bleeding: 1 }, { date: '2018-08-03', bleeding: 0 }, diff --git a/db/index.js b/db/index.js index 6dc4feb..0b0c15d 100644 --- a/db/index.js +++ b/db/index.js @@ -7,7 +7,7 @@ import { cycleWithFhmMucus, longAndComplicatedCycleWithMucus, cycleWithTempAndNoMucusShift, - cycleWithFhmCervix, + cervixShiftAndFhmOnSameDay, longAndComplicatedCycleWithCervix, cycleWithTempAndNoCervixShift } from './fixtures' @@ -77,7 +77,7 @@ export function fillWithMucusDummyData() { export function fillWithCervixDummyData() { const dummyCycles = [ - cycleWithFhmCervix, + cervixShiftAndFhmOnSameDay, longAndComplicatedCycleWithCervix, cycleWithTempAndNoCervixShift ]