--- /dev/null
+// Copyright (C) The Arvados Authors. All rights reserved.
+//
+// SPDX-License-Identifier: AGPL-3.0
+
+import { formatUploadSpeed } from "./formatters";
+
+describe('formatUploadSpeed', () => {
+ it('should show speed less than 1MB/s', () => {
+ // given
+ const speed = 900;
+
+ // when
+ const result = formatUploadSpeed(0, speed, 0, 1);
+
+ // then
+ expect(result).toBe('0.90 MB/s');
+ });
+
+ it('should show 5MB/s', () => {
+ // given
+ const speed = 5230;
+
+ // when
+ const result = formatUploadSpeed(0, speed, 0, 1);
+
+ // then
+ expect(result).toBe('5.23 MB/s');
+ });
+});
\ No newline at end of file
const speed = loaded > prevLoaded && currentTime > prevTime
? (loaded - prevLoaded) / (currentTime - prevTime)
: 0;
- return `${(speed / 1000).toFixed(2)} KB/s`;
+
+ return `${(speed / 1000).toFixed(2)} MB/s`;
}
const FILE_SIZES = [
page={this.props.page}
onChangePage={this.changePage}
onChangeRowsPerPage={this.changeRowsPerPage}
+ // Disable next button on empty lists since that's not default behavior
+ nextIconButtonProps={(itemsAvailable > 0) ? {} : {disabled: true}}
component="div" /> : <Button
variant="text"
size="medium"
update(state, id, mapColumns(setFilters(columnName, filters))),
SET_ITEMS: ({ id, items, itemsAvailable, page, rowsPerPage }) =>
- update(state, id, explorer => ({ ...explorer, items, itemsAvailable, page, rowsPerPage })),
+ update(state, id, explorer => ({ ...explorer, items, itemsAvailable, page: page || 0, rowsPerPage })),
APPEND_ITEMS: ({ id, items, itemsAvailable, page, rowsPerPage }) =>
update(state, id, explorer => ({