Fix explorer address list regression and live link checks
This commit is contained in:
@@ -1125,13 +1125,23 @@
|
|||||||
var creationTx = blockscoutAddr.creation_tx_hash || blockscoutAddr.creator_tx_hash || blockscoutAddr.creation_transaction_hash || null;
|
var creationTx = blockscoutAddr.creation_tx_hash || blockscoutAddr.creator_tx_hash || blockscoutAddr.creation_transaction_hash || null;
|
||||||
var firstSeen = blockscoutAddr.first_transaction_at || blockscoutAddr.first_seen_at || blockscoutAddr.first_tx_at || null;
|
var firstSeen = blockscoutAddr.first_transaction_at || blockscoutAddr.first_seen_at || blockscoutAddr.first_tx_at || null;
|
||||||
var lastSeen = blockscoutAddr.last_transaction_at || blockscoutAddr.last_seen_at || blockscoutAddr.last_tx_at || null;
|
var lastSeen = blockscoutAddr.last_transaction_at || blockscoutAddr.last_seen_at || blockscoutAddr.last_tx_at || null;
|
||||||
|
var txSent = blockscoutAddr.transactions_sent_count;
|
||||||
|
if (txSent == null) txSent = blockscoutAddr.tx_sent_count;
|
||||||
|
if (txSent == null) txSent = blockscoutAddr.transactions_count;
|
||||||
|
var txReceived = blockscoutAddr.transactions_received_count;
|
||||||
|
if (txReceived == null) txReceived = blockscoutAddr.tx_received_count;
|
||||||
|
if (txReceived == null) txReceived = 0;
|
||||||
return {
|
return {
|
||||||
|
address: hash || null,
|
||||||
hash: hash || null,
|
hash: hash || null,
|
||||||
balance: blockscoutAddr.balance || blockscoutAddr.coin_balance || blockscoutAddr.coin_balance_value || '0',
|
balance: blockscoutAddr.balance || blockscoutAddr.coin_balance || blockscoutAddr.coin_balance_value || '0',
|
||||||
transaction_count: blockscoutAddr.transactions_count != null ? blockscoutAddr.transactions_count : (blockscoutAddr.transaction_count != null ? blockscoutAddr.transaction_count : (blockscoutAddr.tx_count != null ? blockscoutAddr.tx_count : 0)),
|
transaction_count: blockscoutAddr.transactions_count != null ? blockscoutAddr.transactions_count : (blockscoutAddr.transaction_count != null ? blockscoutAddr.transaction_count : (blockscoutAddr.tx_count != null ? blockscoutAddr.tx_count : 0)),
|
||||||
token_count: blockscoutAddr.token_count != null ? blockscoutAddr.token_count : 0,
|
token_count: blockscoutAddr.token_count != null ? blockscoutAddr.token_count : 0,
|
||||||
is_contract: !!blockscoutAddr.is_contract,
|
is_contract: !!blockscoutAddr.is_contract,
|
||||||
is_verified: !!blockscoutAddr.is_verified,
|
is_verified: !!blockscoutAddr.is_verified,
|
||||||
|
tx_sent: txSent != null ? txSent : 0,
|
||||||
|
tx_received: txReceived != null ? txReceived : 0,
|
||||||
|
label: blockscoutAddr.name || blockscoutAddr.ens_domain_name || null,
|
||||||
name: blockscoutAddr.name || null,
|
name: blockscoutAddr.name || null,
|
||||||
ens_domain_name: blockscoutAddr.ens_domain_name || null,
|
ens_domain_name: blockscoutAddr.ens_domain_name || null,
|
||||||
creation_tx_hash: creationTx,
|
creation_tx_hash: creationTx,
|
||||||
|
|||||||
@@ -50,6 +50,7 @@ test.describe('Explorer Frontend - Nav and Detail Links', () => {
|
|||||||
|
|
||||||
test('Address breadcrumb home link returns to root', async ({ page }) => {
|
test('Address breadcrumb home link returns to root', async ({ page }) => {
|
||||||
await page.goto(`${EXPLORER_URL}/address/${ADDRESS_TEST}`, { waitUntil: 'networkidle', timeout: 20000 })
|
await page.goto(`${EXPLORER_URL}/address/${ADDRESS_TEST}`, { waitUntil: 'networkidle', timeout: 20000 })
|
||||||
|
await page.waitForSelector('#addressDetailBreadcrumb', { state: 'attached', timeout: 15000 })
|
||||||
const homeLink = page.locator('#addressDetailBreadcrumb a[href="/"]').first()
|
const homeLink = page.locator('#addressDetailBreadcrumb a[href="/"]').first()
|
||||||
await expect(homeLink).toBeVisible({ timeout: 8000 })
|
await expect(homeLink).toBeVisible({ timeout: 8000 })
|
||||||
await homeLink.click()
|
await homeLink.click()
|
||||||
@@ -58,28 +59,29 @@ test.describe('Explorer Frontend - Nav and Detail Links', () => {
|
|||||||
|
|
||||||
test('Blocks list opens block detail view', async ({ page }) => {
|
test('Blocks list opens block detail view', async ({ page }) => {
|
||||||
await page.goto(`${EXPLORER_URL}/blocks`, { waitUntil: 'networkidle', timeout: 20000 })
|
await page.goto(`${EXPLORER_URL}/blocks`, { waitUntil: 'networkidle', timeout: 20000 })
|
||||||
const blockLink = page.locator('[onclick*="showBlockDetail"]').first()
|
const blockRow = page.locator('#blocksList tbody tr').first()
|
||||||
await expect(blockLink).toBeVisible({ timeout: 8000 })
|
await expect(blockRow).toBeVisible({ timeout: 8000 })
|
||||||
await blockLink.click()
|
await blockRow.click()
|
||||||
await expect(page.locator('#blockDetailView.active')).toBeVisible({ timeout: 8000 })
|
await expect(page).toHaveURL(/\/block\/\d+/, { timeout: 8000 })
|
||||||
await expect(page.locator('#blockDetailBreadcrumb')).toBeVisible({ timeout: 8000 })
|
await expect(page.locator('#blockDetailBreadcrumb')).toBeVisible({ timeout: 8000 })
|
||||||
})
|
})
|
||||||
|
|
||||||
test('Transactions list opens transaction detail view', async ({ page }) => {
|
test('Transactions list opens transaction detail view', async ({ page }) => {
|
||||||
await page.goto(`${EXPLORER_URL}/transactions`, { waitUntil: 'networkidle', timeout: 20000 })
|
await page.goto(`${EXPLORER_URL}/transactions`, { waitUntil: 'networkidle', timeout: 20000 })
|
||||||
const transactionLink = page.locator('[onclick*="showTransactionDetail"]').first()
|
const transactionRow = page.locator('#allTransactions tbody tr').first()
|
||||||
await expect(transactionLink).toBeVisible({ timeout: 8000 })
|
await expect(transactionRow).toBeVisible({ timeout: 8000 })
|
||||||
await transactionLink.click()
|
await transactionRow.click()
|
||||||
await expect(page.locator('#transactionDetailView.active')).toBeVisible({ timeout: 8000 })
|
await expect(page).toHaveURL(/\/tx\/0x[a-f0-9]+/i, { timeout: 8000 })
|
||||||
await expect(page.locator('#transactionDetailBreadcrumb')).toBeVisible({ timeout: 8000 })
|
await expect(page.locator('#transactionDetailBreadcrumb')).toBeVisible({ timeout: 8000 })
|
||||||
})
|
})
|
||||||
|
|
||||||
test('Addresses list opens address detail view', async ({ page }) => {
|
test('Addresses list opens address detail view', async ({ page }) => {
|
||||||
await page.goto(`${EXPLORER_URL}/addresses`, { waitUntil: 'networkidle', timeout: 20000 })
|
await page.goto(`${EXPLORER_URL}/addresses`, { waitUntil: 'networkidle', timeout: 20000 })
|
||||||
const addressLink = page.locator('[onclick*="showAddressDetail"]').first()
|
const addressRow = page.locator('#addressesList tbody tr').first()
|
||||||
await expect(addressLink).toBeVisible({ timeout: 8000 })
|
await expect(addressRow).toBeVisible({ timeout: 8000 })
|
||||||
await addressLink.click()
|
await expect(addressRow).not.toContainText('N/A')
|
||||||
await expect(page.locator('#addressDetailView.active')).toBeVisible({ timeout: 8000 })
|
await addressRow.click()
|
||||||
|
await expect(page).toHaveURL(/\/address\/0x[a-f0-9]+/i, { timeout: 8000 })
|
||||||
await expect(page.locator('#addressDetailBreadcrumb')).toBeVisible({ timeout: 8000 })
|
await expect(page.locator('#addressDetailBreadcrumb')).toBeVisible({ timeout: 8000 })
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|||||||
Reference in New Issue
Block a user