Wait for route interception in home.spec.ts

Signed-off-by: Sebastian Martinez <me@sebastinez.dev>
This commit is contained in:
Sebastian Martinez
2022-09-07 17:16:16 +02:00
parent 4cd702e412
commit 8e9822d495
+2 -22
View File
@@ -3,31 +3,10 @@ import { MockProvider } from "@rsksmart/mock-web3-provider";
describe("Landing page", () => {
it("Loads projects", () => {
cy.intercept("https://willow.radicle.garden:8777/", {
fixture: "projectHome.json",
});
cy.intercept("https://willow.radicle.garden:8777/v1/peer", {
fixture: "projectPeer.json",
});
cy.intercept("https://pine.radicle.garden:8777/", {
fixture: "projectHome.json",
});
cy.intercept("https://pine.radicle.garden:8777/v1/peer", {
fixture: "projectPeer.json",
});
cy.intercept("https://maple.radicle.garden:8777/", {
fixture: "projectHome.json",
});
cy.intercept("https://maple.radicle.garden:8777/v1/peer", {
fixture: "projectPeer.json",
});
cy.intercept("https://maple.radicle.garden:8777/v1/projects/*", {
fixture: "projectInfo.json",
});
cy.intercept(
{ pathname: "/v1/projects/*" },
{ fixture: "projectInfo.json" },
);
).as("projectInfo");
cy.visit("/", {
onBeforeLoad(win) {
const address = "0xB98bD7C7f656290071E52D1aA617D9cB4467Fd6D";
@@ -40,6 +19,7 @@ describe("Landing page", () => {
});
},
});
cy.wait("@projectInfo");
cy.get(".project .name")
.first()
.should("have.text", "bright-forest-protocol");