File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 33declare namespace Cypress {
44 interface Chainable < Subject > {
55
6+ getByCy ( cyKey : string ) : Chainable < Element > ;
67 postContentMatchesSnapshot ( ) : Chainable < void >
78 insertRowBlock ( ) : Chainable < void >
89 selectRowBlock ( index ?: number ) : Chainable < void >
Original file line number Diff line number Diff line change 1+ /// <reference types="Cypress" />
2+
3+ describe ( 'Settings page' , ( ) => {
4+ beforeEach ( ( ) => {
5+ cy . loginUser ( ) ;
6+ } ) ;
7+
8+ it ( 'Default values should be selected' , ( ) => {
9+ cy . visitAdminPage (
10+ 'options-general.php?page=wp-bootstrap-blocks_settings'
11+ ) ;
12+
13+ cy . get (
14+ '#wp-bootstrap-blocks_bootstrap_version option:selected'
15+ ) . should ( 'have.value' , '4' ) ;
16+
17+ cy . get ( '#wp-bootstrap-blocks_enable_css_grid' )
18+ . should ( 'not.be.checked' )
19+ . and ( 'be.disabled' ) ;
20+ } ) ;
21+
22+ it ( 'Should respect constants' , ( ) => {
23+ cy . activatePlugin ( 'wp-bootstrap-blocks-test-css-grid' ) ;
24+ cy . visitAdminPage (
25+ 'options-general.php?page=wp-bootstrap-blocks_settings'
26+ ) ;
27+
28+ cy . get ( '#wp-bootstrap-blocks_bootstrap_version' ) . should (
29+ 'be.disabled'
30+ ) ;
31+ cy . get (
32+ '#wp-bootstrap-blocks_bootstrap_version option:selected'
33+ ) . should ( 'have.value' , '5' ) ;
34+
35+ cy . get ( '#wp-bootstrap-blocks_enable_css_grid' )
36+ . should ( 'be.checked' )
37+ . and ( 'be.disabled' ) ;
38+
39+ cy . deactivatePlugin ( 'wp-bootstrap-blocks-test-css-grid' ) ;
40+ } ) ;
41+ } ) ;
Original file line number Diff line number Diff line change 1+ Cypress . Commands . add ( 'getByCy' , ( cyKey ) =>
2+ cy . get ( `[data-cy="${ cyKey } "]` )
3+ ) ;
Original file line number Diff line number Diff line change 1+ import './get-by-cy' ;
12import './insert-row-block' ;
23import './select-row-block' ;
34import './row-template-is-selected' ;
Original file line number Diff line number Diff line change @@ -148,6 +148,7 @@ Please create a new GitHub issue and let us know: [https://github.com/liip/boots
148148* [FEATURE] Reflect noGutters and horizontalGutters options visually in editor (WordPress >= 5.4).
149149* [FIX] Add missing "Medium" size to vertical gutter options.
150150* [FIX] Fix label of default css grid gutter option ("Medium" instead of "None").
151+ * [FIX] Allow enabling CSS grid option only if Bootstrap version is >= 5.
151152
152153= 4.1.0 =
153154
Original file line number Diff line number Diff line change @@ -266,7 +266,7 @@ public static function settings_page() {
266266 <div class="wrap" id="<?php echo esc_attr ( self ::MENU_SLUG ); ?> ">
267267 <h1><?php esc_html_e ( 'Bootstrap Blocks Settings ' , 'wp-bootstrap-blocks ' ); ?> </h1>
268268
269- <form method="post" action="options.php" enctype="multipart/form-data" data-cy="wp-bootstrap-blocks-settings-form" >
269+ <form method="post" action="options.php" enctype="multipart/form-data">
270270 <?php
271271 // Get settings fields
272272 settings_fields ( self ::MENU_SLUG );
You can’t perform that action at this time.
0 commit comments