Update fixtures for test dummy data in app
This commit is contained in:
+14
-4
@@ -1,16 +1,26 @@
|
|||||||
function convertToSymptoFormat(val) {
|
function convertToSymptoFormat(val) {
|
||||||
const sympto = { date: val.date }
|
const sympto = { date: val.date }
|
||||||
|
if (val.bleeding) sympto.bleeding = {
|
||||||
|
value: val.bleeding,
|
||||||
|
exclude: false
|
||||||
|
}
|
||||||
if (val.temperature) sympto.temperature = {
|
if (val.temperature) sympto.temperature = {
|
||||||
value: val.temperature,
|
value: val.temperature,
|
||||||
|
time: '08:00',
|
||||||
exclude: false
|
exclude: false
|
||||||
}
|
}
|
||||||
if (val.mucus) sympto.mucus = {
|
if (val.mucus) sympto.mucus = {
|
||||||
value: val.mucus,
|
value: val.mucus,
|
||||||
exclude: false,
|
|
||||||
feeling: val.mucus,
|
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
|
return sympto
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -75,7 +85,7 @@ export const cycleWithTempAndNoMucusShift = [
|
|||||||
{ date: '2018-05-27', temperature: 36.9, mucus: 4 }
|
{ date: '2018-05-27', temperature: 36.9, mucus: 4 }
|
||||||
].map(convertToSymptoFormat).reverse()
|
].map(convertToSymptoFormat).reverse()
|
||||||
|
|
||||||
export const cycleWithFhmCervix = [
|
export const cervixShiftAndFhmOnSameDay = [
|
||||||
{ date: '2018-08-01', bleeding: 2 },
|
{ date: '2018-08-01', bleeding: 2 },
|
||||||
{ date: '2018-08-02', bleeding: 1 },
|
{ date: '2018-08-02', bleeding: 1 },
|
||||||
{ date: '2018-08-03', bleeding: 0 },
|
{ date: '2018-08-03', bleeding: 0 },
|
||||||
|
|||||||
+2
-2
@@ -7,7 +7,7 @@ import {
|
|||||||
cycleWithFhmMucus,
|
cycleWithFhmMucus,
|
||||||
longAndComplicatedCycleWithMucus,
|
longAndComplicatedCycleWithMucus,
|
||||||
cycleWithTempAndNoMucusShift,
|
cycleWithTempAndNoMucusShift,
|
||||||
cycleWithFhmCervix,
|
cervixShiftAndFhmOnSameDay,
|
||||||
longAndComplicatedCycleWithCervix,
|
longAndComplicatedCycleWithCervix,
|
||||||
cycleWithTempAndNoCervixShift
|
cycleWithTempAndNoCervixShift
|
||||||
} from './fixtures'
|
} from './fixtures'
|
||||||
@@ -77,7 +77,7 @@ export function fillWithMucusDummyData() {
|
|||||||
|
|
||||||
export function fillWithCervixDummyData() {
|
export function fillWithCervixDummyData() {
|
||||||
const dummyCycles = [
|
const dummyCycles = [
|
||||||
cycleWithFhmCervix,
|
cervixShiftAndFhmOnSameDay,
|
||||||
longAndComplicatedCycleWithCervix,
|
longAndComplicatedCycleWithCervix,
|
||||||
cycleWithTempAndNoCervixShift
|
cycleWithTempAndNoCervixShift
|
||||||
]
|
]
|
||||||
|
|||||||
Reference in New Issue
Block a user