/
githubmirror
/
gutenberg
Обзор
Документация
Войти
/
githubmirror
/
gutenberg
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
trunk
packages/block-editor/src/hooks/test/settings.js
41 строка
924 B
Marco Ciampini
ESLint: Replace strict config with bulk suppressions (#81248)
07 авг 2026, 14:34
Не верифицирован
07 авг 2026, 14:34
7f43eaf
Код
Авторство
О чём код?
import { applyFilters } from '@wordpress/hooks'; import '../settings'; describe( 'with settings', () => { const blockSettings = { save: () => <div className="default" />, category: 'text', title: 'block title', }; describe( 'addAttribute', () => { const addAttribute = applyFilters.bind( null, 'blocks.registerBlockType' ); it( 'does not have settings att if settings block support is not enabled', () => { const settings = addAttribute( { ...blockSettings, supports: { __experimentalSettings: false, }, } ); expect( settings.attributes ).toBe( undefined ); } ); it( 'has settings att if settings block supports is enabled', () => { const settings = addAttribute( { ...blockSettings, supports: { __experimentalSettings: true, }, } ); expect( settings.attributes ).toStrictEqual( { settings: { type: 'object' }, } ); } ); } ); } );