|
|
@ -8,13 +8,13 @@ defmodule BlockScoutWeb.AddressCoinBalanceViewTest do |
|
|
|
test "format the wei value in ether" do |
|
|
|
test "format the wei value in ether" do |
|
|
|
wei = Wei.from(Decimal.new(1_340_000_000), :gwei) |
|
|
|
wei = Wei.from(Decimal.new(1_340_000_000), :gwei) |
|
|
|
|
|
|
|
|
|
|
|
assert AddressCoinBalanceView.format(wei) == "1.34 POA" |
|
|
|
assert AddressCoinBalanceView.format(wei) == "1.34 Ether" |
|
|
|
end |
|
|
|
end |
|
|
|
|
|
|
|
|
|
|
|
test "format negative values" do |
|
|
|
test "format negative values" do |
|
|
|
wei = Wei.from(Decimal.new(-1_340_000_000), :gwei) |
|
|
|
wei = Wei.from(Decimal.new(-1_340_000_000), :gwei) |
|
|
|
|
|
|
|
|
|
|
|
assert AddressCoinBalanceView.format(wei) == "-1.34 POA" |
|
|
|
assert AddressCoinBalanceView.format(wei) == "-1.34 Ether" |
|
|
|
end |
|
|
|
end |
|
|
|
end |
|
|
|
end |
|
|
|
|
|
|
|
|
|
|
@ -50,13 +50,13 @@ defmodule BlockScoutWeb.AddressCoinBalanceViewTest do |
|
|
|
test "format positive values" do |
|
|
|
test "format positive values" do |
|
|
|
value = Decimal.new(1_340_000_000_000_000_000) |
|
|
|
value = Decimal.new(1_340_000_000_000_000_000) |
|
|
|
|
|
|
|
|
|
|
|
assert AddressCoinBalanceView.format_delta(value) == "1.34 POA" |
|
|
|
assert AddressCoinBalanceView.format_delta(value) == "1.34 Ether" |
|
|
|
end |
|
|
|
end |
|
|
|
|
|
|
|
|
|
|
|
test "format negative values" do |
|
|
|
test "format negative values" do |
|
|
|
value = Decimal.new(-1_340_000_000_000_000_000) |
|
|
|
value = Decimal.new(-1_340_000_000_000_000_000) |
|
|
|
|
|
|
|
|
|
|
|
assert AddressCoinBalanceView.format_delta(value) == "1.34 POA" |
|
|
|
assert AddressCoinBalanceView.format_delta(value) == "1.34 Ether" |
|
|
|
end |
|
|
|
end |
|
|
|
end |
|
|
|
end |
|
|
|
end |
|
|
|
end |
|
|
|