diff options
author | Filipa Lacerda <filipa@gitlab.com> | 2017-06-16 17:33:38 +0100 |
---|---|---|
committer | Filipa Lacerda <filipa@gitlab.com> | 2017-06-16 17:33:38 +0100 |
commit | 27ba946c645ba81bf9f8196df79dd08f560f4867 (patch) | |
tree | 6c3413c0fffe6df0ede5b8fded25046cf5889e1e | |
parent | 547b90fb7d4ff2d3feb4312ef205ce634e0bc622 (diff) | |
download | gitlab-ce-graingert/gitlab-ce-show-only-relevant-digits-for-build-truncate-info.tar.gz |
Fix broken tests by updating size in tests to use floatgraingert/gitlab-ce-show-only-relevant-digits-for-build-truncate-info
-rw-r--r-- | spec/javascripts/build_spec.js | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/spec/javascripts/build_spec.js b/spec/javascripts/build_spec.js index be90dbdd88a..b0b66c4eef7 100644 --- a/spec/javascripts/build_spec.js +++ b/spec/javascripts/build_spec.js @@ -1,6 +1,6 @@ /* eslint-disable no-new */ /* global Build */ -import { bytesToKiB } from '~/lib/utils/number_utils'; +import { formatRelevantDigits, bytesToKiB } from './lib/utils/number_utils'; import '~/lib/utils/datetime_utility'; import '~/lib/utils/url_utility'; import '~/build'; @@ -145,7 +145,7 @@ describe('Build', () => { html: '<span>Update</span>', status: 'success', append: false, - size: 50, + size: 50.0, total: 100, }); @@ -155,7 +155,7 @@ describe('Build', () => { }); it('shows the size in KiB', () => { - const size = 50; + const size = 50.0; spyOn(gl.utils, 'visitUrl'); const deferred = $.Deferred(); @@ -172,7 +172,7 @@ describe('Build', () => { expect( document.querySelector('.js-truncated-info-size').textContent.trim(), - ).toEqual(`${bytesToKiB(size)}`); + ).toEqual(`${formatRelevantDigits(bytesToKiB(size))}`); }); it('shows incremented size', () => { @@ -188,7 +188,7 @@ describe('Build', () => { html: '<span>Update</span>', status: 'success', append: false, - size: 50, + size: 50.0, total: 100, }); @@ -198,7 +198,7 @@ describe('Build', () => { expect( document.querySelector('.js-truncated-info-size').textContent.trim(), - ).toEqual(`${bytesToKiB(50)}`); + ).toEqual(`${formatRelevantDigits(bytesToKiB(50.0))}`); jasmine.clock().tick(4001); @@ -206,13 +206,13 @@ describe('Build', () => { html: '<span>Update</span>', status: 'success', append: true, - size: 10, + size: 10.0, total: 100, }); expect( document.querySelector('.js-truncated-info-size').textContent.trim(), - ).toEqual(`${bytesToKiB(60)}`); + ).toEqual(`${formatRelevantDigits(bytesToKiB(60.0))}`); }); it('renders the raw link', () => { @@ -224,7 +224,7 @@ describe('Build', () => { html: '<span>Update</span>', status: 'success', append: false, - size: 50, + size: 50.0, total: 100, }); @@ -246,7 +246,7 @@ describe('Build', () => { html: '<span>Update</span>', status: 'success', append: false, - size: 100, + size: 100.0, total: 100, }); @@ -267,7 +267,7 @@ describe('Build', () => { html: '<span>Update</span>', status: 'success', append: false, - size: 50, + size: 50.0, total: 100, }); |