Skip to content

Commit

Permalink
fix(tests): fix file drag & drop in cypress
Browse files Browse the repository at this point in the history
  • Loading branch information
NicolasRichel committed Jun 23, 2023
1 parent bc79ec4 commit 42f0867
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/utils/files.js
Original file line number Diff line number Diff line change
Expand Up @@ -81,12 +81,14 @@ function treeIdGenerator(projectToImport) {
* @returns {Promise<File>}
*/
async function getFileFromFileEntry(entry) {
const file = await new Promise((resolve, reject) => entry.file(resolve, reject));
const file = await new Promise((resolve, reject) =>
entry.file(resolve, reject)
);
if (!file.webkitRelativePath) {
// Chrome remove path for unknow reason
file._webkitRelativePath = entry.fullPath.replace('/', '');
// Chrome remove path for an unknown reason
file._webkitRelativePath = entry.fullPath?.replace("/", "");
}
return file
return file;
}

/**
Expand Down

0 comments on commit 42f0867

Please sign in to comment.