changeset 217:d37a36efafa3

Fix bug where jvm-info subview selector does not update Reviewed-by: jkang Review-thread: http://icedtea.classpath.org/pipermail/thermostat/2017-September/024912.html
author Andrew Azores <aazores@redhat.com>
date Mon, 18 Sep 2017 16:54:31 -0400
parents 467890837250
children de738e948f0a
files src/app/components/jvm-info/jvm-info.controller.js src/app/components/jvm-info/jvm-info.controller.spec.js
diffstat 2 files changed, 6 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/src/app/components/jvm-info/jvm-info.controller.js	Fri Sep 15 14:57:33 2017 -0400
+++ b/src/app/components/jvm-info/jvm-info.controller.js	Mon Sep 18 16:54:31 2017 -0400
@@ -49,6 +49,7 @@
   }
 
   set subView (val) {
+    this._subView = val;
     if (val === '') {
       this._state.go('jvmInfo', { systemId: this.systemId, jvmId: this.jvmId });
     } else {
@@ -56,6 +57,10 @@
     }
   }
 
+  get subView () {
+    return this._subView;
+  }
+
   update () {
     this.jvmInfoService.getJvmInfo(this.systemId, this.jvmId).then(
       res => {
--- a/src/app/components/jvm-info/jvm-info.controller.spec.js	Fri Sep 15 14:57:33 2017 -0400
+++ b/src/app/components/jvm-info/jvm-info.controller.spec.js	Mon Sep 18 16:54:31 2017 -0400
@@ -190,6 +190,7 @@
 
     it('should go to specified jvm-info child state on non-empty selection', () => {
       ctrl.subView = 'fooState';
+      ctrl.subView.should.equal('fooState');
       state.go.should.be.calledWith(sinon.match('jvmInfo.fooState'), sinon.match.has('jvmId', 'foo-jvmId'));
     });
   });