Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Skip Gutenberg plugin activation test on older WP versions #6396

15 changes: 14 additions & 1 deletion tests/e2e/specs/gutenberg-plugin.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,20 @@ test.describe( 'Gutenberg plugin', () => {

expect( plugin.status ).toBe( 'inactive' );

await requestUtils.activatePlugin( 'gutenberg' );
try {
await requestUtils.activatePlugin( 'gutenberg' );
} catch ( error ) {
if (
typeof error === 'object' &&
error !== null &&
Object.prototype.hasOwnProperty.call( error, 'code' ) &&
error.code === 'plugin_wp_incompatible'
) {
test.skip();
} else {
throw error;
}
}

plugin = await requestUtils.rest( {
path: 'wp/v2/plugins/gutenberg/gutenberg',
Expand Down
Loading