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

Bump our minimum supported version of WordPress to 5.5 #150

Merged
merged 2 commits into from Jun 28, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/cypress.yml
Expand Up @@ -17,7 +17,7 @@ jobs:
matrix:
core:
- {name: 'WP latest', version: 'latest'}
- {name: 'WP minimum', version: 'WordPress/WordPress#5.4'}
- {name: 'WP minimum', version: 'WordPress/WordPress#5.5'}
- {name: 'WP trunk', version: 'WordPress/WordPress#master'}
steps:
- name: Checkout
Expand Down
2 changes: 1 addition & 1 deletion insert-special-characters.php
Expand Up @@ -4,7 +4,7 @@
* Plugin URI: https://github.com/10up/insert-special-characters
* Description: A Special Character inserter for the WordPress block editor (Gutenberg).
* Version: 1.0.4
* Requires at least: 5.4
* Requires at least: 5.5
* Requires PHP: 5.6
* Author: 10up
* Author URI: https://10up.com
Expand Down
2 changes: 1 addition & 1 deletion readme.txt
@@ -1,7 +1,7 @@
=== Insert Special Characters ===
Contributors: 10up, adamsilverstein
Tags: Special Characters, Character Map, Omega, Gutenberg, Block, block editor
Requires at least: 5.4
Requires at least: 5.5
Tested up to: 6.0
Stable tag: 1.0.4
Requires PHP: 5.6
Expand Down
49 changes: 21 additions & 28 deletions tests/cypress/integration/insert-character-in-post.test.js
Expand Up @@ -16,40 +16,24 @@ describe( 'Insert character in post', () => {
.contains( 'Page with special characters' )
.click();

cy.get( 'body' ).then( ( $body ) => {
// WP 5.4
if ( $body.find( '.nux-dot-tip__disable' ).length > 0 ) {
cy.get( '.nux-dot-tip__disable' ).click();
} else {
cy.get( 'button[aria-label="Close dialog"]' ).click();
}
} );
cy.get( 'button[aria-label="Close dialog"]' ).click();

/**
* Click block inserter.
*/
cy.get( 'body' ).then( ( $body ) => {
// WP 5.4
if (
$body.find(
'.edit-post-header-toolbar .block-editor-inserter__toggle'
).length > 0
) {
cy.get(
'.edit-post-header-toolbar .block-editor-inserter__toggle'
).click();
} else {
cy.get( '.edit-post-header-toolbar__inserter-toggle' ).click();
}
} );
cy.get( '.edit-post-header-toolbar__inserter-toggle' ).click();

/**
* Search for paragraph block in inserter.
*/
cy.get( 'body' ).then( ( $body ) => {
// WP 5.4
if ( $body.find( '.block-editor-inserter__search' ).length > 0 ) {
cy.get( '.block-editor-inserter__search' ).type( 'Paragraph' );
// WP 5.5
if (
$body.find( '.block-editor-inserter__search-input' ).length > 0
) {
cy.get( '.block-editor-inserter__search-input' ).type(
'Paragraph'
);
} else {
cy.get( '.components-search-control__input' ).type(
'Paragraph'
Expand All @@ -62,9 +46,18 @@ describe( 'Insert character in post', () => {
/**
* Add content to paragraph.
*/
cy.get( '.wp-block-paragraph' )
.click()
.type( 'Hello world' );
cy.get( 'body' ).then( ( $body ) => {
// WP 5.5
if ( $body.find( 'p[data-type="core/paragraph"]' ).length > 0 ) {
cy.get( 'p[data-type="core/paragraph"]' )
.click()
.type( 'Hello world' );
} else {
cy.get( '.wp-block-paragraph' )
.click()
.type( 'Hello world' );
}
} );

/**
* Open block list view.
Expand Down