Skip to content

Commit 47c70d4

Browse files
committed
Add test for handling network error when retrieving changelog
1 parent 4d9a11f commit 47c70d4

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

cypress/e2e/game/misc.cy.ts

+9
Original file line numberDiff line numberDiff line change
@@ -238,6 +238,15 @@ describe("misc", () => {
238238
cy.get(".dialog .changelog-error").should("be.visible");
239239
});
240240

241+
it("should display an error message if the changelog cannot be retrieved due to a network error", () => {
242+
cy.intercept("GET", "/CHANGELOG.html", { forceNetworkError: true }).as("getChangelog");
243+
cy.contains("Changelog").should("not.exist");
244+
cy.get(".dialog .changelog-error").should("not.exist");
245+
cy.get("#changelog-link").click({ force: true });
246+
cy.wait("@getChangelog");
247+
cy.get(".dialog .changelog-error").should("be.visible");
248+
});
249+
241250
it("should only make one request to the changelog", () => {
242251
const interceptedRequests = [];
243252

0 commit comments

Comments
 (0)