File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -132,6 +132,7 @@ test.describe( 'Button Block', () => {
132132 name : 'Editor settings' ,
133133 } )
134134 . getByLabel ( 'Open in new tab' )
135+ . isChecked ( )
135136 ) . toBeTruthy ( ) ;
136137
137138 // Rel should be set
Original file line number Diff line number Diff line change 1+ const { test, expect } = require ( '@wordpress/e2e-test-utils-playwright' ) ;
2+
3+ test . describe ( 'Settings page' , ( ) => {
4+ test . beforeEach ( async ( { admin } ) => {
5+ await admin . visitAdminPage (
6+ 'options-general.php?page=wp-bootstrap-blocks_settings'
7+ ) ;
8+ } ) ;
9+
10+ test ( 'Default values are selected' , async ( { page } ) => {
11+ expect (
12+ await page
13+ . locator ( '#wp-bootstrap-blocks_bootstrap_version' )
14+ . inputValue ( )
15+ ) . toBe ( '5' ) ;
16+
17+ const enableCssGridCheckbox = await page . getByLabel (
18+ 'Enable CSS grid (Experimental)'
19+ ) ;
20+
21+ expect ( await enableCssGridCheckbox . isChecked ( ) ) . toBeFalsy ( ) ;
22+ await expect ( enableCssGridCheckbox ) . not . toBeDisabled ( ) ;
23+ } ) ;
24+
25+ test ( 'Respects constants' , async ( { page, requestUtils } ) => {
26+ await requestUtils . activatePlugin (
27+ 'wp-bootstrap-blocks-test-css-grid'
28+ ) ;
29+
30+ await expect (
31+ await page . locator ( '#wp-bootstrap-blocks_bootstrap_version' )
32+ ) . toBeDisabled ( ) ;
33+
34+ expect (
35+ await page
36+ . locator ( '#wp-bootstrap-blocks_bootstrap_version' )
37+ . inputValue ( )
38+ ) . toBe ( '5' ) ;
39+
40+ const enableCssGridCheckbox = await page . locator (
41+ '#wp-bootstrap-blocks_enable_css_grid'
42+ ) ;
43+
44+ expect ( await enableCssGridCheckbox . isChecked ( ) ) . toBeTruthy ( ) ;
45+ await expect ( enableCssGridCheckbox ) . toBeDisabled ( ) ;
46+
47+ await requestUtils . deactivatePlugin (
48+ 'wp-bootstrap-blocks-test-css-grid'
49+ ) ;
50+ } ) ;
51+ } ) ;
You can’t perform that action at this time.
0 commit comments