Fix explorer SPA detail navigation fallback
This commit is contained in:
@@ -50,8 +50,8 @@ test.describe('Explorer Frontend - Nav and Detail Links', () => {
|
||||
|
||||
test('Address breadcrumb home link returns to root', async ({ page }) => {
|
||||
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()
|
||||
await page.waitForSelector('#addressDetailView.active #addressDetailBreadcrumb', { state: 'visible', timeout: 15000 })
|
||||
const homeLink = page.locator('#addressDetailView.active #addressDetailBreadcrumb a[href="/"]').first()
|
||||
await expect(homeLink).toBeVisible({ timeout: 8000 })
|
||||
await homeLink.click()
|
||||
await expect(page).toHaveURL(new RegExp(`${EXPLORER_URL.replace(/[.*+?^${}()|[\]\\]/g, '\\$&')}/?$`), { timeout: 8000 })
|
||||
@@ -59,29 +59,29 @@ test.describe('Explorer Frontend - Nav and Detail Links', () => {
|
||||
|
||||
test('Blocks list opens block detail view', async ({ page }) => {
|
||||
await page.goto(`${EXPLORER_URL}/blocks`, { waitUntil: 'networkidle', timeout: 20000 })
|
||||
const blockRow = page.locator('#blocksList tbody tr').first()
|
||||
await expect(blockRow).toBeVisible({ timeout: 8000 })
|
||||
await blockRow.click()
|
||||
const blockLink = page.locator('#blocksList tbody tr:first-child td:first-child a').first()
|
||||
await expect(blockLink).toBeVisible({ timeout: 8000 })
|
||||
await blockLink.click()
|
||||
await expect(page).toHaveURL(/\/block\/\d+/, { timeout: 8000 })
|
||||
await expect(page.locator('#blockDetailBreadcrumb')).toBeVisible({ timeout: 8000 })
|
||||
await expect(page.locator('#blockDetailView.active #blockDetailBreadcrumb')).toBeVisible({ timeout: 8000 })
|
||||
})
|
||||
|
||||
test('Transactions list opens transaction detail view', async ({ page }) => {
|
||||
await page.goto(`${EXPLORER_URL}/transactions`, { waitUntil: 'networkidle', timeout: 20000 })
|
||||
const transactionRow = page.locator('#allTransactions tbody tr').first()
|
||||
await expect(transactionRow).toBeVisible({ timeout: 8000 })
|
||||
await transactionRow.click()
|
||||
const transactionLink = page.locator('#transactionsList tbody tr:first-child td:first-child a').first()
|
||||
await expect(transactionLink).toBeVisible({ timeout: 8000 })
|
||||
await transactionLink.click()
|
||||
await expect(page).toHaveURL(/\/tx\/0x[a-f0-9]+/i, { timeout: 8000 })
|
||||
await expect(page.locator('#transactionDetailBreadcrumb')).toBeVisible({ timeout: 8000 })
|
||||
await expect(page.locator('#transactionDetailView.active #transactionDetailBreadcrumb')).toBeVisible({ timeout: 8000 })
|
||||
})
|
||||
|
||||
test('Addresses list opens address detail view', async ({ page }) => {
|
||||
await page.goto(`${EXPLORER_URL}/addresses`, { waitUntil: 'networkidle', timeout: 20000 })
|
||||
const addressRow = page.locator('#addressesList tbody tr').first()
|
||||
await expect(addressRow).toBeVisible({ timeout: 8000 })
|
||||
await expect(addressRow).not.toContainText('N/A')
|
||||
await addressRow.click()
|
||||
const addressLink = page.locator('#addressesList tbody tr:first-child td:first-child a').first()
|
||||
await expect(addressLink).toBeVisible({ timeout: 8000 })
|
||||
await expect(page.locator('#addressesList tbody tr').first()).not.toContainText('N/A')
|
||||
await addressLink.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('#addressDetailView.active #addressDetailBreadcrumb')).toBeVisible({ timeout: 8000 })
|
||||
})
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user