Skip to content

Commit 1846253

Browse files
authored
Merge pull request #106 from liip/feat/modernize
feat(): Modernize all the things
2 parents e4437f3 + 9771800 commit 1846253

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

51 files changed

+4491
-5226
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ The version can be selected in the plugin settings (Settings > Bootstrap Blocks)
7070
* Bootstrap 4 (default): `define( 'WP_BOOTSTRAP_BLOCKS_BOOTSTRAP_VERSION', '4' );`
7171
* Bootstrap 5: `define( 'WP_BOOTSTRAP_BLOCKS_BOOTSTRAP_VERSION', '5' );`
7272

73-
Possible values right now are `'4'` or `'5'`. By default Bootstrap version **4** is selected.
73+
Possible values right now are `'4'` or `'5'`. By default Bootstrap version **5** is selected.
7474

7575
## CSS Grid
7676

build/index.asset.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
<?php return array('dependencies' => array('wp-block-editor', 'wp-blocks', 'wp-components', 'wp-compose', 'wp-data', 'wp-editor', 'wp-element', 'wp-hooks', 'wp-i18n'), 'version' => '6010ac73ad30738b341d');
1+
<?php return array('dependencies' => array('wp-block-editor', 'wp-blocks', 'wp-components', 'wp-data', 'wp-element', 'wp-hooks', 'wp-i18n'), 'version' => '9b6fd2a0b07ab4882cb6');

build/index.css

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

build/index.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

cypress/e2e/column/column-block.cy.js

Lines changed: 28 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -150,32 +150,46 @@ describe( 'Column Block', () => {
150150
cy.postContentMatchesSnapshot();
151151
} );
152152

153-
it( 'Should not display xxl breakpoint options if run with Bootstrap 4', () => {
153+
// Bootstrap 5 specific options
154+
155+
it( 'Should display xxl breakpoint options', () => {
154156
cy.insertRowBlock();
155157
cy.ensureSidebarOpened();
156158

157159
// Select first column block
158160
cy.selectColumnBlock();
159161
cy.openSidebarPanelWithTitle( 'Column size' );
160162

161-
// Xl column count option should exist
162-
cy.xpath(
163-
'//label[contains(@class,"components-base-control__label")][contains(text(),"Xl Column count")]'
164-
).should( 'exist' );
165-
166-
// Xxl column count option should not exist
163+
// Xxl column count option should exist
167164
cy.xpath(
168165
'//label[contains(@class,"components-base-control__label")][contains(text(),"Xxl Column count")]'
169-
).should( 'not.exist' );
170-
171-
// Xl equal-width option should exist
172-
cy.xpath(
173-
'//label[contains(@class,"components-checkbox-control__label")][contains(text(),"Xl equal-width")]'
174166
).should( 'exist' );
175167

176-
// Xxl equal-width option should not exist
168+
// Xxl equal-width option should exist
177169
cy.xpath(
178170
'//label[contains(@class,"components-checkbox-control__label")][contains(text(),"Xxl equal-width")]'
179-
).should( 'not.exist' );
171+
).should( 'exist' );
172+
} );
173+
174+
it( 'Should be possible to select column size for xxl breakpoint', () => {
175+
cy.insertRowBlock();
176+
cy.ensureSidebarOpened();
177+
178+
// Select first column block
179+
cy.selectColumnBlock();
180+
cy.openSidebarPanelWithTitle( 'Column size' );
181+
182+
// Change column count
183+
cy.get(
184+
'input.components-input-control__input[aria-label="Xxl Column count"]'
185+
).type( '2' );
186+
cy.get( '[data-type="wp-bootstrap-blocks/column"]' )
187+
.first()
188+
.should( 'have.attr', 'data-size-xxl', '2' );
189+
190+
// Enable column equal-width
191+
cy.clickElementByText( 'label', 'Xxl equal-width' );
192+
193+
cy.postContentMatchesSnapshot();
180194
} );
181195
} );
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
/// <reference types="Cypress" />
2+
3+
describe( 'Column Block Bootstrap 4', () => {
4+
before( () => {
5+
cy.loginUser();
6+
cy.activatePlugin( 'wp-bootstrap-blocks-test-bootstrap-v4' );
7+
} );
8+
9+
after( () => {
10+
cy.loginUser();
11+
cy.deactivatePlugin( 'wp-bootstrap-blocks-test-bootstrap-v4' );
12+
} );
13+
14+
beforeEach( () => {
15+
cy.loginUser();
16+
cy.createNewPost();
17+
} );
18+
19+
it( 'Should not display xxl breakpoint options if run with Bootstrap 4', () => {
20+
cy.insertRowBlock();
21+
cy.ensureSidebarOpened();
22+
23+
// Select first column block
24+
cy.selectColumnBlock();
25+
cy.openSidebarPanelWithTitle( 'Column size' );
26+
27+
// Xl column count option should exist
28+
cy.xpath(
29+
'//label[contains(@class,"components-base-control__label")][contains(text(),"Xl Column count")]'
30+
).should( 'exist' );
31+
32+
// Xxl column count option should not exist
33+
cy.xpath(
34+
'//label[contains(@class,"components-base-control__label")][contains(text(),"Xxl Column count")]'
35+
).should( 'not.exist' );
36+
37+
// Xl equal-width option should exist
38+
cy.xpath(
39+
'//label[contains(@class,"components-checkbox-control__label")][contains(text(),"Xl equal-width")]'
40+
).should( 'exist' );
41+
42+
// Xxl equal-width option should not exist
43+
cy.xpath(
44+
'//label[contains(@class,"components-checkbox-control__label")][contains(text(),"Xxl equal-width")]'
45+
).should( 'not.exist' );
46+
} );
47+
} );

