fix day 1 target weight bug and chicken counting row not showed before publish cutoff
This commit is contained in:
1 parent
05465b0382
commit
3fe6b05258
5 files changed
+28
-11
No files matched your search
@@ -25,8 +25,9 @@ describe('getTargetWeightForAge', () => {
|
||||
expect(getTargetWeightForAge(7, 60)).toBe(row.values[6]);
|
||||
});
|
||||
|
||||
it('returns null for ages outside 1..35', () => {
|
||||
expect(getTargetWeightForAge(0, 42)).toBeNull();
|
||||
it('returns docWeight for age 0 and null for ages outside 0..35', () => {
|
||||
expect(getTargetWeightForAge(0, 42)).toBe(42);
|
||||
expect(getTargetWeightForAge(-1, 42)).toBeNull();
|
||||
expect(getTargetWeightForAge(36, 42)).toBeNull();
|
||||
});
|
||||
});
|
||||
@@ -37,7 +38,15 @@ describe('getTargetGainForAge', () => {
|
||||
expect(getTargetGainForAge(2, 40)).toBe(row.values[1]! - row.values[0]!);
|
||||
});
|
||||
|
||||
it('returns null for age 1', () => {
|
||||
expect(getTargetGainForAge(1, 40)).toBeNull();
|
||||
it('calculates target gain for age 1 relative to docWeight', () => {
|
||||
const row = rowForDoc(40);
|
||||
expect(getTargetGainForAge(1, 40)).toBe(row.values[0]! - 40);
|
||||
});
|
||||
|
||||
it('returns null for ages outside 1..35 or invalid docWeight', () => {
|
||||
expect(getTargetGainForAge(0, 40)).toBeNull();
|
||||
expect(getTargetGainForAge(36, 40)).toBeNull();
|
||||
expect(getTargetGainForAge(1, 0)).toBeNull();
|
||||
expect(getTargetGainForAge(1, -5)).toBeNull();
|
||||
});
|
||||
});
|
||||
Reference in new issue
Block a user