From bcda477080b2e7b3495c1fbb64e06dc09f3300c8 Mon Sep 17 00:00:00 2001 From: Victor Baranov Date: Fri, 16 Oct 2020 15:51:50 +0300 Subject: [PATCH 1/3] Fix tokens dropdown appearance --- apps/block_scout_web/assets/js/pages/address.js | 2 +- apps/block_scout_web/assets/js/pages/admin/tasks.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/apps/block_scout_web/assets/js/pages/address.js b/apps/block_scout_web/assets/js/pages/address.js index 5e3f0570c2..2ed9ab2090 100644 --- a/apps/block_scout_web/assets/js/pages/address.js +++ b/apps/block_scout_web/assets/js/pages/address.js @@ -72,7 +72,7 @@ export function reducer (state = initialState, action) { let fetchedTokenBalanceBlockNumber = 0 function loadTokenBalance (blockNumber) { - if (blockNumber > fetchedTokenBalanceBlockNumber) { + if (blockNumber >= fetchedTokenBalanceBlockNumber) { fetchedTokenBalanceBlockNumber = blockNumber setTimeout(loadTokenBalanceDropdown, 1000) } diff --git a/apps/block_scout_web/assets/js/pages/admin/tasks.js b/apps/block_scout_web/assets/js/pages/admin/tasks.js index 602e81c8b4..146333afba 100644 --- a/apps/block_scout_web/assets/js/pages/admin/tasks.js +++ b/apps/block_scout_web/assets/js/pages/admin/tasks.js @@ -14,7 +14,7 @@ const runTask = (event) => { $loading.show() $.get(apiPath) - .done(response => { + .done(_response => { $successMessage.show() $loading.hide() }) From 290d5a64b2060264828a482851a04e4b7f002e06 Mon Sep 17 00:00:00 2001 From: Victor Baranov Date: Fri, 16 Oct 2020 15:55:21 +0300 Subject: [PATCH 2/3] Add CHANGELOG entry --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 51b9489a51..18c5173146 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,7 +1,7 @@ ## Current ### Features -- [#2292](https://github.com/poanetwork/blockscout/pull/2292), [#3356](https://github.com/poanetwork/blockscout/pull/3356) - Add Web UI for POSDAO Staking DApp +- [#2292](https://github.com/poanetwork/blockscout/pull/2292), [#3356](https://github.com/poanetwork/blockscout/pull/3356), [#3360](https://github.com/poanetwork/blockscout/pull/3360) - Add Web UI for POSDAO Staking DApp - [#3354](https://github.com/poanetwork/blockscout/pull/3354) - Tx hash in EOA coin balance history - [#3333](https://github.com/poanetwork/blockscout/pull/3333), [#3337](https://github.com/poanetwork/blockscout/pull/3337) - Dark forest contract custom theme - [#3330](https://github.com/poanetwork/blockscout/pull/3330) - Caching of address transactions counter, remove query 10_000 rows limit From 02c11f955b1c8b39fed187f2b445106467b98314 Mon Sep 17 00:00:00 2001 From: Victor Baranov Date: Fri, 16 Oct 2020 16:19:37 +0300 Subject: [PATCH 3/3] Actualize tests --- .../features/viewing_addresses_test.exs | 41 +++++++++++++------ 1 file changed, 28 insertions(+), 13 deletions(-) diff --git a/apps/block_scout_web/test/block_scout_web/features/viewing_addresses_test.exs b/apps/block_scout_web/test/block_scout_web/features/viewing_addresses_test.exs index 6de0404ed7..7cd9f45c21 100644 --- a/apps/block_scout_web/test/block_scout_web/features/viewing_addresses_test.exs +++ b/apps/block_scout_web/test/block_scout_web/features/viewing_addresses_test.exs @@ -364,8 +364,13 @@ defmodule BlockScoutWeb.ViewingAddressesTest do end test "filter tokens balances by token name", %{session: session, lincoln: lincoln} do - session - |> AddressPage.visit_page(lincoln) + next = + session + |> AddressPage.visit_page(lincoln) + + Process.sleep(2_000) + + next |> AddressPage.click_balance_dropdown_toggle() |> AddressPage.fill_balance_dropdown_search("ato") |> assert_has(AddressPage.token_balance(count: 2)) @@ -374,19 +379,29 @@ defmodule BlockScoutWeb.ViewingAddressesTest do end # flaky test - # test "filter token balances by token symbol", %{session: session, lincoln: lincoln} do - # session - # |> AddressPage.visit_page(lincoln) - # |> AddressPage.click_balance_dropdown_toggle() - # |> AddressPage.fill_balance_dropdown_search("T2") - # |> assert_has(AddressPage.token_balance(count: 2)) - # |> assert_has(AddressPage.token_type(count: 2)) - # |> assert_has(AddressPage.token_type_count(type: "ERC-20", text: "1")) - # end + test "filter token balances by token symbol", %{session: session, lincoln: lincoln} do + next = + session + |> AddressPage.visit_page(lincoln) + + Process.sleep(2_000) + + next + |> AddressPage.click_balance_dropdown_toggle() + |> AddressPage.fill_balance_dropdown_search("T2") + |> assert_has(AddressPage.token_balance(count: 2)) + |> assert_has(AddressPage.token_type(count: 2)) + |> assert_has(AddressPage.token_type_count(type: "ERC-20", text: "1")) + end test "reset token balances filter when dropdown closes", %{session: session, lincoln: lincoln} do - session - |> AddressPage.visit_page(lincoln) + next = + session + |> AddressPage.visit_page(lincoln) + + Process.sleep(2_000) + + next |> AddressPage.click_balance_dropdown_toggle() |> AddressPage.fill_balance_dropdown_search("ato") |> AddressPage.click_outside_of_the_dropdown()