Skip to content

Commit 8ff18f7

Browse files
committed
test: tests for when vs in maintenance mode
1 parent 36e8794 commit 8ff18f7

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed

cypress/integration/checkData.spec.js

+24
Original file line numberDiff line numberDiff line change
@@ -73,4 +73,28 @@ describe("The Ad Hoc Validate Check Data page", () => {
7373
cy.contains("a", "View Progress and Reports").click();
7474
cy.contains("Failed to load iati data please try again later");
7575
});
76+
it("displays error message uploading a file when validator-services is in maintenance mode", () => {
77+
cy.intercept("POST", "https://*api.iatistandard.org/vs/pvt/adhoc/upload?*", {
78+
statusCode: 503,
79+
body: { message: "Validator services is in read-only mode for maintenance" },
80+
});
81+
cy.get("input[type=file").selectFile("cypress/fixtures/iati-act-no-errors.xml", { force: true });
82+
cy.contains("iati-act-no-errors.xml");
83+
cy.contains("button", "Upload").should("not.be.disabled").click();
84+
cy.contains("Validator services is in read-only mode for maintenance", { timeout: 20000 });
85+
cy.contains("a", "View Progress and Reports").parent().should("have.class", "pointer-events-none");
86+
});
87+
it("displays error message fetching a url when validator-services is in maintenance mode", () => {
88+
cy.intercept("POST", "https://*api.iatistandard.org/vs/pvt/adhoc/url?**/**", {
89+
statusCode: 503,
90+
body: { message: "Validator services is in read-only mode for maintenance" },
91+
});
92+
cy.contains("URL to a remote file").click();
93+
cy.get("#url").type(
94+
"https://raw.githubusercontent.com/IATI/IATI-Extra-Documentation/version-2.03/en/activity-standard/activity-standard.xml",
95+
);
96+
cy.contains("button", "Fetch").should("not.be.disabled").click();
97+
cy.contains("Validator services is in read-only mode for maintenance", { timeout: 20000 });
98+
cy.contains("a", "View Progress and Reports").parent().should("have.class", "pointer-events-none");
99+
});
76100
});

0 commit comments

Comments
 (0)