diff --git a/test/automated/browser/cypress/e2e/offline/01_offline_basic.cy.js b/test/automated/browser/cypress/e2e/offline/01_offline_basic.cy.js index 5c7cab253..e686a8b83 100644 --- a/test/automated/browser/cypress/e2e/offline/01_offline_basic.cy.js +++ b/test/automated/browser/cypress/e2e/offline/01_offline_basic.cy.js @@ -38,7 +38,7 @@ describe(`Basic tests`, () => { }); it('Has correct global header values', () => { - cy.get('.global-header-text').should('have.text', 'New Owncast Server'); + cy.get('#global-header-text').should('have.text', 'New Owncast Server'); }); // Offline banner diff --git a/test/automated/browser/cypress/e2e/offline/05_offline_identifier_check.cy.js b/test/automated/browser/cypress/e2e/offline/05_offline_identifier_check.cy.js new file mode 100644 index 000000000..70cbe9912 --- /dev/null +++ b/test/automated/browser/cypress/e2e/offline/05_offline_identifier_check.cy.js @@ -0,0 +1,44 @@ +/* +This test is to verify that the identifiers for specific components are +correctly set. This is to ensure that CSS customizations can be made to the web +UI using these specific IDs and/or class names. +These should be documented so people know how to customize their pages. +If you change one of these identifiers, you must update the documentation. +*/ + +const identifiers = [ + 'header', // The entire header component + 'footer', // The entire footer component + '#global-header-text', // Just the text in the header + '#offline-banner', // The entire offline banner component + '#custom-page-content', // The entire custom page content component + '#notify-button', // The notify button + '#follow-button', // The follow button +]; + +describe(`Has correct identifiers for overrides`, () => { + it('Can visit the page', () => { + cy.visit('http://localhost:8080/'); + }); + + // Loop over each identifier and verify it exists. + identifiers.forEach((identifier) => { + it(`Has identifier: ${identifier}`, () => { + cy.get(identifier).should('be.visible'); + }); + }); + + // Followers + const followersCollection = '#followers-collection'; + it(`Has identifier: ${followersCollection}`, () => { + cy.get('#rc-tabs-1-tab-3').click(); + cy.get(followersCollection).should('be.visible'); + }); + + // Modal + const modalContainer = '#modal-container'; + it(`Has identifier ${modalContainer}`, () => { + cy.contains('Notify').click(); + cy.get(modalContainer, { timeout: 2000 }).should('be.visible'); + }); +}); diff --git a/test/automated/browser/cypress/e2e/online/05_online_identifier_check.cy.js b/test/automated/browser/cypress/e2e/online/05_online_identifier_check.cy.js new file mode 100644 index 000000000..fae6c21cc --- /dev/null +++ b/test/automated/browser/cypress/e2e/online/05_online_identifier_check.cy.js @@ -0,0 +1,24 @@ +/* +This test is to verify that the identifiers for specific components are +correctly set. This is to ensure that CSS customizations can be made to the web +UI using these specific IDs and/or class names. +These should be documented so people know how to customize their pages. +If you change one of these identifiers, you must update the documentation. +*/ + +const identifiers = [ + '#chat-container', // The entire chat container component +]; + +describe(`Has correct identifiers for overrides`, () => { + it('Can visit the page', () => { + cy.visit('http://localhost:8080/'); + }); + + // Loop over each identifier and verify it exists. + identifiers.forEach((identifier) => { + it(`Has identifier: ${identifier}`, () => { + cy.get(identifier).should('be.visible'); + }); + }); +}); diff --git a/web/components/action-buttons/ActionButton/ActionButton.tsx b/web/components/action-buttons/ActionButton/ActionButton.tsx index 739b4bb41..491e7d54e 100644 --- a/web/components/action-buttons/ActionButton/ActionButton.tsx +++ b/web/components/action-buttons/ActionButton/ActionButton.tsx @@ -1,5 +1,6 @@ import { Button } from 'antd'; import { FC } from 'react'; +import cn from 'classnames'; import { ExternalAction } from '../../../interfaces/external-action'; import styles from './ActionButton.module.scss'; @@ -19,7 +20,7 @@ export const ActionButton: FC = ({ return ( diff --git a/web/components/action-buttons/NotifyButton.tsx b/web/components/action-buttons/NotifyButton.tsx index 7e9e1b9e8..127052874 100644 --- a/web/components/action-buttons/NotifyButton.tsx +++ b/web/components/action-buttons/NotifyButton.tsx @@ -9,7 +9,13 @@ export type NotifyButtonProps = { }; export const NotifyButton: FC = ({ onClick, text }) => ( - ); diff --git a/web/components/modals/FollowModal/FollowModal.tsx b/web/components/modals/FollowModal/FollowModal.tsx index 26cacf756..4fbaf71d2 100644 --- a/web/components/modals/FollowModal/FollowModal.tsx +++ b/web/components/modals/FollowModal/FollowModal.tsx @@ -74,7 +74,7 @@ export const FollowModal: FC = ({ handleClose, account, name } }; return ( - +
By following this stream you'll get notified on the Fediverse when it goes live. Now is a great time to diff --git a/web/components/ui/CustomPageContent/CustomPageContent.tsx b/web/components/ui/CustomPageContent/CustomPageContent.tsx index c4f0f3b57..676915d18 100644 --- a/web/components/ui/CustomPageContent/CustomPageContent.tsx +++ b/web/components/ui/CustomPageContent/CustomPageContent.tsx @@ -7,7 +7,7 @@ export type CustomPageContentProps = { }; export const CustomPageContent: FC = ({ content }) => ( -
+
); diff --git a/web/components/ui/Footer/Footer.tsx b/web/components/ui/Footer/Footer.tsx index 3e11b89b9..5ff92b76c 100644 --- a/web/components/ui/Footer/Footer.tsx +++ b/web/components/ui/Footer/Footer.tsx @@ -6,7 +6,7 @@ export type FooterProps = { }; export const Footer: FC = ({ version }) => ( -
+
Powered by {version} @@ -21,6 +21,6 @@ export const Footer: FC = ({ version }) => ( Source -
+ ); export default Footer; diff --git a/web/components/ui/Header/Header.tsx b/web/components/ui/Header/Header.tsx index 82ee29114..a7a457f3d 100644 --- a/web/components/ui/Header/Header.tsx +++ b/web/components/ui/Header/Header.tsx @@ -23,7 +23,7 @@ export const Header: FC = ({ - {name} + {name}
{chatAvailable && !chatDisabled && } {!chatAvailable && !chatDisabled && ( diff --git a/web/components/ui/Modal/Modal.tsx b/web/components/ui/Modal/Modal.tsx index ccf3e5074..8be798029 100644 --- a/web/components/ui/Modal/Modal.tsx +++ b/web/components/ui/Modal/Modal.tsx @@ -71,7 +71,7 @@ export const Modal: FC = ({ centered destroyOnClose > - <> + ); }; diff --git a/web/components/ui/OfflineBanner/OfflineBanner.tsx b/web/components/ui/OfflineBanner/OfflineBanner.tsx index a54c8b1f5..b8a84f74f 100644 --- a/web/components/ui/OfflineBanner/OfflineBanner.tsx +++ b/web/components/ui/OfflineBanner/OfflineBanner.tsx @@ -66,7 +66,7 @@ export const OfflineBanner: FC = ({ } return ( -
+
{streamName}
diff --git a/web/components/ui/followers/FollowerCollection/FollowerCollection.tsx b/web/components/ui/followers/FollowerCollection/FollowerCollection.tsx index dd1e8c485..b70632eff 100644 --- a/web/components/ui/followers/FollowerCollection/FollowerCollection.tsx +++ b/web/components/ui/followers/FollowerCollection/FollowerCollection.tsx @@ -47,7 +47,7 @@ export const FollowerCollection: FC = ({ name, onFollow }, [followers]); const noFollowers = ( -
+

Be the first follower!

{name !== 'Owncast' ? name : 'This server'} is a part of the{' '} @@ -74,7 +74,7 @@ export const FollowerCollection: FC = ({ name, onFollow } return ( -

+
{followers.map(follower => (