Changeset View
Changeset View
Standalone View
Standalone View
cypress/integration/origin-search.spec.js
Show First 20 Lines • Show All 100 Lines • ▼ Show 20 Lines | it('should remove origin URL with no archived content', function() { | ||||
cy.wait('@originVisitLatest'); | cy.wait('@originVisitLatest'); | ||||
cy.get('#origin-search-results') | cy.get('#origin-search-results') | ||||
.should('be.visible') | .should('be.visible') | ||||
.find('tbody tr').should('have.length', 0); | .find('tbody tr').should('have.length', 0); | ||||
}); | }); | ||||
it('should filter origins by visit type', function() { | |||||
cy.intercept('**/visit/latest/**').as('checkOriginVisits'); | |||||
cy.get('#swh-origins-url-patterns') | |||||
.type('http'); | |||||
for (let visitType of ['git', 'tar']) { | |||||
cy.get('#swh-search-visit-type') | |||||
.select(visitType); | |||||
cy.get('.swh-search-icon') | |||||
.click(); | |||||
cy.wait('@checkOriginVisits'); | |||||
cy.get('#origin-search-results') | |||||
.should('be.visible'); | |||||
cy.get('tbody tr td.swh-origin-visit-type').then(elts => { | |||||
for (let elt of elts) { | |||||
cy.get(elt).should('have.text', visitType); | |||||
} | |||||
}); | |||||
} | |||||
}); | |||||
it('should show not found message when no repo matches', function() { | it('should show not found message when no repo matches', function() { | ||||
searchShouldShowNotFound(nonExistentText, | searchShouldShowNotFound(nonExistentText, | ||||
'No origins matching the search criteria were found.'); | 'No origins matching the search criteria were found.'); | ||||
}); | }); | ||||
it('should add appropriate URL parameters', function() { | it('should add appropriate URL parameters', function() { | ||||
// Check all three checkboxes and check if | // Check all three checkboxes and check if | ||||
// correct url params are added | // correct url params are added | ||||
▲ Show 20 Lines • Show All 351 Lines • Show Last 20 Lines |