Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
Drip
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Issue analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
backup
Drip
Commits
93ff7a0f
Commit
93ff7a0f
authored
6 years ago
by
Julia Friesel
Browse files
Options
Downloads
Patches
Plain Diff
Set up failing test for minus 8 rule
parent
19e88018
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
lib/sympto/pre-ovulatory.js
+1
-1
1 addition, 1 deletion
lib/sympto/pre-ovulatory.js
test/sympto/fixtures.js
+24
-26
24 additions, 26 deletions
test/sympto/fixtures.js
test/sympto/index.spec.js
+32
-2
32 additions, 2 deletions
test/sympto/index.spec.js
with
57 additions
and
29 deletions
lib/sympto/pre-ovulatory.js
+
1
−
1
View file @
93ff7a0f
...
...
@@ -38,4 +38,4 @@ function getDaysUntilFertileMucus(days) {
return
days
}
function
apply8DayRule
()
{}
\ No newline at end of file
function
apply8DayRule
(
previousCycles
)
{}
\ No newline at end of file
This diff is collapsed.
Click to expand it.
test/sympto/fixtures.js
+
24
−
26
View file @
93ff7a0f
...
...
@@ -7,17 +7,17 @@ function convertToSymptoFormat(val) {
return
sympto
}
const
cycleWithTempShift
=
[
36.6
,
36.6
,
36.6
,
36.6
,
36.6
,
36.6
,
36.8
,
36.8
,
36.8
]
export
const
cycleWithTempShift
=
[
36.6
,
36.6
,
36.6
,
36.6
,
36.6
,
36.6
,
36.8
,
36.8
,
36.8
]
.
map
(
num
=>
({
date
:
'
2018-06-01
'
,
temperature
:
num
}))
.
map
(
convertToSymptoFormat
)
cycleWithTempShift
.
unshift
({
date
:
'
2018-05-30
'
,
bleeding
:
{
value
:
2
}})
const
cycleWithoutTempShift
=
[
36.6
,
36.6
,
36.6
,
36.6
,
36.6
,
36.6
,
36.8
,
36.8
]
export
const
cycleWithoutTempShift
=
[
36.6
,
36.6
,
36.6
,
36.6
,
36.6
,
36.6
,
36.8
,
36.8
]
.
map
(
num
=>
({
date
:
'
2018-06-01
'
,
temperature
:
num
}))
.
map
(
convertToSymptoFormat
)
cycleWithoutTempShift
.
unshift
({
date
:
'
2018-05-30
'
,
bleeding
:
{
value
:
2
}})
const
cycleWithTempAndMucusShift
=
[
export
const
cycleWithTempAndMucusShift
=
[
{
date
:
'
2018-06-01
'
,
temperature
:
36.6
,
bleeding
:
2
},
{
date
:
'
2018-06-02
'
,
temperature
:
36.65
},
{
date
:
'
2018-06-04
'
,
temperature
:
36.6
},
...
...
@@ -40,7 +40,7 @@ const cycleWithTempAndMucusShift = [
{
date
:
'
2018-06-27
'
,
temperature
:
36.9
,
mucus
:
1
}
].
map
(
convertToSymptoFormat
)
const
cycleWithTempAndNoMucusShift
=
[
export
const
cycleWithTempAndNoMucusShift
=
[
{
date
:
'
2018-06-01
'
,
temperature
:
36.6
,
bleeding
:
2
},
{
date
:
'
2018-06-02
'
,
temperature
:
36.65
},
{
date
:
'
2018-06-05
'
,
temperature
:
36.55
},
...
...
@@ -63,7 +63,7 @@ const cycleWithTempAndNoMucusShift = [
{
date
:
'
2018-06-27
'
,
temperature
:
36.9
,
mucus
:
4
}
].
map
(
convertToSymptoFormat
)
const
cycleWithEarlyMucus
=
[
export
const
cycleWithEarlyMucus
=
[
{
date
:
'
2018-06-01
'
,
temperature
:
36.6
,
bleeding
:
2
},
{
date
:
'
2018-06-02
'
,
temperature
:
36.65
,
mucus
:
3
},
{
date
:
'
2018-06-05
'
,
temperature
:
36.55
},
...
...
@@ -86,7 +86,7 @@ const cycleWithEarlyMucus = [
{
date
:
'
2018-06-27
'
,
temperature
:
36.9
,
mucus
:
4
}
].
map
(
convertToSymptoFormat
)
const
cycleWithoutAnyShifts
=
[
export
const
cycleWithoutAnyShifts
=
[
{
date
:
'
2018-06-01
'
,
temperature
:
36.6
,
bleeding
:
2
},
{
date
:
'
2018-06-02
'
,
temperature
:
36.65
},
{
date
:
'
2018-06-04
'
,
temperature
:
36.6
},
...
...
@@ -96,12 +96,12 @@ const cycleWithoutAnyShifts = [
{
date
:
'
2018-06-08
'
,
temperature
:
36.45
,
mucus
:
1
}
].
map
(
convertToSymptoFormat
)
const
fiveDayCycle
=
[
export
const
fiveDayCycle
=
[
{
date
:
'
2018-06-01
'
,
bleeding
:
2
},
{
date
:
'
2018-06-03
'
,
bleeding
:
3
},
].
map
(
convertToSymptoFormat
)
const
mucusPeakAndFhmOnSameDay
=
[
export
const
mucusPeakAndFhmOnSameDay
=
[
{
date
:
'
2018-06-01
'
,
temperature
:
36.6
,
bleeding
:
2
},
{
date
:
'
2018-06-02
'
,
temperature
:
36.65
},
{
date
:
'
2018-06-04
'
,
temperature
:
36.6
},
...
...
@@ -124,7 +124,7 @@ const mucusPeakAndFhmOnSameDay = [
{
date
:
'
2018-06-27
'
,
temperature
:
36.9
,
mucus
:
1
}
].
map
(
convertToSymptoFormat
)
const
fhmTwoDaysBeforeMucusPeak
=
[
export
const
fhmTwoDaysBeforeMucusPeak
=
[
{
date
:
'
2018-06-01
'
,
temperature
:
36.6
,
bleeding
:
2
},
{
date
:
'
2018-06-02
'
,
temperature
:
36.65
},
{
date
:
'
2018-06-04
'
,
temperature
:
36.6
},
...
...
@@ -146,7 +146,7 @@ const fhmTwoDaysBeforeMucusPeak = [
{
date
:
'
2018-06-26
'
,
temperature
:
36.8
,
mucus
:
1
},
].
map
(
convertToSymptoFormat
)
const
mucusPeakTwoDaysBeforeFhm
=
[
export
const
mucusPeakTwoDaysBeforeFhm
=
[
{
date
:
'
2018-06-01
'
,
temperature
:
36.6
,
bleeding
:
2
},
{
date
:
'
2018-06-02
'
,
temperature
:
36.65
},
{
date
:
'
2018-06-04
'
,
temperature
:
36.6
},
...
...
@@ -165,7 +165,7 @@ const mucusPeakTwoDaysBeforeFhm = [
{
date
:
'
2018-07-04
'
,
temperature
:
36.8
,
mucus
:
2
},
].
map
(
convertToSymptoFormat
)
const
mucusPeak5DaysAfterFhm
=
[
export
const
mucusPeak5DaysAfterFhm
=
[
{
date
:
'
2018-06-01
'
,
temperature
:
36.6
,
bleeding
:
2
},
{
date
:
'
2018-06-02
'
,
temperature
:
36.65
,
mucus
:
2
},
{
date
:
'
2018-06-04
'
,
temperature
:
36.6
},
...
...
@@ -190,7 +190,7 @@ const mucusPeak5DaysAfterFhm = [
{
date
:
'
2018-07-02
'
,
temperature
:
36.9
,
mucus
:
1
}
].
map
(
convertToSymptoFormat
)
const
fhm5DaysAfterMucusPeak
=
[
export
const
fhm5DaysAfterMucusPeak
=
[
{
date
:
'
2018-06-01
'
,
temperature
:
36.6
,
bleeding
:
2
},
{
date
:
'
2018-06-02
'
,
temperature
:
36.65
},
{
date
:
'
2018-06-04
'
,
temperature
:
36.6
},
...
...
@@ -213,17 +213,15 @@ const fhm5DaysAfterMucusPeak = [
{
date
:
'
2018-06-27
'
,
temperature
:
36.9
,
mucus
:
1
}
].
map
(
convertToSymptoFormat
)
export
{
cycleWithoutTempShift
,
cycleWithTempAndMucusShift
,
cycleWithTempAndNoMucusShift
,
cycleWithTempShift
,
cycleWithoutAnyShifts
,
fiveDayCycle
,
cycleWithEarlyMucus
,
fhm5DaysAfterMucusPeak
,
fhmTwoDaysBeforeMucusPeak
,
mucusPeak5DaysAfterFhm
,
mucusPeakAndFhmOnSameDay
,
mucusPeakTwoDaysBeforeFhm
}
\ No newline at end of file
export
const
fhmOnDay12
=
[
{
date
:
'
2018-06-01
'
,
temperature
:
36.6
,
bleeding
:
2
},
{
date
:
'
2018-06-02
'
,
temperature
:
36.65
},
{
date
:
'
2018-06-04
'
,
temperature
:
36.6
},
{
date
:
'
2018-06-05
'
,
temperature
:
36.55
},
{
date
:
'
2018-06-06
'
,
temperature
:
36.7
,
mucus
:
0
},
{
date
:
'
2018-06-09
'
,
temperature
:
36.5
,
mucus
:
2
},
{
date
:
'
2018-06-10
'
,
temperature
:
36.4
,
mucus
:
3
},
{
date
:
'
2018-06-12
'
,
temperature
:
36.8
,
mucus
:
3
},
{
date
:
'
2018-06-14
'
,
temperature
:
36.9
,
mucus
:
2
},
{
date
:
'
2018-06-17
'
,
temperature
:
36.9
,
mucus
:
2
},
].
map
(
convertToSymptoFormat
)
This diff is collapsed.
Click to expand it.
test/sympto/index.spec.js
+
32
−
2
View file @
93ff7a0f
...
...
@@ -13,7 +13,8 @@ import {
fhmTwoDaysBeforeMucusPeak
,
fhm5DaysAfterMucusPeak
,
mucusPeak5DaysAfterFhm
,
mucusPeakTwoDaysBeforeFhm
mucusPeakTwoDaysBeforeFhm
,
fhmOnDay12
}
from
'
./fixtures
'
const
expect
=
chai
.
expect
...
...
@@ -303,7 +304,36 @@ describe('sympto', () => {
})
describe
(
'
applying the minus-8 rule
'
,
()
=>
{
it
(
'
shortens the pre-ovu phase if there is a previous <13 fhm
'
)
it
(
'
shortens the pre-ovu phase if there is a previous <13 fhm
'
,
()
=>
{
const
status
=
getSensiplanStatus
({
cycle
:
cycleWithTempAndMucusShift
,
previousCycles
:
[
fhmOnDay12
,
cycleWithTempShift
]
})
expect
(
status
.
temperatureShift
).
to
.
be
.
an
(
'
object
'
)
expect
(
status
.
mucusShift
).
to
.
be
.
an
(
'
object
'
)
expect
(
status
.
assumeFertility
).
to
.
be
.
false
()
expect
(
Object
.
keys
(
status
.
phases
).
length
).
to
.
eql
(
3
)
expect
(
status
.
phases
.
preOvulatory
).
to
.
eql
({
start
:
{
date
:
'
2018-06-01
'
},
end
:
{
date
:
'
2018-06-04
'
},
cycleDays
:
fhm5DaysAfterMucusPeak
.
filter
(({
date
})
=>
date
<=
'
2018-06-04
'
)
})
expect
(
status
.
phases
.
periOvulatory
).
to
.
eql
({
start
:
{
date
:
'
2018-06-05
'
},
end
:
{
date
:
'
2018-06-17
'
,
time
:
'
18:00
'
},
cycleDays
:
fhm5DaysAfterMucusPeak
.
filter
(({
date
})
=>
{
return
date
>
'
2018-06-04
'
&&
date
<=
'
2018-06-17
'
})
})
expect
(
status
.
phases
.
postOvulatory
).
to
.
eql
({
start
:
{
date
:
'
2018-06-17
'
,
time
:
'
18:00
'
},
cycleDays
:
fhm5DaysAfterMucusPeak
.
filter
(({
date
})
=>
date
>=
'
2018-06-17
'
)
})
})
it
(
'
shortens the pre-ovu phase if there is a previous <13 fhm with less than 12 cycles
'
)
it
(
'
shortens the pre-ovu phase if mucus occurs
'
)
it
(
'
lengthens the pre-ovu phase if >= 12 cycles
'
)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment