uppy/packages/@uppy/utils/src/getBytesRemaining.test.ts
Antoine du Hamel 51ecc66e64
@uppy/utils: refactor to TS (#4699)
Co-authored-by: Mikael Finstad <finstaden@gmail.com>
Co-authored-by: Nick Rutten <2504906+nickrttn@users.noreply.github.com>
Co-authored-by: Murderlon <merlijn@soverin.net>
Co-authored-by: Artur Paikin <artur@arturpaikin.com>
2023-11-06 15:01:50 +01:00

16 lines
464 B
TypeScript

import { describe, expect, it } from 'vitest'
import getBytesRemaining from './getBytesRemaining.ts'
describe('getBytesRemaining', () => {
it('should calculate the bytes remaining given a fileProgress object', () => {
const fileProgress = {
bytesUploaded: 1024,
bytesTotal: 3096,
progress: 0,
uploadComplete: false,
percentage: 0,
uploadStarted: 0,
}
expect(getBytesRemaining(fileProgress)).toEqual(2072)
})
})