Change sympto module structure
This commit is contained in:
@@ -4,7 +4,7 @@ import {
|
|||||||
Text
|
Text
|
||||||
} from 'react-native'
|
} from 'react-native'
|
||||||
import cycleModule from '../lib/cycle'
|
import cycleModule from '../lib/cycle'
|
||||||
import { getTemperatureFertilityStatus } from '../lib/sensiplan-adapter'
|
import { getTemperatureFertilityStatus } from '../lib/sympto-adapter'
|
||||||
import DayView from './cycle-day-overview'
|
import DayView from './cycle-day-overview'
|
||||||
import BleedingEditView from './bleeding'
|
import BleedingEditView from './bleeding'
|
||||||
import TemperatureEditView from './temperature'
|
import TemperatureEditView from './temperature'
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import { detectTemperatureShift } from './sensiplan'
|
import { detectTemperatureShift } from './sympto/temperature'
|
||||||
import cycleModule from './cycle'
|
import cycleModule from './cycle'
|
||||||
|
|
||||||
const getLastMensesStart = cycleModule().getLastMensesStart
|
const getLastMensesStart = cycleModule().getLastMensesStart
|
||||||
@@ -8,7 +8,7 @@ function getTemperatureFertilityStatus(targetDateString) {
|
|||||||
const lastMensesStart = getLastMensesStart(targetDateString)
|
const lastMensesStart = getLastMensesStart(targetDateString)
|
||||||
if (!lastMensesStart) return formatStatusForApp({ detected: false })
|
if (!lastMensesStart) return formatStatusForApp({ detected: false })
|
||||||
const previousTemperaturesInCycle = getPreviousTemperaturesInCycle(targetDateString, lastMensesStart)
|
const previousTemperaturesInCycle = getPreviousTemperaturesInCycle(targetDateString, lastMensesStart)
|
||||||
// we get temps with latest first, but sensiplan module expects latest last
|
// we get temps with latest first, but sympto module expects latest last
|
||||||
previousTemperaturesInCycle.reverse()
|
previousTemperaturesInCycle.reverse()
|
||||||
const status = detectTemperatureShift(previousTemperaturesInCycle)
|
const status = detectTemperatureShift(previousTemperaturesInCycle)
|
||||||
return formatStatusForApp(status)
|
return formatStatusForApp(status)
|
||||||
@@ -1,9 +1,9 @@
|
|||||||
import chai from 'chai'
|
import chai from 'chai'
|
||||||
import { detectTemperatureShift } from '../lib/sensiplan'
|
import { detectTemperatureShift } from '../../lib/sympto/temperature'
|
||||||
|
|
||||||
const expect = chai.expect
|
const expect = chai.expect
|
||||||
|
|
||||||
describe.only('sensiplan', () => {
|
describe.only('sympto', () => {
|
||||||
describe('detect temperature shift', () => {
|
describe('detect temperature shift', () => {
|
||||||
describe('regular rule', () => {
|
describe('regular rule', () => {
|
||||||
it('reports lower temperature status before shift', function () {
|
it('reports lower temperature status before shift', function () {
|
||||||
Reference in New Issue
Block a user