Skip to content

Commit

Permalink
Merge pull request #150 from 10up/bump-min-wp
Browse files Browse the repository at this point in the history
Bump our minimum supported version of WordPress to 5.5
  • Loading branch information
peterwilsoncc authored Jun 28, 2022
2 parents 0aa28c6 + aec08e5 commit b3ca8b0
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 31 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/cypress.yml
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
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

0 comments on commit b3ca8b0

Please sign in to comment.