mirror of
https://gitlab.com/openstapps/openstapps.git
synced 2026-01-08 14:32:50 +00:00
feat: get tab navigation items from config
This commit is contained in:
@@ -14,16 +14,16 @@
|
||||
*/
|
||||
|
||||
/* eslint-disable @typescript-eslint/no-explicit-any */
|
||||
import {ScheduleProvider} from '../../src/app/modules/calendar/schedule.provider';
|
||||
//import {ScheduleProvider} from '../../src/app/modules/calendar/schedule.provider';
|
||||
|
||||
describe('dashboard', async function () {
|
||||
describe('schedule section', function () {
|
||||
it('should lead to the schedule', function () {
|
||||
cy.visit('/dashboard');
|
||||
cy.visit('/overview');
|
||||
cy.get('.schedule').contains('a', 'Stundenplan').click();
|
||||
cy.url().should('include', '/schedule/recurring');
|
||||
|
||||
cy.visit('/dashboard');
|
||||
cy.visit('/overview');
|
||||
cy.get('.schedule').contains('a', 'Kein Eintrag gefunden').click();
|
||||
cy.url().should('include', '/schedule/recurring');
|
||||
});
|
||||
@@ -34,7 +34,7 @@ describe('dashboard', async function () {
|
||||
// cy.intercept('POST', 'https://mobile.server.uni-frankfurt.de/search', {
|
||||
// fixture: 'search/types/date-series/date-series-1.json',
|
||||
// }).as('search');
|
||||
// cy.visit('/dashboard');
|
||||
// cy.visit('/overview');
|
||||
// cy.get('.schedule-item-button').should('exist');
|
||||
// cy.window()
|
||||
// .then(win => (angular = (win as any).ng))
|
||||
@@ -48,14 +48,14 @@ describe('dashboard', async function () {
|
||||
// }),
|
||||
// );
|
||||
// cy.wait('@search');
|
||||
// cy.visit('/dashboard');
|
||||
// cy.visit('/overview');
|
||||
// cy.get('.schedule-item-button').should('contain', 'UNIcert (Test)');
|
||||
//});
|
||||
});
|
||||
|
||||
describe('mensa section', function () {
|
||||
it('should have info when nothing is added', function () {
|
||||
cy.visit('/dashboard');
|
||||
cy.visit('/overview');
|
||||
|
||||
cy.get('stapps-mensa-section').within(() => {
|
||||
cy.get('.card').should('have.length', 1);
|
||||
@@ -67,7 +67,7 @@ describe('dashboard', async function () {
|
||||
});
|
||||
|
||||
it('should add a mensa', function () {
|
||||
cy.visit('/dashboard');
|
||||
cy.visit('/overview');
|
||||
cy.get('stapps-mensa-section').find('.card > ion-label > a').click();
|
||||
cy.intercept('POST', 'https://mobile.server.uni-frankfurt.de/search', {
|
||||
fixture: 'search/types/canteen/canteen-search-result.json',
|
||||
@@ -95,7 +95,7 @@ describe('dashboard', async function () {
|
||||
});
|
||||
|
||||
it('should have desktop navigation buttons', function () {
|
||||
cy.visit('/dashboard');
|
||||
cy.visit('/overview');
|
||||
|
||||
cy.get('stapps-news-section').within(function () {
|
||||
cy.get('.swiper-button-prev').should('exist');
|
||||
@@ -104,7 +104,7 @@ describe('dashboard', async function () {
|
||||
});
|
||||
|
||||
it('should have working desktop navigation', function () {
|
||||
cy.visit('/dashboard');
|
||||
cy.visit('/overview');
|
||||
|
||||
cy.get('stapps-news-section').within(function () {
|
||||
cy.get('.swiper-slide-active').should(
|
||||
@@ -119,7 +119,7 @@ describe('dashboard', async function () {
|
||||
});
|
||||
|
||||
it('should have a link to the news page', function () {
|
||||
cy.visit('/dashboard');
|
||||
cy.visit('/overview');
|
||||
cy.wait('@search');
|
||||
cy.intercept('POST', 'https://mobile.server.uni-frankfurt.de/search', {
|
||||
fixture: 'search/types/message/single-message.json',
|
||||
@@ -130,45 +130,46 @@ describe('dashboard', async function () {
|
||||
});
|
||||
});
|
||||
|
||||
describe('navigation section', function () {
|
||||
it('should have editable dashboard sections', function () {
|
||||
cy.visit('/dashboard');
|
||||
// TODO: Reenable tests after update of component
|
||||
// describe('navigation section', function () {
|
||||
// it('should have editable dashboard sections', function () {
|
||||
// cy.visit('/overview');
|
||||
|
||||
const section = 'Vorlesungsv.';
|
||||
// const section = 'Vorlesungsv.';
|
||||
|
||||
cy.get('stapps-navigation-section').within(() => {
|
||||
cy.get('.card').should('contain.text', section);
|
||||
// cy.get('stapps-navigation-section').within(() => {
|
||||
// cy.get('.card').should('contain.text', section);
|
||||
|
||||
cy.get('ion-icon[name=edit_square]').click();
|
||||
});
|
||||
// cy.get('ion-icon[name=edit_square]').click();
|
||||
// });
|
||||
|
||||
cy.get('stapps-dashboard-edit-modal').within(() => {
|
||||
cy.contains('ion-item', section).find('ion-toggle').click();
|
||||
// cy.get('stapps-dashboard-edit-modal').within(() => {
|
||||
// cy.contains('ion-item', section).find('ion-toggle').click();
|
||||
|
||||
cy.contains('ion-button', 'Bestätigen').click();
|
||||
});
|
||||
// cy.contains('ion-button', 'Bestätigen').click();
|
||||
// });
|
||||
|
||||
cy.get('stapps-navigation-section').within(() => {
|
||||
cy.get('.card').should('not.contain.text', section);
|
||||
// cy.get('stapps-navigation-section').within(() => {
|
||||
// cy.get('.card').should('not.contain.text', section);
|
||||
|
||||
cy.get('ion-icon[name=edit_square]').click({scrollBehavior: false});
|
||||
});
|
||||
// cy.get('ion-icon[name=edit_square]').click({scrollBehavior: false});
|
||||
// });
|
||||
|
||||
cy.get('stapps-dashboard-edit-modal').within(() => {
|
||||
cy.contains('ion-item', section).find('ion-toggle').click();
|
||||
// cy.get('stapps-dashboard-edit-modal').within(() => {
|
||||
// cy.contains('ion-item', section).find('ion-toggle').click();
|
||||
|
||||
cy.contains('ion-button', 'Bestätigen').click();
|
||||
});
|
||||
// cy.contains('ion-button', 'Bestätigen').click();
|
||||
// });
|
||||
|
||||
cy.get('stapps-navigation-section')
|
||||
.find('.card')
|
||||
.should('contain.text', section);
|
||||
});
|
||||
});
|
||||
// cy.get('stapps-navigation-section')
|
||||
// .find('.card')
|
||||
// .should('contain.text', section);
|
||||
// });
|
||||
// });
|
||||
|
||||
describe('search section', function () {
|
||||
it('should lead to the search when hitting enter', function () {
|
||||
cy.visit('/dashboard');
|
||||
cy.visit('/overview');
|
||||
|
||||
cy.get('stapps-search-section')
|
||||
.find('.searchbar')
|
||||
@@ -181,7 +182,7 @@ describe('dashboard', async function () {
|
||||
});
|
||||
|
||||
it('should go to search when clicking the icon', function () {
|
||||
cy.visit('/dashboard');
|
||||
cy.visit('/overview');
|
||||
|
||||
cy.get('stapps-search-section').find('ion-icon[name=search]').click();
|
||||
cy.url().should('eq', Cypress.config().baseUrl + '/search/');
|
||||
|
||||
Reference in New Issue
Block a user