Client - add application administration

This commit is contained in:
Sam
2021-10-24 20:13:28 +02:00
parent 04cf43cfd2
commit 2ba931dcf7
20 changed files with 351 additions and 28 deletions

View File

@ -1,6 +1,6 @@
import { assert } from 'chai'
import { getReadableFileSize } from '@/utils/files'
import { getFileSizeInMB, getReadableFileSize } from '@/utils/files'
describe('getReadableFileSize (as text)', () => {
const testsParams = [
@ -59,3 +59,32 @@ describe('getReadableFileSize (as object)', () => {
})
})
})
describe('getFileSizeInMB', () => {
const testsParams = [
{
description: 'returns 0 if provided file size is 0',
inputFileSize: 0,
expectedFileSize: 0,
},
{
description: 'returns 1 (MB) if provided file size is 1048576',
inputFileSize: 1048576,
expectedFileSize: 1,
},
{
description: 'returns 2.53 (MB) if provided file size is 2652897',
inputFileSize: 2652897,
expectedFileSize: 2.53,
},
]
testsParams.map((testParams) => {
it(testParams.description, () => {
assert.deepEqual(
getFileSizeInMB(testParams.inputFileSize),
testParams.expectedFileSize
)
})
})
})