Skip to content

Commit

Permalink
Merge pull request #1326 from AllenBW/bug/master/#1516430-incorrect-e…
Browse files Browse the repository at this point in the history
…lapsed-play-calculation

BZ#1516430-Ensure the correct ansible play elapsed time is displayed
(cherry picked from commit 22f27c1)

https://bugzilla.redhat.com/show_bug.cgi?id=1525079
  • Loading branch information
himdel authored and simaishi committed Dec 12, 2017
1 parent 995ee63 commit 8f902a5
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -445,7 +445,7 @@ function ComponentController ($state, $stateParams, VmsService, lodash, EventNot
}

function elapsed (finish, start) {
return Math.abs(new Date(finish) - new Date(start)) / 100
return Math.abs(new Date(finish) - new Date(start)) / 1000
}

function availableTooltip (item) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,6 @@ function ComponentController (ModalService, ServicesState, lodash) {
}

function elapsed (finish, start) {
return Math.abs(new Date(finish) - new Date(start)) / 100
return Math.abs(new Date(finish) - new Date(start)) / 1000
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ describe('Component: ServiceDetailsAnsibleComponent', function () {
it('should calculate elapsed time', () => {
ctrl.$onInit()
const elapsedTime = ctrl.elapsed(1497908279, 1497908159)
expect(elapsedTime).to.eq(1.2)
expect(elapsedTime).to.eq(0.12)
})
it('should allow onchanges to be called', (done) => {
const getServiceCredentialSpy = sinon.stub(ServicesState, 'getServiceCredential').returns(Promise.resolve(successResponse))
Expand Down

0 comments on commit 8f902a5

Please sign in to comment.