3c7f8d7aa2
Co-authored-by: kolaente <k@knt.li> Reviewed-on: https://kolaente.dev/vikunja/frontend/pulls/620 Co-authored-by: konrad <konrad@kola-entertainments.de> Co-committed-by: konrad <konrad@kola-entertainments.de>
18 lines
613 B
TypeScript
18 lines
613 B
TypeScript
import {calculateItemPosition} from './calculateItemPosition'
|
|
|
|
it('should calculate the task position', () => {
|
|
const result = calculateItemPosition(10, 100)
|
|
expect(result).toBe(55)
|
|
})
|
|
it('should return 0 if no position was provided', () => {
|
|
const result = calculateItemPosition(null, null)
|
|
expect(result).toBe(0)
|
|
})
|
|
it('should calculate the task position for the first task', () => {
|
|
const result = calculateItemPosition(null, 100)
|
|
expect(result).toBe(50)
|
|
})
|
|
it('should calculate the task position for the last task', () => {
|
|
const result = calculateItemPosition(10, null)
|
|
expect(result).toBe(65546)
|
|
})
|