Files
bee-dashboard/ui-test/test-case/UnicodeWebsiteUpload.js
T
Cafe137 f82444f212 fix: handle unicode filename and website uploads (#491)
* fix: print meaningful error message for invalid filenames

* fix: handle unicode dirnames and filenames

* chore: revert custom error message
2022-07-26 13:13:25 +02:00

17 lines
784 B
JavaScript

const puppeteer = require('puppeteer')
const { selectStampAndUpload, assertUploadedContentAtPath } = require('../helpers')
const { Click } = require('../library')
/**
* @param {puppeteer.Page} page Puppeteer Page object returned by `browser.newPage()`
*/
async function testUnicodeWebsiteUpload(page) {
await Click.elementWithText(page, 'a', 'Files')
await Click.elementWithTextAndUpload(page, 'button', 'Add Website', 'test-data/test-unicode-website—𝖆𝖆🙇\\𝖈𝖈')
const swarmHash = await selectStampAndUpload(page)
await assertUploadedContentAtPath(swarmHash, 'index.html', 'text/html; charset=utf-8')
await assertUploadedContentAtPath(swarmHash, '—𝖆𝖆🙇/𝖈𝖈.txt', 'text/plain; charset=utf-8')
}
module.exports = { testUnicodeWebsiteUpload }