This repository has been archived on 2022-10-07. You can view files and clone it, but cannot push or open issues or pull requests.
skynet-webportal/cypress/integration/intergration.spec.js

39 lines
1022 B
JavaScript
Raw Normal View History

2020-03-05 10:37:50 +00:00
/// <reference types="cypress" />
context("Skynet", () => {
beforeEach(() => {
cy.visit("");
});
it("should render key website elements", () => {
cy.contains("Build a Free Internet");
cy.contains("Upload your Files");
cy.contains("Have a Skylink?");
});
it("should be able to upload a file", () => {
2020-03-11 09:47:25 +00:00
cy.server();
cy.route("POST", "/skynet/skyfile").as("upload");
2020-03-05 10:37:50 +00:00
const fileName = "check.json";
cy.fixture(fileName).then((fileContent) => {
cy.get('.home-upload input[type="file"]').upload({ fileContent, fileName, mimeType: "application/json" });
});
2020-03-23 14:02:47 +00:00
cy.get(".home-uploaded-files").children().should("have.length", 1);
2020-03-11 09:47:25 +00:00
cy.wait("@upload");
2020-03-05 10:37:50 +00:00
cy.contains(".upload-file", fileName).within(() => {
cy.get(".url")
.invoke("text")
.should("match", /\/[a-zA-Z0-9-_]{46}/);
cy.contains("Copy Link").click();
cy.contains("Copied!").should("be.visible");
cy.contains("Copied!").should("not.be.visible");
});
});
});