cypress/e2e/column/column-bootstrap-v5.cy.js

Lines changed: 0 additions & 59 deletions
This file was deleted.

cypress/e2e/column/column-filters-bootstrap-v5.cy.js

Lines changed: 0 additions & 33 deletions
This file was deleted.

cypress/e2e/column/column-filters.cy.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,10 @@ describe( 'Column Block Filters', () => {
8888
'Align content bottom'
8989
);
9090

91+
// Xxl Columm size value should be set
92+
cy.openSidebarPanelWithTitle( 'Column size' );
93+
cy.getInputByLabel( 'Xxl Column count' ).should( 'have.value', '5' );
94+
9195
// Check if attributes are set correctly
9296
cy.postContentMatchesSnapshot();
9397
} );

cypress/e2e/container/container-block.cy.js

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -47,18 +47,20 @@ describe( 'Container Block', () => {
4747
cy.postContentMatchesSnapshot();
4848
} );
4949

50-
it( 'Should not display xxl breakpoint options if run with Bootstrap 4', () => {
50+
// Bootstrap 5 specific options
51+
52+
it( 'Should display xxl breakpoint', () => {
5153
cy.insertContainerBlock();
5254
cy.selectContainerBlock();
5355
cy.ensureSidebarOpened();
5456

5557
cy.xpath(
5658
`//label[contains(@class,"components-input-control__label")][contains(text(),"Fluid Breakpoint")]/parent::div/following-sibling::div/select[contains(@class,"components-select-control__input")]/option`
57-
).should( 'have.length', 5 );
59+
).should( 'have.length', 6 );
5860

59-
// xxl option should not exist
61+
// xxl option should exist
6062
cy.xpath(
6163
`//label[contains(@class,"components-input-control__label")][contains(text(),"Fluid Breakpoint")]/parent::div/following-sibling::div/select[contains(@class,"components-select-control__input")]/option[@value='xxl']`
62-
).should( 'not.exist' );
64+
).should( 'have.length', 1 );
6365
} );
6466
} );

0 commit comments

Comments
 (0)