Skip to content
This repository has been archived by the owner on Jan 14, 2022. It is now read-only.

Commit

Permalink
Merge pull request #877 from LiskHQ/874-total-num-vote
Browse files Browse the repository at this point in the history
Show total number of votes - Closes #874
  • Loading branch information
MichalTuleja authored Jan 9, 2019
2 parents 43460cf + fdf686c commit a6a5609
Show file tree
Hide file tree
Showing 3 changed files with 68 additions and 5 deletions.
65 changes: 65 additions & 0 deletions features/addressDelegate.feature
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
Feature: Delegate page
Scenario: should show title, summary
Given I'm on page "/delegate/537318935439898807L"
Then I should see "Delegate summary" in "h1" html element
And I should see "Home Delegate 537318935439898807L" in "breadcrumb" element
And I should see table "summary" containing:
| Name | genesis_17 |
| Address | 537318935439898807L |
| Uptime | /\d{1,3}(\.\d\d)?%/ |
| Rank / Status | 50 / Active |
| Approval | /\d{1,3}(\.\d\d)?%/ |
| Vote weight | /99(,\d{3})*.\d{1,8} LSK/ |
| Forged | /1,\d{3}.\d{8} LSK/ |
| Blocks | /\d+ \(\d+ missed\)/ |

Scenario: should allow to show voters
Given I'm on page "/delegate/537318935439898807L"
Then I should see "16313739661670634666L • gottavoteemall •" in "voters" element

Scenario: should link voters to address page
Given I'm on page "/delegate/537318935439898807L"
When I click "voter link" no. 2
Then I should be on page "/address/4401082358022424760L"

Scenario: should allow to show votes
Given I'm on page "/delegate/4401082358022424760L"
When I click "blocks tab"
Then I should see "genesis_1 • genesis_10 • genesis_100 • genesis_101 • genesis_11 • genesis_12 • genesis_13 • genesis_14 • genesis_15 • genesis_16 • genesis_17 • genesis_18 • genesis_19 • genesis_2 • genesis_20 • genesis_21 • genesis_22 • genesis_23 • genesis_24 • genesis_25 • genesis_26 • genesis_27 • genesis_28 • genesis_29 • genesis_3 • genesis_30 • genesis_31 • genesis_32 • genesis_33 • genesis_34 • genesis_35 • genesis_36 • genesis_37 • genesis_38 • genesis_39 • genesis_4 • genesis_40 • genesis_41 • genesis_42 • genesis_43 • genesis_44 • genesis_45 • genesis_46 • genesis_47 • genesis_48 • genesis_49 • genesis_5 • genesis_50 • genesis_51 • genesis_52 • genesis_53 • genesis_54 • genesis_55 • genesis_56 • genesis_57 • genesis_58 • genesis_59 • genesis_6 • genesis_60 • genesis_61 • genesis_62 • genesis_63 • genesis_64 • genesis_65 • genesis_66 • genesis_67 • genesis_68 • genesis_69 • genesis_7 • genesis_70 • genesis_71 • genesis_72 • genesis_73 • genesis_74 • genesis_75 • genesis_76 • genesis_77 • genesis_78 • genesis_79 • genesis_8 • genesis_80 • genesis_81 • genesis_82 • genesis_83 • genesis_84 • genesis_85 • genesis_86 • genesis_87 • genesis_88 • genesis_89 • genesis_9 • genesis_90 • genesis_91 • genesis_92 • genesis_93 • genesis_94 • genesis_95 • genesis_96 • genesis_97 • genesis_98 • genesis_99" in "votes" element

Scenario: should link votes to address page
Given I'm on page "/delegate/4401082358022424760L"
When I click "blocks tab"
And I click "vote link" no. 1
Then I should be on page "/address/8273455169423958419L"

Scenario: should link address to address page
Given I'm on page "/delegate/4401082358022424760L"
And I click link on row no. 2 cell no. 2 of "summary" table
Then I should be on page "/address/4401082358022424760L"

Scenario: should show the total number of voters
Given I'm on page "/delegate/11595026565287740051L"
And I click link on row no. 2 cell no. 2 of "summary" table
Then I should be on page "/address/11595026565287740051L"
And I click "details tab"
And I should see "2" in "voter count" element
And I should see "16313739661670634666L • gottavoteemall •" in "voters" element

Scenario: should show Forging statistics
Given I'm on page "/delegate/11595026565287740051L"
And I click link on row no. 2 cell no. 2 of "summary" table
Then I should be on page "/address/11595026565287740051L"
And I click "details tab"
And I should see table "forging statistics" containing:
| Name | genesis_42 |
| Address | 11595026565287740051L |
| Uptime | 100% |
| Rank / Status | 25 / Active |
| Approval | 99.58% |
| Vote weight | 99,685,421.108366 LSK |
| Forged | 1,172.91881186 LSK |
| Blocks | 241 (0 missed) |



2 changes: 0 additions & 2 deletions features/address.feature → features/addressNormal.feature
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,6 @@ Feature: Address page
| /\d{18,20}/ | /2017\/06\/16 \d\d:58:04/ | standby_301 | Delegate registration | 0 LSK | 25.0 LSK | Confirmed |
| /\d{18,20}/ | /2017\/06\/16 \d\d:57:43/ | standby_301 | Delegate vote | 0 LSK | 1.0 LSK | Confirmed |


Scenario: should allow to show votes
Given I'm on page "/address/16313739661670634666L"
When I click "details tab"
Expand All @@ -86,4 +85,3 @@ Feature: Address page
When I click "details tab"
And I click "vote link" no. 1
Then I should be on page "/address/8273455169423958419L"

6 changes: 3 additions & 3 deletions src/components/address/address.html
Original file line number Diff line number Diff line change
Expand Up @@ -117,9 +117,9 @@ <h1>

<div class="row horizontal-padding-xs horizontal-padding-s horizontal-padding-m horizontal-padding-l" data-ng-if="vm.isDelegate">
<div class="col-md-6 col-lg-7">
<h3>Voters <small>{{vm.address.voters.length}}</small></h3>
<h3>Voters <small class="voter-count">{{vm.address.votersMeta.count}}</small></h3>
<div class="delegate-vote" data-ng-if="vm.address.voters">
<div class="row horizontal-padding-xs horizontal-padding-s horizontal-padding-m horizontal-padding-l">
<div class="row voters horizontal-padding-xs horizontal-padding-s horizontal-padding-m horizontal-padding-l">
<div class="col-md-12 voters">
<span data-ng-repeat='voter in vm.address.voters'>
<span>
Expand All @@ -140,7 +140,7 @@ <h3>Votes <small>{{vm.address.votes.length}}</small></h3>
<div class="col-md-6 col-lg-5">
<h3>Forging statistics</h3>
<div class="table-responsive">
<table class="table summary">
<table class="table summary forging-statistics">
<tbody>
<tr>
<td class="left-padding-xs left-padding-s left-padding-m left-padding-l double"><strong>Name</strong></td>
Expand Down

0 comments on commit a6a5609

Please sign in to comment.