import { computeOriginalIndex , computeOriginalIndexAfterDrop } from "./computeOriginalIndex" ; describe ( "computeOriginalIndex" , ( ) => { it ( "should compute the index of an item in the original array of items" , ( ) => { const maxItems = 4 ; const chunkIndex = 0 ; const indexInChunk = 0 ; const actual = computeOriginalIndex ( maxItems , chunkIndex , indexInChunk ) ; const expected = 0 ; expect ( actual ) . toEqual ( expected ) ; } ) ; it ( "should compute the index of an item in the original array of items" , ( ) => { const maxItems = 4 ; const chunkIndex = 0 ; const indexInChunk = 3 ; const actual = computeOriginalIndex ( maxItems , chunkIndex , indexInChunk ) ; const expected = 3 ; expect ( actual ) . toEqual ( expected ) ; } ) ; it ( "should compute the index of an item in the original array of items" , ( ) => { const maxItems = 4 ; const chunkIndex = 1 ; const indexInChunk = 0 ; const actual = computeOriginalIndex ( maxItems , chunkIndex , indexInChunk ) ; const expected = 4 ; expect ( actual ) . toEqual ( expected ) ; } ) ; it ( "should compute the index of an item in the original array of items" , ( ) => { const maxItems = 4 ; const chunkIndex = 1 ; const indexInChunk = 1 ; const actual = computeOriginalIndex ( maxItems , chunkIndex , indexInChunk ) ; const expected = 5 ; expect ( actual ) . toEqual ( expected ) ; } ) ; } ) ; describe ( "computeOriginalIndexAfterDrop" , ( ) => { it ( "should compute the index of an item in the original array of items after drop" , ( ) => { const maxItems = 4 ; const sourceChunkIndex = 0 ; const destinationChunkIndex = 0 ; const indexInChunk = 1 ; const actual = computeOriginalIndexAfterDrop ( maxItems , sourceChunkIndex , destinationChunkIndex , indexInChunk ) ; const expected = 1 ; expect ( actual ) . toEqual ( expected ) ; } ) ; it ( "should compute the index of an item in the original array of items after drop" , ( ) => { const maxItems = 4 ; const sourceChunkIndex = 1 ; const destinationChunkIndex = 0 ; const indexInChunk = 1 ; const actual = computeOriginalIndexAfterDrop ( maxItems , sourceChunkIndex , destinationChunkIndex , indexInChunk ) ; const expected = 1 ; expect ( actual ) . toEqual ( expected ) ; } ) ; it ( "should compute the index of an item in the original array of items after drop" , ( ) => { const maxItems = 4 ; const sourceChunkIndex = 0 ; const destinationChunkIndex = 1 ; const indexInChunk = 0 ; const actual = computeOriginalIndexAfterDrop ( maxItems , sourceChunkIndex , destinationChunkIndex , indexInChunk ) ; const expected = 3 ; expect ( actual ) . toEqual ( expected ) ; } ) ; it ( "should compute the index of an item in the original array of items after drop" , ( ) => { const maxItems = 4 ; const sourceChunkIndex = 0 ; const destinationChunkIndex = 1 ; const indexInChunk = 1 ; const actual = computeOriginalIndexAfterDrop ( maxItems , sourceChunkIndex , destinationChunkIndex , indexInChunk ) ; const expected = 4 ; expect ( actual ) . toEqual ( expected ) ; } ) ; } ) ;