customization.spec.ts 1.2 KB

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