* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
import {
- addNoFooterPageClass,
addSideBarClass,
addWhitePageClass,
- removeNoFooterPageClass,
removeSideBarClass,
removeWhitePageClass,
} from '../pages';
describe('class adders', () => {
it.each([
[addSideBarClass, 'sidebar-page'],
- [addNoFooterPageClass, 'no-footer-page'],
[addWhitePageClass, 'white-page'],
])('%s should add the class', (fct, cls) => {
const toggle = jest.spyOn(document.body.classList, 'toggle');
describe('class removers', () => {
it.each([
[removeSideBarClass, 'sidebar-page'],
- [removeNoFooterPageClass, 'no-footer-page'],
[removeWhitePageClass, 'white-page'],
])('%s should add the class', (fct, cls) => {
const toggle = jest.spyOn(document.body.classList, 'toggle');
*/
const CLASS_SIDEBAR_PAGE = 'sidebar-page';
const CLASS_WHITE_PAGE = 'white-page';
-const CLASS_NO_FOOTER_PAGE = 'no-footer-page';
export function addSideBarClass() {
toggleBodyClass(CLASS_SIDEBAR_PAGE, true);
toggleBodyClass(CLASS_WHITE_PAGE, true);
}
-export function addNoFooterPageClass() {
- /* eslint-disable-next-line no-console */
- console.warn('DEPRECATED: addNoFooterPageClass() was deprecated.');
- toggleBodyClass(CLASS_NO_FOOTER_PAGE, true);
-}
-
export function removeSideBarClass() {
toggleBodyClass(CLASS_SIDEBAR_PAGE, false);
}
toggleBodyClass(CLASS_WHITE_PAGE, false);
}
-export function removeNoFooterPageClass() {
- /* eslint-disable-next-line no-console */
- console.warn('DEPRECATED: removeNoFooterPageClass() was deprecated.');
- toggleBodyClass(CLASS_NO_FOOTER_PAGE, false);
-}
-
function toggleBodyClass(className: string, force: boolean) {
document.body.classList.toggle(className, force);
if (document.documentElement) {