diff --git a/tests/fixtures/files/index.js b/tests/fixtures/files/index.js index de9428b..667a629 100644 --- a/tests/fixtures/files/index.js +++ b/tests/fixtures/files/index.js @@ -13,42 +13,6 @@ const all = [ path.join(process.cwd(), '../src/images', 'punchcard-404.svg'), ]; -/* - * Raw File Fixture - * - * @returns {array} - An array file objects as one receives from a multi-upload form - */ -const raw = () => { - const files = _.cloneDeep(all); - const items = []; - let counter = 0; - let random; - do { - random = Math.round(Math.random() * (files.length - 1)); - - const type = path.extname(files[random]) === '.js' ? 'document/javascript' : 'image/svg'; - - items.push({ - fieldName: `file-upload--file-${counter}`, - originalFilename: path.basename(files[random]), - path: files[random], - headers: { - 'content-disposition': `form-data; name="file-upload--file-${counter}"; filename="${path.basename(files[random])}"`, - 'content-type': type, - }, - size: fs.statSync(files[random]).size, - name: path.basename(files[random]), - type, - }); - - files.splice(random, 1); - counter++; - } while (files.length > 0 && Math.random() > 0.5); - - - return items; -}; - /* * Saved File Fixtures * @@ -64,8 +28,8 @@ const saved = () => { const type = path.extname(files[counter]) === '.js' ? 'document/javascript' : 'image/svg'; items.push({ - name: path.basename(files[counter]), - path: `${uuid.v4()}${path.extname(files[counter])}`, + original: path.basename(files[counter]), + relative: `${uuid.v4()}${path.extname(files[counter])}`, type, }); @@ -78,6 +42,5 @@ const saved = () => { module.exports = { - raw, saved, };