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
This commit is contained in:
@@ -0,0 +1,16 @@
|
||||
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 }
|
||||
Reference in New Issue
Block a user