Changeset View
Changeset View
Standalone View
Standalone View
cypress/integration/origin-save.spec.js
/** | /** | ||||
* Copyright (C) 2019 The Software Heritage developers | * Copyright (C) 2019-2020 The Software Heritage developers | ||||
* See the AUTHORS file at the top-level directory of this distribution | * See the AUTHORS file at the top-level directory of this distribution | ||||
* License: GNU Affero General Public License version 3, or any later version | * License: GNU Affero General Public License version 3, or any later version | ||||
* See top-level LICENSE file for more information | * See top-level LICENSE file for more information | ||||
*/ | */ | ||||
let url; | let url; | ||||
let origin; | let origin; | ||||
▲ Show 20 Lines • Show All 72 Lines • ▼ Show 20 Lines | it('should display accepted message when accepted', function() { | ||||
makeOriginSaveRequest(origin.type, origin.url); | makeOriginSaveRequest(origin.type, origin.url); | ||||
cy.wait('@saveRequest').then(() => { | cy.wait('@saveRequest').then(() => { | ||||
checkAlertVisible('success', saveCodeMsg['success']); | checkAlertVisible('success', saveCodeMsg['success']); | ||||
}); | }); | ||||
}); | }); | ||||
it('should validate gitlab subproject url', function() { | |||||
const gitlabSubProjectUrl = 'https://gitlab.com/user/project/sub/'; | |||||
const originSaveUrl = this.Urls.origin_save_request('git', gitlabSubProjectUrl); | |||||
stubSaveRequest(originSaveUrl, 'git', 'accepted', | |||||
gitlabSubProjectUrl, 'not yet scheduled'); | |||||
makeOriginSaveRequest('git', gitlabSubProjectUrl); | |||||
cy.wait('@saveRequest').then(() => { | |||||
checkAlertVisible('success', saveCodeMsg['success']); | |||||
}); | |||||
}); | |||||
it('should display warning message when pending', function() { | it('should display warning message when pending', function() { | ||||
stubSaveRequest(this.originSaveUrl, origin.type, 'pending', | stubSaveRequest(this.originSaveUrl, origin.type, 'pending', | ||||
origin.url, 'not created'); | origin.url, 'not created'); | ||||
makeOriginSaveRequest(origin.type, origin.url); | makeOriginSaveRequest(origin.type, origin.url); | ||||
cy.wait('@saveRequest').then(() => { | cy.wait('@saveRequest').then(() => { | ||||
checkAlertVisible('warning', saveCodeMsg['warning']); | checkAlertVisible('warning', saveCodeMsg['warning']); | ||||
▲ Show 20 Lines • Show All 49 Lines • Show Last 20 Lines |