Update fixtures for test dummy data in app

This commit is contained in:
emelko
2018-09-18 11:24:48 +02:00
parent 024b553ee6
commit ef51dab423
2 changed files with 16 additions and 6 deletions
+14 -4
View File
@@ -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 },
+2 -2
View File
@@ -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
]