Files
ontime/server/cypress/integration/navigation.spec.js
T
Carlos Valente 0fea4064c3 Feat/55 v2 (#225)
* chore: upgrade relevant libraries
* feat(skip): add skip styling to paginated items
* chore: upgrade relevant libraries
* Fix: issue with text colour (#214)
* fix: adjust text colour from context
* fix: issue with wrong proptype
* fix issue with vite migration (#217)
* hotfix: 1.8.2 issues vite migration
* fix: file import options
* feat(55): styling
* refactor: remove onhover option for entry block
* refactor: relocate logging provider
* refactor: convert to typescript
* feat(55): add event editor
* refactor: extract event actions
* fix: bad import
* feat(55): redesign components
* fix: issues with not awaiting async
* refactor: replace socket with subscription
* refactor: remove unused
* style: small tweaks
* refactor: extract event actions
* refactor: cleanup debug
* refactor: chakra imports
* fix: optimistic mutations
* refactor: handle promise rejections
* refactor: validation
* fix: rq optimistic mutations
* feat: add playback feedback to block
* refactor: no optimistic adding of events
* refactor: simplify cursor state
* styles: cleanup editor style
* refactor: cleanup duration update
* fix: revert package upgrade (issues with vitest)
* fix: prevent cyclic imports
* refactor: extract data fetcher
* refactor: typescript migration
* chore: update tests
2022-10-19 21:30:25 +02:00

167 lines
5.5 KiB
JavaScript

// go through routes and make sure things render as expected
describe('validate routes', () => {
describe('viewer routes', () => {
it('default to stage timer', () => {
cy.visit('http://localhost:4001/');
cy.contains('Time Now');
});
it('renders stage timer', () => {
cy.visit('http://localhost:4001/timer');
cy.contains('Time Now');
});
it('renders presenter', () => {
cy.visit('http://localhost:4001/presenter');
cy.contains('Time Now');
});
it('renders speaker', () => {
cy.visit('http://localhost:4001/speaker');
cy.contains('Time Now');
});
it('renders backstage view /stage', () => {
cy.visit('http://localhost:4001/stage');
cy.contains('Time Now');
});
it('renders backstage view /backstage', () => {
cy.visit('http://localhost:4001/backstage');
cy.contains('Today');
cy.contains('Time Now');
cy.contains('Info');
});
it('renders backstage view /sm', () => {
cy.visit('http://localhost:4001/sm');
cy.contains('Today');
cy.contains('Time Now');
cy.contains('Info');
});
it('renders public view', () => {
cy.visit('http://localhost:4001/public');
cy.contains('Today');
cy.contains('Time Now');
cy.contains('Info');
});
it('renders pip view', () => {
cy.visit('http://localhost:4001/pip');
cy.contains('Today');
cy.contains('Info');
});
it('renders lower third with no errors', () => {
cy.visit('http://localhost:4001/lower');
cy.get('[data-testid="error-container"]').should('not.exist');
});
it('renders studio clock', () => {
cy.visit('http://localhost:4001/studio');
cy.contains('ON AIR');
});
it('renders countdown selection', () => {
cy.visit('http://localhost:4001/countdown');
cy.contains('Select an event to follow');
});
it('renders countdown with event', () => {
cy.visit('http://localhost:4001/countdown?event=1');
cy.contains('Time Now');
cy.contains('Start Time');
cy.contains('End Time');
});
});
describe('clock view timer', () => {
it('renders base route', () => {
// base route
cy.visit('http://localhost:4001/clock');
cy.get('[data-testid="clock-view"]').should('exist');
// ontime fallsback to stage timer on errors, so we check for that
cy.get('.App').should('not.contain', 'Time Now');
});
});
describe('minimal timer and options', () => {
it('renders base route', () => {
// base route
cy.visit('http://localhost:4001/minimal');
cy.get('[data-testid="minimal-timer"]').should('exist');
// ontime fallsback to stage timer on errors, so we check for that
cy.get('.App').should('not.contain', 'Time Now');
});
it('renders with defined options', () => {
// route with options
cy.visit(
'http://localhost:4001/minimal?font=arial=1&size=1.5&text=0f0&key=ff0&hideovertime=true&alignx=start&aligny=end&offsetx=100&offsety=-100&hidemessages=true'
);
cy.get('[data-testid="minimal-timer"]').should('exist');
// ontime fallback to stage timer on errors, so we check for that
cy.get('.App').should('not.contain', 'Time Now');
});
it('hides nav on given option', () => {
// route with options for no nav
cy.visit('http://localhost:4001/minimal?hidenav=true');
cy.get('[data-testid="minimal-timer"]').should('exist');
// ontime fallback to stage timer on errors, so we check for that
cy.get('.App').should('not.contain', 'Time Now');
cy.get('[data-testid="nav-logo"]').should('not.exist');
});
});
describe('editor routes', () => {
it('app editor', () => {
cy.visit('http://localhost:4001/editor');
cy.contains('Event List');
cy.contains('Timer Control');
cy.contains('Messages Control');
cy.contains('Info');
});
it('self contained eventlist', () => {
cy.visit('http://localhost:4001/eventlist');
cy.get('.App').should('contain', 'Event List');
cy.get('.App').should('not.contain', 'Timer Control');
cy.get('.App').should('not.contain', 'Messages Control');
cy.get('.App').should('not.contain', 'Info');
});
it('self contained timercontrol', () => {
cy.visit('http://localhost:4001/timercontrol');
cy.get('.App').should('not.contain', 'Event List');
cy.get('.App').should('contain', 'Timer Control');
cy.get('.App').should('not.contain', 'Messages Control');
cy.get('.App').should('not.contain', 'Info');
});
it('self contained messagecontrol', () => {
cy.visit('http://localhost:4001/messagecontrol');
cy.get('.App').should('not.contain', 'Event List');
cy.get('.App').should('not.contain', 'Timer Control');
cy.get('.App').should('contain', 'Messages Control');
cy.get('.App').should('not.contain', 'Info');
});
it('self contained info', () => {
cy.visit('http://localhost:4001/info');
cy.get('.App').should('not.contain', 'Event List');
cy.get('.App').should('not.contain', 'Timer Control');
cy.get('.App').should('not.contain', 'Messages Control');
cy.get('.App').should('contain', 'Info');
});
});
it('table routes', () => {
cy.visit('http://localhost:4001/table');
cy.contains('Running Timer');
cy.visit('http://localhost:4001/cuesheet');
cy.contains('Running Timer');
cy.visit('http://localhost:4001/cuelist');
cy.contains('Running Timer');
});
});