Repository: ambari Updated Branches: refs/heads/trunk 0a05a2f7d -> aa3cc9402
AMBARI-8793. Host Details > Alerts: timestamps shown don't make sense (onechiporenko) Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/aa3cc940 Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/aa3cc940 Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/aa3cc940 Branch: refs/heads/trunk Commit: aa3cc9402e903663632f5b9b27fc01b71dac5022 Parents: 0a05a2f Author: Oleg Nechiporenko <onechipore...@apache.org> Authored: Thu Dec 18 17:46:15 2014 +0200 Committer: Oleg Nechiporenko <onechipore...@apache.org> Committed: Thu Dec 18 17:46:15 2014 +0200 ---------------------------------------------------------------------- ambari-web/app/models/alert_instance.js | 2 +- ambari-web/test/models/alert_instance_test.js | 18 ++++++++++++++++++ 2 files changed, 19 insertions(+), 1 deletion(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/ambari/blob/aa3cc940/ambari-web/app/models/alert_instance.js ---------------------------------------------------------------------- diff --git a/ambari-web/app/models/alert_instance.js b/ambari-web/app/models/alert_instance.js index 30aff05..c94a6e4 100644 --- a/ambari-web/app/models/alert_instance.js +++ b/ambari-web/app/models/alert_instance.js @@ -120,7 +120,7 @@ App.AlertInstance = DS.Model.extend({ statusChangedAndLastCheckedFormatted: function () { var lastCheckedFormatted = this.get('lastCheckedFormatted'); var lastTriggeredFormatted = this.get('lastTriggeredFormatted'); - return Em.I18n.t('models.alert_definition.triggered.checked').format(lastCheckedFormatted, lastTriggeredFormatted); + return Em.I18n.t('models.alert_definition.triggered.checked').format(lastTriggeredFormatted, lastCheckedFormatted); }.property('lastCheckedFormatted', 'lastTriggeredFormatted'), /** http://git-wip-us.apache.org/repos/asf/ambari/blob/aa3cc940/ambari-web/test/models/alert_instance_test.js ---------------------------------------------------------------------- diff --git a/ambari-web/test/models/alert_instance_test.js b/ambari-web/test/models/alert_instance_test.js index ba6fac1..906e5f0 100644 --- a/ambari-web/test/models/alert_instance_test.js +++ b/ambari-web/test/models/alert_instance_test.js @@ -38,5 +38,23 @@ describe('App.AlertInstance', function () { }); }); + + describe('#statusChangedAndLastCheckedFormatted', function () { + + it('should Status Changed before Last Checked', function () { + + var lastCheckedFormatted = '123', + lastTriggeredFormatted = '321'; + + model.reopen({ + lastCheckedFormatted: lastCheckedFormatted, + lastTriggeredFormatted: lastTriggeredFormatted + }); + var status = model.get('statusChangedAndLastCheckedFormatted'); + expect(status.indexOf(lastCheckedFormatted) > status.indexOf(lastTriggeredFormatted)).to.be.true; + + }); + + }); });