diff --git a/cypress/support/index.js b/cypress/support/index.js --- a/cypress/support/index.js +++ b/cypress/support/index.js @@ -58,6 +58,23 @@ return loginUser('ambassador', 'ambassador'); }); +function mockSwhStatusRequest() { + cy.intercept('https://status.softwareheritage.org/**', { + body: { + 'result': { + 'status': [ + { + 'id': '5f7c4c567f50b304c1e7bd5f', + 'name': 'Save Code Now', + 'updated': '2020-11-30T13:51:21.151Z', + 'status': 'Operational', + 'status_code': 100 + } + ] + } + }}).as('swhPlatformStatus'); +} + before(function() { this.unarchivedRepo = { url: 'https://github.com/SoftwareHeritage/swh-web', @@ -99,6 +116,8 @@ } }]; + mockSwhStatusRequest(); + const getMetadataForOrigin = async originUrl => { const originVisitsApiUrl = this.Urls.api_1_origin_visits(originUrl); const originVisits = await httpGetJson(originVisitsApiUrl); @@ -156,3 +175,7 @@ } }); }); + +beforeEach(function() { + mockSwhStatusRequest(); +});