@@ -4,37 +4,37 @@ import { getLcxResult } from '../../../app/src/lcx'
44describe ( 'getLcxResult function' , ( ) => {
55 it ( 'calculates LCI/LCA interest correctly with typical values' , ( ) => {
66 const result = getLcxResult ( 1000 , 1.0003105377556554 , 13.75 , 365 )
7-
7+
88 expect ( result . interestAmount ) . toBeCloseTo ( 1.38 , 2 )
99 } )
1010
1111 it ( 'calculates LCI/LCA interest for shorter period' , ( ) => {
1212 const result = getLcxResult ( 5000 , 1.0003105377556554 , 12.5 , 180 )
13-
13+
1414 expect ( result . interestAmount ) . toBeCloseTo ( 3.08 , 2 )
1515 } )
1616
1717 it ( 'returns zero interest for zero amount' , ( ) => {
1818 const result = getLcxResult ( 0 , 1.0003105377556554 , 13.75 , 365 )
19-
19+
2020 expect ( result . interestAmount ) . toBe ( 0 )
2121 } )
2222
2323 it ( 'handles zero yearly index rate' , ( ) => {
2424 const result = getLcxResult ( 1000 , 1.0003105377556554 , 0 , 365 )
25-
25+
2626 expect ( result . interestAmount ) . toBe ( 0 )
2727 } )
2828
2929 it ( 'calculates interest correctly for high yearly rate' , ( ) => {
3030 const result = getLcxResult ( 10000 , 1.0003105377556554 , 20 , 365 )
31-
31+
3232 expect ( result . interestAmount ) . toBeCloseTo ( 20.01 , 2 )
3333 } )
3434
3535 it ( 'returns only interestAmount (no tax/IOF for LCI/LCA)' , ( ) => {
3636 const result = getLcxResult ( 1000 , 1.0003105377556554 , 13.75 , 365 )
37-
37+
3838 expect ( result ) . toHaveProperty ( 'interestAmount' )
3939 expect ( result ) . not . toHaveProperty ( 'taxAmount' )
4040 expect ( result ) . not . toHaveProperty ( 'iofAmount' )
@@ -49,14 +49,14 @@ describe('getLcxResult function', () => {
4949 it ( 'calculates higher interest for longer periods' , ( ) => {
5050 const shortTerm = getLcxResult ( 1000 , 1.0003105377556554 , 13.75 , 180 )
5151 const longTerm = getLcxResult ( 1000 , 1.0003105377556554 , 13.75 , 720 )
52-
52+
5353 expect ( longTerm . interestAmount ) . toBeGreaterThan ( shortTerm . interestAmount )
5454 } )
5555
5656 it ( 'scales proportionally with principal amount' , ( ) => {
5757 const small = getLcxResult ( 1000 , 1.0003105377556554 , 13.75 , 365 )
5858 const large = getLcxResult ( 10000 , 1.0003105377556554 , 13.75 , 365 )
59-
59+
6060 expect ( large . interestAmount ) . toBeCloseTo ( small . interestAmount * 10 , 1 )
6161 } )
62- } )
62+ } )
0 commit comments