Skip to content

Commit

Permalink
test: test clicking children links on explore page
Browse files Browse the repository at this point in the history
  • Loading branch information
SgtPooki committed Feb 20, 2023
1 parent 8326432 commit d542fea
Showing 1 changed file with 15 additions and 3 deletions.
18 changes: 15 additions & 3 deletions test/e2e/explore.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,11 @@ const createCID = async (value, codec, hasher, version = 1) => {
}
}

async function testExploredCid ({ cid, type, humanReadableCID, page }) {
await page.fill('[data-id="FilesExploreForm"] input[id="ipfs-path"]', cid)
await page.press('[data-id="FilesExploreForm"] button[title="Inspect"]', 'Enter')
async function testExploredCid ({ cid, type, humanReadableCID, page, fillOutForm = true }) {
if (fillOutForm) {
await page.fill('[data-id="FilesExploreForm"] input[id="ipfs-path"]', cid)
await page.press('[data-id="FilesExploreForm"] button[title="Inspect"]', 'Enter')
}

// wait for loading
const spinner = page.locator('.la-ball-triangle-path')
Expand Down Expand Up @@ -139,6 +141,16 @@ test.describe('Explore screen', () => {
type: 'dag-pb'
})
await page.waitForSelector('"UnixFS"')
const firstChild = await page.waitForSelector('"1 - Barrel - Part 1"')
await firstChild.click()
await testExploredCid({
fillOutForm: false,
page,
cid: 'QmbQDovX7wRe9ek7u6QXe9zgCXkTzoUSsTFJEkrYV1HrVR',
humanReadableCID: 'base58btc - cidv0 - dag-pb - sha2-256~256~C212195DE60CE9B899EFDB2830101B16556018A24C7428E32198FAAB9D493F94',
type: 'dag-pb'
})
await page.waitForSelector('"UnixFS"')
})
})
})

0 comments on commit d542fea

Please sign in to comment.