Add mock for getCycleDay
This commit is contained in:
@@ -9,6 +9,7 @@ import styles from './styles'
|
|||||||
import { saveBleeding } from './db'
|
import { saveBleeding } from './db'
|
||||||
import { formatDateForViewHeader } from './format'
|
import { formatDateForViewHeader } from './format'
|
||||||
import { bleeding as labels } from './labels'
|
import { bleeding as labels } from './labels'
|
||||||
|
import getCycleDay from './get-cycle-day'
|
||||||
|
|
||||||
export default class Bleeding extends Component {
|
export default class Bleeding extends Component {
|
||||||
constructor(props) {
|
constructor(props) {
|
||||||
@@ -27,6 +28,7 @@ export default class Bleeding extends Component {
|
|||||||
return (
|
return (
|
||||||
<View style={styles.container}>
|
<View style={styles.container}>
|
||||||
<Text style={styles.welcome}>{formatDateForViewHeader(day.date)}</Text>
|
<Text style={styles.welcome}>{formatDateForViewHeader(day.date)}</Text>
|
||||||
|
<Text>Cycle day {getCycleDay()}</Text>
|
||||||
<Text>Bleeding</Text>
|
<Text>Bleeding</Text>
|
||||||
<Picker
|
<Picker
|
||||||
selectedValue={this.state.currentValue}
|
selectedValue={this.state.currentValue}
|
||||||
|
|||||||
@@ -7,6 +7,7 @@ import {
|
|||||||
import styles from './styles'
|
import styles from './styles'
|
||||||
import { formatDateForViewHeader } from './format'
|
import { formatDateForViewHeader } from './format'
|
||||||
import { bleeding as labels} from './labels'
|
import { bleeding as labels} from './labels'
|
||||||
|
import getCycleDay from './get-cycle-day'
|
||||||
|
|
||||||
export default class DayView extends Component {
|
export default class DayView extends Component {
|
||||||
constructor(props) {
|
constructor(props) {
|
||||||
@@ -30,6 +31,7 @@ export default class DayView extends Component {
|
|||||||
return (
|
return (
|
||||||
<View style={styles.container}>
|
<View style={styles.container}>
|
||||||
<Text style={styles.welcome}>{formatDateForViewHeader(day.date)}</Text>
|
<Text style={styles.welcome}>{formatDateForViewHeader(day.date)}</Text>
|
||||||
|
<Text>Cycle day {getCycleDay()}</Text>
|
||||||
<Text style={styles.welcome}>{bleedingLabel}</Text>
|
<Text style={styles.welcome}>{bleedingLabel}</Text>
|
||||||
<Button
|
<Button
|
||||||
onPress={() => navigate('bleeding', { cycleDay: day })}
|
onPress={() => navigate('bleeding', { cycleDay: day })}
|
||||||
|
|||||||
@@ -0,0 +1 @@
|
|||||||
|
export default () => 6
|
||||||
@@ -5,6 +5,7 @@ import {
|
|||||||
Text
|
Text
|
||||||
} from 'react-native'
|
} from 'react-native'
|
||||||
import styles from './styles'
|
import styles from './styles'
|
||||||
|
import getCycleDay from './get-cycle-day'
|
||||||
|
|
||||||
export default class Home extends Component {
|
export default class Home extends Component {
|
||||||
constructor(props) {
|
constructor(props) {
|
||||||
@@ -15,7 +16,7 @@ export default class Home extends Component {
|
|||||||
const navigate = this.props.navigation.navigate
|
const navigate = this.props.navigation.navigate
|
||||||
return (
|
return (
|
||||||
<View style={styles.container}>
|
<View style={styles.container}>
|
||||||
<Text style={styles.welcome}>Welcome! Today is day 6 of your current cycle</Text>
|
<Text style={styles.welcome}>Welcome! Today is day {getCycleDay()} of your current cycle</Text>
|
||||||
<Button
|
<Button
|
||||||
onPress={() => navigate('temperatureList')}
|
onPress={() => navigate('temperatureList')}
|
||||||
title="Edit symptoms for today">
|
title="Edit symptoms for today">
|
||||||
|
|||||||
Reference in New Issue
Block a user