05_offline_identifier_check.cy.js 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. /*
  2. This test is to verify that the identifiers for specific components are
  3. correctly set. This is to ensure that CSS customizations can be made to the web
  4. UI using these specific IDs and/or class names.
  5. These should be documented so people know how to customize their pages.
  6. If you change one of these identifiers, you must update the documentation.
  7. */
  8. import filterTests from '../../support/filterTests';
  9. const identifiers = [
  10. 'header', // The entire header component
  11. 'footer', // The entire footer component
  12. '#global-header-text', // Just the text in the header
  13. '#offline-banner', // The entire offline banner component
  14. '#custom-page-content', // The entire custom page content component
  15. '#notify-button', // The notify button
  16. '#follow-button', // The follow button
  17. ];
  18. filterTests(['desktop'], () => {
  19. describe(`Has correct identifiers for overrides`, () => {
  20. it('Can visit the page', () => {
  21. cy.visit('http://localhost:8080/');
  22. });
  23. // Loop over each identifier and verify it exists.
  24. identifiers.forEach((identifier) => {
  25. it(`Has identifier: ${identifier}`, () => {
  26. cy.get(identifier).should('exist');
  27. });
  28. });
  29. // Followers
  30. const followersCollection = '#followers-collection';
  31. it(`Has identifier: ${followersCollection}`, () => {
  32. cy.contains('Followers').click();
  33. cy.get(followersCollection).should('be.visible');
  34. });
  35. // Modal
  36. const modalContainer = '#modal-container';
  37. it(`Has identifier ${modalContainer}`, () => {
  38. cy.contains('Notify').click();
  39. cy.get(modalContainer, { timeout: 2000 }).should('be.visible');
  40. });
  41. });
  42. });