Changeset View
Changeset View
Standalone View
Standalone View
cypress/e2e/origin-search.cy.js
Show First 20 Lines • Show All 193 Lines • ▼ Show 20 Lines | cy.get('#swh-search-origins-with-visit') | ||||
.get('#swh-filter-empty-visits') | .get('#swh-filter-empty-visits') | ||||
.check({force: true}) | .check({force: true}) | ||||
.get('#swh-search-origin-metadata') | .get('#swh-search-origin-metadata') | ||||
.check({force: true}) | .check({force: true}) | ||||
.then(() => { | .then(() => { | ||||
const searchText = 'plugin'; | const searchText = 'plugin'; | ||||
doSearch(searchText); | doSearch(searchText); | ||||
cy.wait('@originMetadataSearch').then((req) => { | cy.wait('@originMetadataSearch').then((req) => { | ||||
expect(req.response.body[0].metadata.metadata.description).to.equal( | expect(req.response.body).to.deep.equal( | ||||
'Line numbering plugin for Highlight.js' | [ | ||||
// metadata is defined in _TEST_ORIGINS variable in swh/web/tests/data.py | {'url': 'https://github.com/wcoder/highlightjs-line-numbers.js'} | ||||
] | |||||
// origins are defined in _TEST_ORIGINS variable in swh/web/tests/data.py | |||||
); | ); | ||||
}); | }); | ||||
}); | }); | ||||
}); | }); | ||||
it('should not send request to the resolve endpoint', function() { | it('should not send request to the resolve endpoint', function() { | ||||
cy.intercept(`${this.Urls.api_1_resolve_swhid('').slice(0, -1)}**`) | cy.intercept(`${this.Urls.api_1_resolve_swhid('').slice(0, -1)}**`) | ||||
.as('resolveSWHID'); | .as('resolveSWHID'); | ||||
▲ Show 20 Lines • Show All 465 Lines • Show Last 20 Lines |