Skip to content

Commit

Permalink
Drop support for WP 6.4 (#209)
Browse files Browse the repository at this point in the history
* Drop support for WP 6.4

* Fix e2e test

* e2e: Explicitly activate a specific theme
  • Loading branch information
t-hamano authored Oct 17, 2024
1 parent e984ef4 commit 7665cb8
Show file tree
Hide file tree
Showing 7 changed files with 45 additions and 63 deletions.
6 changes: 0 additions & 6 deletions .github/workflows/run-test-and-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,20 +15,14 @@ jobs:
wp: WordPress
- php: '7.4'
wp: WordPress#6.5.5
- php: '7.4'
wp: WordPress#6.4.5
- php: '8.0'
wp: WordPress
- php: '8.0'
wp: WordPress#6.5.5
- php: '8.0'
wp: WordPress#6.4.5
- php: '8.2'
wp: WordPress
- php: '8.2'
wp: WordPress#6.5.5
- php: '8.2'
wp: WordPress#6.4.5
name: PHP ${{ matrix.php }} / ${{ matrix.wp }} Test

steps:
Expand Down
6 changes: 0 additions & 6 deletions .github/workflows/run-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,20 +23,14 @@ jobs:
wp: WordPress
- php: '7.4'
wp: WordPress#6.5.5
- php: '7.4'
wp: WordPress#6.4.5
- php: '8.0'
wp: WordPress
- php: '8.0'
wp: WordPress#6.5.5
- php: '8.0'
wp: WordPress#6.4.5
- php: '8.2'
wp: WordPress
- php: '8.2'
wp: WordPress#6.5.5
- php: '8.2'
wp: WordPress#6.4.5
name: PHP ${{ matrix.php }} / ${{ matrix.wp }} Test

steps:
Expand Down
2 changes: 1 addition & 1 deletion flexible-table-block.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
/**
* Plugin Name: Flexible Table Block
* Description: Easily create flexible configuration tables.
* Requires at least: 6.4
* Requires at least: 6.5
* Requires PHP: 7.4
* Version: 3.3.0
* Author: Aki Hamano
Expand Down
2 changes: 1 addition & 1 deletion readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
Contributors: wildworks, Toro_Unit
Tags: gutenberg, block, table
Donate link: https://www.paypal.me/thamanoJP
Requires at least: 6.4
Requires at least: 6.5
Tested up to: 6.6
Stable tag: 3.3.0
Requires PHP: 7.4
Expand Down
26 changes: 20 additions & 6 deletions test/e2e/specs/block-support.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@ test.use( {
} );

test.describe( 'Block Support', () => {
test.beforeAll( async ( { requestUtils } ) => {
await requestUtils.activateTheme( 'twentytwentyfour' );
} );

test.beforeEach( async ( { admin } ) => {
await admin.createNewPost();
} );
Expand Down Expand Up @@ -50,8 +54,13 @@ test.describe( 'Block Support', () => {
.getByRole( 'radiogroup', { name: 'Font size' } )
.getByRole( 'radio', { name: 'Large', exact: true } )
.click();

// Change font appearance.
await page.getByRole( 'button', { name: 'Appearance' } ).click();
await page
.getByRole( [ '6-5', '6-6' ].includes( wpVersion ) ? 'button' : 'combobox', {
name: 'Appearance',
} )
.click();
await page.getByRole( 'listbox', { name: 'Appearance' } );
await pageUtils.pressKeys( 'ArrowDown', { times: 5 } );
await pageUtils.pressKeys( 'Enter' );
Expand All @@ -66,6 +75,7 @@ test.describe( 'Block Support', () => {
} );

test( 'dimensions settings should be applied', async ( { editor, page, fsbUtils } ) => {
const wpVersion = await fsbUtils.getWpVersion();
await fsbUtils.createFlexibleTableBlock();
// Open the sidebar.
await editor.openDocumentSettingsSidebar();
Expand All @@ -81,11 +91,15 @@ test.describe( 'Block Support', () => {
.click();
await page.getByRole( 'button', { name: 'Dimensions options' } ).click();
// Show custom controls.
await page.getByRole( 'button', { name: 'Margin options' } ).click();
await page
.getByRole( 'menu', { name: 'Margin options' } )
.getByRole( 'menuitemradio', { name: 'Custom' } )
.click();
if ( [ '6-5', '6-6' ].includes( wpVersion ) ) {
await page.getByRole( 'button', { name: 'Margin options' } ).click();
await page
.getByRole( 'menu', { name: 'Margin options' } )
.getByRole( 'menuitemradio', { name: 'Custom' } )
.click();
} else {
await page.getByRole( 'button', { name: 'Unlink margin' } ).click();
}
// Change margin values.
for ( let i = 0; i < 4; i++ ) {
await page.getByRole( 'button', { name: 'Set custom size' } ).nth( 0 ).click();
Expand Down
30 changes: 5 additions & 25 deletions test/e2e/specs/table-cell.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,6 @@ test.describe( 'Flexible table cell', () => {
pageUtils,
fsbUtils,
} ) => {
const wpVersion = await fsbUtils.getWpVersion();
await fsbUtils.createFlexibleTableBlock();
await editor.canvas.getByRole( 'textbox', { name: 'Body cell text' } ).nth( 0 ).fill( 'Link' );
await pageUtils.pressKeys( 'primary+a' );
Expand All @@ -71,34 +70,15 @@ test.describe( 'Flexible table cell', () => {
expect( await editor.getEditedPostContent() ).toMatchSnapshot();

// Edit the link.
if ( wpVersion === '6-4' ) {
// WP6.4
await pageUtils.pressKeys( 'primary+a' );
await page.locator( '.block-editor-link-control__search-item-title' ).focus();
await pageUtils.pressKeys( 'Tab' );
await pageUtils.pressKeys( 'Enter' );
} else {
// WP6.5, 6.6
await pageUtils.pressKeys( 'Tab' );
await pageUtils.pressKeys( 'Enter' );
}

await pageUtils.pressKeys( 'Tab' );
await pageUtils.pressKeys( 'Enter' );
await page.getByRole( 'combobox', { name: 'Link' } ).fill( '#anchor-updated' );
await pageUtils.pressKeys( 'Enter' );

// Toggle "Open in new tab".
if ( wpVersion === '6-4' ) {
// WP6.4
await pageUtils.pressKeys( 'primary+a' );
await page.locator( '.block-editor-link-control__search-item-title' ).focus();
await pageUtils.pressKeys( 'Tab' );
await pageUtils.pressKeys( 'Enter' );
} else {
// WP6.5, 6.6
await pageUtils.pressKeys( 'Enter' );
await pageUtils.pressKeys( 'Tab' );
await pageUtils.pressKeys( 'Enter' );
}
await pageUtils.pressKeys( 'Enter' );
await pageUtils.pressKeys( 'Tab' );
await pageUtils.pressKeys( 'Enter' );
await page
.locator( '.block-editor-link-control__tools ' )
.getByRole( 'button', { name: 'Advanced' } )
Expand Down
36 changes: 18 additions & 18 deletions test/e2e/specs/transform.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -89,8 +89,8 @@ test.describe( 'Transform from flexible table block', () => {
await editor.transformBlockTo( 'core/table' );

// Starting with WP6.6, "Fixed width table cells" is enabled by default.
const expected = [ '6-4', '6-5' ].includes( wpVersion )
? // WP6.4, 6.5
const expected = [ '6-5' ].includes( wpVersion )
? // WP6.5
`<!-- wp:table {"hasFixedLayout":true} -->
<figure class="wp-block-table"><table class="has-fixed-layout"><tbody><tr><td></td><td></td><td></td></tr><tr><td>Flexible Table Block</td><td></td><td></td></tr><tr><td></td><td></td><td></td></tr><tr><td></td><td></td><td></td></tr><tr><td></td><td></td><td></td></tr><tr><td></td><td></td><td></td></tr></tbody></table></figure>
<!-- /wp:table -->`
Expand Down Expand Up @@ -123,8 +123,8 @@ test.describe( 'Transform from flexible table block', () => {
await editor.transformBlockTo( 'core/table' );

// Starting with WP6.6, "Fixed width table cells" is enabled by default.
const expected = [ '6-4', '6-5' ].includes( wpVersion )
? // WP6.4, 6.5
const expected = [ '6-5' ].includes( wpVersion )
? // WP6.5
`<!-- wp:table -->
<figure class="wp-block-table"><table><tbody><tr><td>Flexible Table Block</td><td></td><td></td><td></td><td></td><td></td></tr><tr><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td></td><td></td><td></td><td></td><td></td><td></td></tr></tbody></table></figure>
<!-- /wp:table -->`
Expand Down Expand Up @@ -157,8 +157,8 @@ test.describe( 'Transform from flexible table block', () => {
await editor.transformBlockTo( 'core/table' );

// Starting with WP6.6, "Fixed width table cells" is enabled by default.
const expected = [ '6-4', '6-5' ].includes( wpVersion )
? // WP6.4, 6.5
const expected = [ '6-5' ].includes( wpVersion )
? // WP6.5
`<!-- wp:table {"hasFixedLayout":true} -->
<figure class="wp-block-table"><table class="has-fixed-layout"><tbody><tr><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td></td><td></td><td></td><td></td><td></td><td></td></tr></tbody></table></figure>
<!-- /wp:table -->`
Expand Down Expand Up @@ -194,8 +194,8 @@ test.describe( 'Transform from flexible table block', () => {
await editor.transformBlockTo( 'core/table' );

// Starting with WP6.6, "Fixed width table cells" is enabled by default.
const expected = [ '6-4', '6-5' ].includes( wpVersion )
? // WP6.4, 6.5
const expected = [ '6-5' ].includes( wpVersion )
? // WP6.5
`<!-- wp:table {"hasFixedLayout":true} -->
<figure class="wp-block-table"><table class="has-fixed-layout"><tbody><tr><td colspan="2">Cell 1</td><td></td><td></td><td></td></tr><tr><td></td><td></td><td></td><td></td><td></td></tr><tr><td></td><td></td><td></td><td></td><td></td></tr><tr><td></td><td></td><td></td><td></td><td></td></tr><tr><td></td><td></td><td></td><td></td><td></td></tr></tbody></table></figure>
<!-- /wp:table -->`
Expand Down Expand Up @@ -231,8 +231,8 @@ test.describe( 'Transform from flexible table block', () => {
await editor.transformBlockTo( 'core/table' );

// Starting with WP6.6, "Fixed width table cells" is enabled by default.
const expected = [ '6-4', '6-5' ].includes( wpVersion )
? // WP6.4, 6.5
const expected = [ '6-5' ].includes( wpVersion )
? // WP6.5
`<!-- wp:table {"hasFixedLayout":true} -->
<figure class="wp-block-table"><table class="has-fixed-layout"><tbody><tr><td>Flexible Table Block</td><td></td><td></td></tr><tr><td></td><td></td><td></td></tr><tr><td></td><td></td><td></td></tr></tbody></table></figure>
<!-- /wp:table -->`
Expand Down Expand Up @@ -265,8 +265,8 @@ test.describe( 'Transform from flexible table block', () => {
await editor.transformBlockTo( 'core/table' );

// Starting with WP6.6, "Fixed width table cells" is enabled by default.
const expected = [ '6-4', '6-5' ].includes( wpVersion )
? // WP6.4, 6.5
const expected = [ '6-5' ].includes( wpVersion )
? // WP6.5
`<!-- wp:table {"hasFixedLayout":true} -->
<figure class="wp-block-table"><table class="has-fixed-layout"><tbody><tr><td></td><td></td><td></td></tr><tr><td></td><td></td><td></td></tr><tr><td></td><td></td><td></td></tr></tbody></table></figure>
<!-- /wp:table -->`
Expand Down Expand Up @@ -300,8 +300,8 @@ test.describe( 'Transform from flexible table block', () => {
await editor.transformBlockTo( 'core/table' );

// Starting with WP6.6, "Fixed width table cells" is enabled by default.
const expected = [ '6-4', '6-5' ].includes( wpVersion )
? // WP6.4, 6.5
const expected = [ '6-5' ].includes( wpVersion )
? // WP6.5
`<!-- wp:table {"hasFixedLayout":true} -->
<figure class="wp-block-table"><table class="has-fixed-layout"><thead><tr><th></th><th></th><th></th></tr></thead><tbody><tr><td></td><td></td><td></td></tr><tr><td></td><td></td><td></td></tr><tr><td></td><td></td><td></td></tr></tbody><tfoot><tr><td></td><td></td><td></td></tr></tfoot></table></figure>
<!-- /wp:table -->`
Expand Down Expand Up @@ -330,8 +330,8 @@ test.describe( 'Transform from flexible table block', () => {
await editor.transformBlockTo( 'core/table' );

// Starting with WP6.6, "Fixed width table cells" is enabled by default.
const expected = [ '6-4', '6-5' ].includes( wpVersion )
? // WP6.4, 6.5
const expected = [ '6-5' ].includes( wpVersion )
? // WP6.5
`<!-- wp:table {"hasFixedLayout":true} -->
<figure class="wp-block-table"><table class="has-fixed-layout"><tbody><tr><td></td><td></td><td></td></tr><tr><td></td><td></td><td></td></tr><tr><td></td><td></td><td></td></tr></tbody></table><figcaption class="wp-element-caption">Flexible<br>Table<br>Block</figcaption></figure>
<!-- /wp:table -->`
Expand Down Expand Up @@ -365,8 +365,8 @@ test.describe( 'Transform from flexible table block', () => {
await editor.transformBlockTo( 'core/table' );

// Starting with WP6.6, "Fixed width table cells" is enabled by default.
const expected = [ '6-4', '6-5' ].includes( wpVersion )
? // WP6.4, 6.5
const expected = [ '6-5' ].includes( wpVersion )
? // WP6.5
`<!-- wp:table {"hasFixedLayout":true} -->
<figure class="wp-block-table"><table class="has-fixed-layout"><tbody><tr><td></td><td></td><td></td></tr><tr><td></td><td></td><td></td></tr><tr><td></td><td></td><td></td></tr></tbody></table><figcaption class="wp-element-caption">Flexible Table Block</figcaption></figure>
<!-- /wp:table -->`
Expand Down

0 comments on commit 7665cb8

Please sign in to comment.