feat: improved e2e tests

This commit is contained in:
2023-12-05 15:21:01 +01:00
committed by Thea Schöbl
parent bff2d985aa
commit d7a85b7fae
66 changed files with 6353 additions and 4471 deletions

View File

@@ -15,9 +15,16 @@
describe('news', function () {
beforeEach(function () {
cy.intercept('POST', 'https://mobile.server.uni-frankfurt.de/search', {
fixture: 'search/types/message/message-1.json',
}).as('search');
cy.interceptSearch({
extends: 'news/all',
fixture: 'news/all',
alias: 'search',
});
cy.interceptGet({
uid: 'message',
fixture: 'news/message',
alias: 'detail',
});
});
it('should show all articles by default', function () {
@@ -33,10 +40,8 @@ describe('news', function () {
});
it('should have an external link indicator on detail pages', function () {
cy.intercept('POST', 'https://mobile.server.uni-frankfurt.de/search', {
fixture: 'search/types/message/single-message.json',
}).as('search');
cy.visit('/data-detail/c90c7d30-410f-5aea-a67b-ea1f98929b93');
cy.visit('/data-detail/message');
cy.wait('@detail');
cy.contains('ion-card', 'Ursprünglicher Link').find('ion-icon[name="open_in_browser"]').should('exist');
});
});