mirror of
https://github.com/portainer/portainer.git
synced 2025-08-02 20:35:25 +02:00
fix(general): fix the size display using the filesize library (#246)
* fix(general): fix the size display using the filesize library * refactor(humansize): use default value for filter
This commit is contained in:
parent
59e65222eb
commit
739a5ec299
7 changed files with 13 additions and 39 deletions
|
@ -82,32 +82,6 @@ describe('filters', function () {
|
|||
}));
|
||||
});
|
||||
|
||||
describe('humansize', function () {
|
||||
it('should return n/a when size is zero', inject(function (humansizeFilter) {
|
||||
expect(humansizeFilter(0)).toBe('n/a');
|
||||
}));
|
||||
|
||||
it('should handle Bytes values', inject(function (humansizeFilter) {
|
||||
expect(humansizeFilter(512)).toBe('512 Bytes');
|
||||
}));
|
||||
|
||||
it('should handle KB values', inject(function (humansizeFilter) {
|
||||
expect(humansizeFilter(5 * 1024)).toBe('5 KB');
|
||||
}));
|
||||
|
||||
it('should handle MB values', inject(function (humansizeFilter) {
|
||||
expect(humansizeFilter(5 * 1024 * 1024)).toBe('5.0 MB');
|
||||
}));
|
||||
|
||||
it('should handle GB values', inject(function (humansizeFilter) {
|
||||
expect(humansizeFilter(5 * 1024 * 1024 * 1024)).toBe('5.00 GB');
|
||||
}));
|
||||
|
||||
it('should handle TB values', inject(function (humansizeFilter) {
|
||||
expect(humansizeFilter(5 * 1024 * 1024 * 1024 * 1024)).toBe('5.000 TB');
|
||||
}));
|
||||
});
|
||||
|
||||
describe('containername', function () {
|
||||
it('should strip the leading slash from container name', inject(function (containernameFilter) {
|
||||
var container = {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue