/
githubmirror
/
gutenberg
Обзор
Документация
Войти
/
githubmirror
/
gutenberg
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
trunk
packages/interface/src/components/fullscreen-mode/test/index.js
47 строк
1 KB
Marco Ciampini
ESLint: Replace strict config with bulk suppressions (#81248)
07 авг 2026, 14:34
Не верифицирован
07 авг 2026, 14:34
7f43eaf
Код
Авторство
О чём код?
import { render } from '@testing-library/react'; import FullscreenMode from '..'; describe( 'FullscreenMode', () => { it( 'fullscreen mode to be added to document body when active', () => { const { baseElement } = render( <FullscreenMode isActive /> ); expect( baseElement ).toHaveClass( 'is-fullscreen-mode' ); } ); it( 'fullscreen mode not to be added to document body when active', () => { const { baseElement } = render( <FullscreenMode isActive={ false } /> ); expect( baseElement ).not.toHaveClass( 'is-fullscreen-mode' ); } ); it( 'sticky-menu to be removed from the body class if present', () => { document.body.classList.add( 'sticky-menu' ); const { baseElement } = render( <FullscreenMode isActive={ false } /> ); expect( baseElement ).not.toHaveClass( 'sticky-menu' ); } ); it( 'sticky-menu to be restored when component unmounted and originally present', () => { document.body.classList.add( 'sticky-menu' ); const { baseElement, unmount } = render( <FullscreenMode isActive={ false } /> ); unmount(); expect( baseElement ).toHaveClass( 'sticky-menu' ); } ); it( 'fullscreen mode to be removed from document body when component unmounted', () => { const { baseElement, unmount } = render( <FullscreenMode isActive /> ); // Present after mounting with `isActive` expect( baseElement ).toHaveClass( 'is-fullscreen-mode' ); unmount(); // Removed after unmounting. expect( baseElement ).not.toHaveClass( 'is-fullscreen-mode' ); } ); } );