-
Notifications
You must be signed in to change notification settings - Fork 4.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Global Styles]: Add search in block types list (#39117)
* [Global Styles]: Add search in block types list * add e2e test
- Loading branch information
1 parent
0ccc0df
commit e7924f6
Showing
5 changed files
with
126 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
42 changes: 42 additions & 0 deletions
42
packages/e2e-tests/specs/site-editor/global-styles-sidebar.test.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
/** | ||
* WordPress dependencies | ||
*/ | ||
import { | ||
deleteAllTemplates, | ||
activateTheme, | ||
visitSiteEditor, | ||
toggleGlobalStyles, | ||
openGlobalStylesPanel, | ||
} from '@wordpress/e2e-test-utils'; | ||
|
||
describe( 'Global styles sidebar', () => { | ||
beforeAll( async () => { | ||
await activateTheme( 'emptytheme' ); | ||
await Promise.all( [ | ||
deleteAllTemplates( 'wp_template' ), | ||
deleteAllTemplates( 'wp_template_part' ), | ||
] ); | ||
} ); | ||
afterAll( async () => { | ||
await Promise.all( [ | ||
deleteAllTemplates( 'wp_template' ), | ||
deleteAllTemplates( 'wp_template_part' ), | ||
] ); | ||
await activateTheme( 'twentytwentyone' ); | ||
} ); | ||
beforeEach( async () => { | ||
await visitSiteEditor(); | ||
} ); | ||
describe( 'blocks list', () => { | ||
it( 'should filter results properly', async () => { | ||
await toggleGlobalStyles(); | ||
await openGlobalStylesPanel( 'Blocks' ); | ||
await page.focus( '.edit-site-block-types-search input' ); | ||
await page.keyboard.type( 'heading' ); | ||
const results = await page.$$( | ||
'.edit-site-block-types-item-list div[role="listitem"]' | ||
); | ||
expect( results.length ).toEqual( 1 ); | ||
} ); | ||
} ); | ||
} ); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters