Display the height of the blocks on the homepage.

pull/2/head
CJ Bryan and Matt Olenick 7 years ago
parent d14b9c8160
commit e85dd9af38
  1. 7
      lib/explorer_web/templates/page/index.html.eex
  2. 4
      priv/gettext/default.pot
  3. 4
      priv/gettext/en/LC_MESSAGES/default.po
  4. 8
      test/explorer_web/features/contributor_browsing_test.exs
  5. 3
      test/support/feature_case.ex

@ -1 +1,8 @@
<div><%= gettext "explorer-welcome" %></div>
<div class="blocks">
<div class="blocks__title"><%= gettext "blocks-title" %></div>
<%= for block <- @blocks do %>
<div class="blocks__row"><%= block.number %></div>
<% end %>
</div>

@ -18,3 +18,7 @@ msgstr ""
#: lib/explorer_web/templates/page/index.html.eex:1
msgid "explorer-welcome"
msgstr ""
#: lib/explorer_web/templates/page/index.html.eex:2
msgid "blocks-title"
msgstr ""

@ -18,3 +18,7 @@ msgstr "POA Network Explorer"
#: lib/explorer_web/templates/page/index.html.eex:1
msgid "explorer-welcome"
msgstr "Welcome to our blockchain explorer."
#: lib/explorer_web/templates/page/index.html.eex:2
msgid "blocks-title"
msgstr "Blocks"

@ -12,4 +12,12 @@ defmodule ExplorerWeb.UserListTest do
|> click(@logo)
|> assert_has(css("main", text: "Welcome to our blockchain explorer."))
end
test "views blocks on the home page", %{session: session} do
insert_list(5, :block, %{number: 4})
session
|> visit("/")
|> assert_has(css(".blocks__title", text: "Blocks"))
|> assert_has(css(".blocks__row", count: 5, text: "4"))
end
end

@ -6,11 +6,12 @@ defmodule ExplorerWeb.FeatureCase do
use Wallaby.DSL
alias Explorer.Repo
import Ecto
import Ecto.Changeset
import Ecto.Query
import ExplorerWeb.Router.Helpers
import Explorer.Factory
end
end

Loading…
Cancel
Save