- this.handleBreadCrumbsContextMenu(...args)}
onAddFiles={this.props.onAddFiles} onMove={this.props.onMove}/>
diff --git a/test/e2e/explore.test.js b/test/e2e/explore.test.js
index 1c8292662..4d84385cc 100644
--- a/test/e2e/explore.test.js
+++ b/test/e2e/explore.test.js
@@ -44,6 +44,7 @@ const createCID = async (value, codec, hasher, version = 1) => {
async function testExploredCid ({ cid, type, humanReadableCID, page, fillOutForm = true }) {
if (fillOutForm) {
await explore.cidInput(page).fill(cid)
+ await expect(explore.inspectButton(page)).toBeEnabled()
await explore.inspectButton(page).press('Enter')
}
@@ -96,6 +97,7 @@ test.describe('Explore screen', () => {
test('Inspect button opens DAG Explorer and shows Raw Block', async ({ page }) => {
// enter the inlined "hello world" CID in the explore form
await explore.cidInput(page).fill(INLINED_HELLO_WORLD_CID)
+ await expect(explore.inspectButton(page)).toBeEnabled()
await explore.inspectButton(page).click()
// should navigate to Explore screen with the CID
diff --git a/test/e2e/files.test.js b/test/e2e/files.test.js
index 0a3e07344..bad12121c 100644
--- a/test/e2e/files.test.js
+++ b/test/e2e/files.test.js
@@ -1,6 +1,6 @@
import { test, expect } from './setup/coverage.js'
import { fixtureData } from './fixtures/index.js'
-import { files } from './setup/locators.js'
+import { files, explore } from './setup/locators.js'
import all from 'it-all'
import filesize from 'filesize'
import * as kuboRpcModule from 'kubo-rpc-client'
@@ -112,4 +112,28 @@ test.describe('Files screen', () => {
await page.waitForURL(`/#/explore/${testCid}`)
await expect(page.getByText('CID info')).toBeVisible()
})
+
+ test('should show error page when navigating to non-existing path', async ({ page }) => {
+ // bafyaabakaieac is CIDv1 of an empty directory, so /404 inside it does not exist
+ const nonExistingPath = '/ipfs/bafyaabakaieac/404'
+
+ // enter the path in the explore form input and click Browse
+ await explore.cidInput(page).fill(nonExistingPath)
+ await expect(explore.browseButton(page)).toBeEnabled()
+ await explore.browseButton(page).click()
+
+ // expect error page to be displayed with the correct title
+ await expect(page.getByRole('heading', { name: 'Unable to load this path' })).toBeVisible()
+
+ // expect the path to be displayed in the error message area (below the heading)
+ await expect(page.locator('p.truncate').filter({ hasText: 'bafyaabakaieac/404' })).toBeVisible()
+
+ // expect the "Go to Files" button to be present and working
+ const goToFilesButton = page.getByRole('link', { name: 'Go to Files' })
+ await expect(goToFilesButton).toBeVisible()
+ await goToFilesButton.click()
+
+ // confirm navigation back to files root
+ await page.waitForURL('/#/files')
+ })
})
diff --git a/test/e2e/status.test.js b/test/e2e/status.test.js
index ac6362473..62af6057f 100644
--- a/test/e2e/status.test.js
+++ b/test/e2e/status.test.js
@@ -41,6 +41,7 @@ test.describe('Status page', () => {
// enter the inlined "hello world" CID
await explore.cidInput(page).fill(INLINED_HELLO_WORLD_CID)
+ await expect(explore.browseButton(page)).toBeEnabled()
await explore.browseButton(page).click()
// should display the file content "hello world"
@@ -56,6 +57,7 @@ test.describe('Status page', () => {
// enter the inlined "hello world" CID
await explore.cidInput(page).fill(INLINED_HELLO_WORLD_CID)
+ await expect(explore.inspectButton(page)).toBeEnabled()
await explore.inspectButton(page).click()
// should display "Raw Block" in DAG Explorer
@@ -88,16 +90,14 @@ test.describe('Status page', () => {
// enter an IPNS path that will fail DNSLink resolution
await explore.cidInput(page).fill('/ipns/invalid-dnslink.example.com')
+ await expect(explore.browseButton(page)).toBeEnabled()
await explore.browseButton(page).click()
// wait for navigation to the IPNS path
await expect(page).toHaveURL(/invalid-dnslink/, { timeout: 10000 })
- // should show error state - either 404 badge or error page
- // (depends on how quickly the DNS lookup fails)
- const error404 = page.getByText('404')
- const errorPage = page.locator('h1.red')
- await expect(error404.or(errorPage)).toBeVisible({ timeout: 30000 })
+ // should show error page with "Unable to load this path" heading
+ await expect(page.getByRole('heading', { name: 'Unable to load this path' })).toBeVisible({ timeout: 30000 })
})
test('ipfs:// protocol URL is accepted and normalized', async ({ page }) => {