Change function signature and remove fixtures
This commit is contained in:
+11
-11
@@ -1,10 +1,5 @@
|
||||
import chai from 'chai'
|
||||
import { getTemperatureStatus } from '../lib/sensiplan'
|
||||
import tempShift from './fixtures/regular-rule-shift.json'
|
||||
import noTempShift from './fixtures/regular-rule-no-shift.json'
|
||||
import lowerTempDays from './fixtures/lower-temps.json'
|
||||
import firstException from './fixtures/first-exception-rule.json'
|
||||
import firstExceptionNoShift from './fixtures/first-exception-rule-no-shift.json'
|
||||
import { detectTemperatureShift } from '../lib/sensiplan'
|
||||
|
||||
const expect = chai.expect
|
||||
|
||||
@@ -12,7 +7,8 @@ describe.only('sensiplan', () => {
|
||||
describe('getTemperatureStatus', () => {
|
||||
describe('regular rule', () => {
|
||||
it('reports lower temperature status before shift', function () {
|
||||
const status = getTemperatureStatus('2018-06-09', lowerTempDays)
|
||||
const lowerTemps = [36.7, 36.57, 36.47, 36.49, 36.57]
|
||||
const status = detectTemperatureShift(lowerTemps)
|
||||
expect(status).to.eql({
|
||||
low: [36.7, 36.55, 36.45, 36.5, 36.55],
|
||||
ltl: 36.7,
|
||||
@@ -22,7 +18,8 @@ describe.only('sensiplan', () => {
|
||||
})
|
||||
|
||||
it('detects temperature shift correctly', function () {
|
||||
const status = getTemperatureStatus('2018-06-14', tempShift)
|
||||
const tempShift = [36.7, 36.57, 36.47, 36.49, 36.57, 36.62, 36.55, 36.8, 36.86, 36.8]
|
||||
const status = detectTemperatureShift(tempShift)
|
||||
expect(status).to.eql({
|
||||
low: [36.7, 36.55, 36.45, 36.5, 36.55, 36.6, 36.55],
|
||||
ltl: 36.6,
|
||||
@@ -32,7 +29,8 @@ describe.only('sensiplan', () => {
|
||||
})
|
||||
|
||||
it('detects missing temperature shift correctly', function () {
|
||||
const status = getTemperatureStatus('2018-06-14', noTempShift)
|
||||
const noTempShift = [36.7, 36.57, 36.47, 36.49, 36.57, 36.62, 36.55, 36.8, 36.86, 36.77]
|
||||
const status = detectTemperatureShift(noTempShift)
|
||||
expect(status).to.eql({
|
||||
low: [36.7, 36.55, 36.45, 36.5, 36.55, 36.6, 36.55],
|
||||
ltl: 36.6,
|
||||
@@ -44,7 +42,8 @@ describe.only('sensiplan', () => {
|
||||
|
||||
describe('1st exception rule', () => {
|
||||
it('detects temperature shift', function () {
|
||||
const status = getTemperatureStatus('2018-06-14', firstException)
|
||||
const firstException = [36.7, 36.57, 36.47, 36.49, 36.57, 36.62, 36.55, 36.8, 36.86, 36.77, 36.63]
|
||||
const status = detectTemperatureShift(firstException)
|
||||
expect(status).to.eql({
|
||||
low: [36.7, 36.55, 36.45, 36.5, 36.55, 36.6, 36.55],
|
||||
ltl: 36.6,
|
||||
@@ -54,7 +53,8 @@ describe.only('sensiplan', () => {
|
||||
})
|
||||
|
||||
it('detects missing temperature shift correctly', function () {
|
||||
const status = getTemperatureStatus('2018-06-14', firstExceptionNoShift)
|
||||
const firstExceptionNoShift = [36.7, 36.57, 36.47, 36.49, 36.57, 36.62, 36.55, 36.8, 36.86, 36.77, 36.57]
|
||||
const status = detectTemperatureShift(firstExceptionNoShift)
|
||||
expect(status).to.eql({
|
||||
low: [36.7, 36.55, 36.45, 36.5, 36.55, 36.6, 36.55],
|
||||
ltl: 36.6,
|
||||
|
||||
Reference in New Issue
Block a user