f82444f212
* fix: print meaningful error message for invalid filenames * fix: handle unicode dirnames and filenames * chore: revert custom error message
17 lines
784 B
JavaScript
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 }
|