18692: Aditional while loop variable added
[arvados-workbench2.git] / src / common / formatters.test.ts
1 // Copyright (C) The Arvados Authors. All rights reserved.
2 //
3 // SPDX-License-Identifier: AGPL-3.0
4
5 import { formatUploadSpeed } from "./formatters";
6
7 describe('formatUploadSpeed', () => {
8     it('should show speed less than 1MB/s', () => {
9         // given
10         const speed = 900;
11
12         // when
13         const result = formatUploadSpeed(0, speed, 0, 1);
14
15         // then
16         expect(result).toBe('0.90 MB/s');
17     });
18
19     it('should show 5MB/s', () => {
20         // given
21         const speed = 5230;
22
23         // when
24         const result = formatUploadSpeed(0, speed, 0, 1);
25
26         // then
27         expect(result).toBe('5.23 MB/s');
28     }); 
29 });