customization.spec.ts 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. import { isExcludedBySharding, startWith } from './helpers/config'
  2. describe('Customization', () => {
  3. if (isExcludedBySharding('CE_CUSTOM_1')) return
  4. describe('default settings', () => {
  5. startWith({})
  6. it('should display the default right footer', () => {
  7. cy.visit('/')
  8. cy.get('footer').findByRole('link', { name: 'Fork on GitHub!' })
  9. })
  10. })
  11. describe('custom settings', () => {
  12. startWith({
  13. vars: {
  14. OVERLEAF_APP_NAME: 'CUSTOM APP NAME',
  15. OVERLEAF_LEFT_FOOTER: JSON.stringify([{ text: 'CUSTOM LEFT FOOTER' }]),
  16. OVERLEAF_RIGHT_FOOTER: JSON.stringify([
  17. { text: 'CUSTOM RIGHT FOOTER' },
  18. ]),
  19. },
  20. })
  21. it('should display custom name', () => {
  22. cy.visit('/')
  23. cy.get('nav').findByText('CUSTOM APP NAME')
  24. })
  25. it('should display custom left footer', () => {
  26. cy.visit('/')
  27. cy.get('footer').findByText('CUSTOM LEFT FOOTER')
  28. })
  29. it('should display custom right footer', () => {
  30. cy.visit('/')
  31. cy.get('footer').findByText('CUSTOM RIGHT FOOTER')
  32. })
  33. })
  34. })