From 62c83952fafad639afedf93e179d4ce2be3d35dd Mon Sep 17 00:00:00 2001 From: reyraa Date: Mon, 12 Jun 2017 15:25:21 +0200 Subject: [PATCH 1/2] Fix template issues in forging tab --- src/components/delegateRegistration/delegateRegistration.js | 1 + src/components/forging/forging.pug | 5 +++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/components/delegateRegistration/delegateRegistration.js b/src/components/delegateRegistration/delegateRegistration.js index a1d230e57..75130cb18 100644 --- a/src/components/delegateRegistration/delegateRegistration.js +++ b/src/components/delegateRegistration/delegateRegistration.js @@ -19,6 +19,7 @@ app.component('delegateRegistration', { Account.set({ isDelegate: true, username: data.delegate.username, + delegate: data.delegate, }); $scope.pendingRegistrationListener(); }); diff --git a/src/components/forging/forging.pug b/src/components/forging/forging.pug index f9ecca46e..f74c2bb5b 100644 --- a/src/components/forging/forging.pug +++ b/src/components/forging/forging.pug @@ -1,9 +1,10 @@ md-card.offline-hide div - md-content - div(layout='row', ng-if='$ctrl.delegate && !$ctrl.delegate.username') + md-content(ng-if='!$ctrl.account.get().isDelegate') + div(layout='row') md-card(flex-100, flex-gt-xs=100, layout-align='center center', layout-padding) span.title You need to become a delegate to start forging. If you already registered to become a delegate, your registration hasn't been processed, yet. + md-content(ng-if='$ctrl.account.get().isDelegate') div(layout='column', layout-gt-xs='row') md-card(flex-gt-xs=100, layout-padding) md-card-title From 1414b87180def6e88e6eb9dda2ab499c01a96e2c Mon Sep 17 00:00:00 2001 From: reyraa Date: Mon, 12 Jun 2017 16:31:41 +0200 Subject: [PATCH 2/2] Fix unit tests accordingly --- test/components/forging/forging.spec.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/test/components/forging/forging.spec.js b/test/components/forging/forging.spec.js index 10a74c9fd..3ad84db93 100644 --- a/test/components/forging/forging.spec.js +++ b/test/components/forging/forging.spec.js @@ -58,6 +58,7 @@ describe('Forging component', () => { balance: lsk.from(100), network, delegate, + isDelegate: true, }; account.set(testAcount); @@ -91,7 +92,7 @@ describe('Forging component', () => { }); it('should contain a card with delegate name', () => { - expect(element.find('md-card').text()).to.contain(delegate.username); + expect(element.find('.delegate-name').text()).to.contain(delegate.username); }); it('should contain a card with rank ', () => {