/
githubmirror
/
gutenberg
Обзор
Документация
Войти
/
githubmirror
/
gutenberg
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
trunk
test/e2e/specs/editor/plugins/plugins-api-error-boundary.spec.js
36 строк
956 B
Marco Ciampini
ESLint: Replace strict config with bulk suppressions (#81248)
07 авг 2026, 14:34
Не верифицирован
07 авг 2026, 14:34
7f43eaf
Код
Авторство
О чём код?
const { test, expect } = require( '@wordpress/e2e-test-utils-playwright' ); test.describe( 'Plugins API Error Boundary', () => { test.beforeAll( async ( { requestUtils } ) => { await requestUtils.activatePlugin( 'gutenberg-test-plugin-plugins-error-boundary' ); } ); test.afterAll( async ( { requestUtils } ) => { await requestUtils.deactivatePlugin( 'gutenberg-test-plugin-plugins-error-boundary' ); } ); test( 'Should create notice using plugin error boundary callback', async ( { admin, page, } ) => { let hasError = false; page.on( 'console', ( msg ) => { if ( msg.type() === 'error' && msg.text().includes( 'Whoops!' ) ) { hasError = true; } } ); await admin.createNewPost(); expect( hasError ).toBe( true ); await expect( page.locator( '.is-error .components-notice__content' ) ).toContainText( 'The "my-error-plugin" plugin has encountered an error and cannot be rendered.' ); } ); } );