reenable end to end uploader test

This commit is contained in:
Karol Wypchlo 2022-02-04 15:14:37 +01:00
parent fabf8cf01e
commit 4e5bb2d445
No known key found for this signature in database
GPG Key ID: B515DE9EEBE241E1
3 changed files with 22 additions and 21 deletions

View File

@ -9,27 +9,26 @@ context("Skynet website", () => {
cy.contains("Decentralized Internet"); cy.contains("Decentralized Internet");
}); });
// it("should be able to upload a file", () => { it("should be able to upload a file", () => {
// cy.intercept("POST", "/skynet/skyfile").as("upload"); cy.intercept("POST", "/skynet/skyfile").as("upload");
// const fileName = "check.json"; const fileName = "example.json";
// cy.wait(1000); // delay for drag-and-drop to work properly every time cy.wait(1000); // delay for drag-and-drop to work properly every time
// cy.get('.home-upload input[type="file"]').attachFile(fileName, { subjectType: "drag-n-drop" }); cy.get('.home-upload-dropzone input[type="file"]').attachFile(fileName, { force: true });
// cy.get(".home-upload").scrollIntoView(); cy.get(".home-uploaded-files").children().should("have.length", 1);
// cy.get(".home-uploaded-files").children().should("have.length", 1);
// // wait max 2 minutes, the portal might be slow at times // wait max 2 minutes, the portal might be slow at times
// cy.wait("@upload", { responseTimeout: 2 * 60 * 1000 }); cy.wait("@upload", { responseTimeout: 2 * 60 * 1000 });
// cy.contains(".upload-file", fileName).within(() => { cy.contains(".upload-file", fileName).within(() => {
// cy.get(".url") cy.get("a")
// .invoke("text") .invoke("text")
// .should("match", /\/[a-zA-Z0-9-_]{46}/); .should("match", /\/[a-zA-Z0-9-_]{46}/);
// cy.contains("Copy Link").click(); cy.contains("Copy").click();
// cy.contains("Copied!").should("be.visible"); cy.contains("Copied").should("be.visible");
// }); });
// }); });
}); });

View File

@ -164,9 +164,11 @@ const Uploader = () => {
{uploads.length > 0 && ( {uploads.length > 0 && (
<div className="flex flex-col space-y-5 px-4 py-10 desktop:p-14"> <div className="flex flex-col space-y-5 px-4 py-10 desktop:p-14">
{uploads.map((upload) => ( <div className="home-uploaded-files">
<UploaderElement key={upload.id} onUploadStateChange={onUploadStateChange} upload={upload} /> {uploads.map((upload) => (
))} <UploaderElement key={upload.id} onUploadStateChange={onUploadStateChange} upload={upload} />
))}
</div>
{showAccountFeatures && ( {showAccountFeatures && (
<div className="z-0 relative flex flex-col items-center space-y-1 pt-8"> <div className="z-0 relative flex flex-col items-center space-y-1 pt-8">

View File

@ -110,7 +110,7 @@ export default function UploaderElement({ onUploadStateChange, upload }) {
}, [onUploadStateChange, upload, retryTimeout]); }, [onUploadStateChange, upload, retryTimeout]);
return ( return (
<div> <div className="upload-file">
<div className="flex items-center"> <div className="flex items-center">
{upload.status === "enqueued" && <ArrowUpCircle className="flex-shrink-0 fill-current text-palette-300" />} {upload.status === "enqueued" && <ArrowUpCircle className="flex-shrink-0 fill-current text-palette-300" />}
{upload.status === "retrying" && <ArrowUpCircle className="flex-shrink-0" />} {upload.status === "retrying" && <ArrowUpCircle className="flex-shrink-0" />}