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");
});
// it("should be able to upload a file", () => {
// cy.intercept("POST", "/skynet/skyfile").as("upload");
it("should be able to upload a file", () => {
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.get('.home-upload input[type="file"]').attachFile(fileName, { subjectType: "drag-n-drop" });
cy.wait(1000); // delay for drag-and-drop to work properly every time
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
// cy.wait("@upload", { responseTimeout: 2 * 60 * 1000 });
// wait max 2 minutes, the portal might be slow at times
cy.wait("@upload", { responseTimeout: 2 * 60 * 1000 });
// cy.contains(".upload-file", fileName).within(() => {
// cy.get(".url")
// .invoke("text")
// .should("match", /\/[a-zA-Z0-9-_]{46}/);
cy.contains(".upload-file", fileName).within(() => {
cy.get("a")
.invoke("text")
.should("match", /\/[a-zA-Z0-9-_]{46}/);
// cy.contains("Copy Link").click();
// cy.contains("Copied!").should("be.visible");
// });
// });
cy.contains("Copy").click();
cy.contains("Copied").should("be.visible");
});
});
});

View File

@ -164,9 +164,11 @@ const Uploader = () => {
{uploads.length > 0 && (
<div className="flex flex-col space-y-5 px-4 py-10 desktop:p-14">
{uploads.map((upload) => (
<UploaderElement key={upload.id} onUploadStateChange={onUploadStateChange} upload={upload} />
))}
<div className="home-uploaded-files">
{uploads.map((upload) => (
<UploaderElement key={upload.id} onUploadStateChange={onUploadStateChange} upload={upload} />
))}
</div>
{showAccountFeatures && (
<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]);
return (
<div>
<div className="upload-file">
<div className="flex items-center">
{upload.status === "enqueued" && <ArrowUpCircle className="flex-shrink-0 fill-current text-palette-300" />}
{upload.status === "retrying" && <ArrowUpCircle className="flex-shrink-0" />}