Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make Write mode and Zoom out block options menus consistent #67749

Merged
merged 3 commits into from
Dec 12, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
adds tests for counting the length of the options menu
  • Loading branch information
draganescu committed Dec 11, 2024
commit a66f37699224886abdc43d45eefcefc2cc482526
11 changes: 11 additions & 0 deletions test/e2e/specs/editor/various/write-design-mode.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,17 @@ test.describe( 'Write/Design mode', () => {

expect( await getSelectedBlock() ).toEqual( sectionClientId );

// open the block toolbar more settings menu
await page.getByLabel( 'Block tools' ).getByLabel( 'Options' ).click();

// get the length of the options menu
const optionsMenu = page
.getByRole( 'menu', { name: 'Options' } )
.getByRole( 'menuitem' );

// we expect 3 items in the options menu
await expect( optionsMenu ).toHaveCount( 3 );

// We should be able to select the paragraph block and write in it.
await paragraph.click();
await page.keyboard.type( ' something' );
Expand Down
33 changes: 33 additions & 0 deletions test/e2e/specs/site-editor/zoom-out.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -234,6 +234,39 @@ test.describe( 'Zoom Out', () => {
await expect( fourthSectionStart ).not.toBeInViewport();
} );

test( 'Zoom out selected section has three items in options menu', async ( {
page,
} ) => {
// open the inserter
await page
.getByRole( 'button', {
name: 'Block Inserter',
exact: true,
} )
.click();
// switch to patterns tab
await page.getByRole( 'tab', { name: 'Patterns' } ).click();
// search for a pattern
await page
.getByRole( 'searchbox', { name: 'Search' } )
.fill( 'Footer' );
// click on Footer with colophon, 3 columns
await page
.getByRole( 'option', { name: 'Footer with colophon, 3 columns' } )
.click();

// open the block toolbar more settings menu
await page.getByLabel( 'Block tools' ).getByLabel( 'Options' ).click();

// get the length of the options menu
const optionsMenu = page
.getByRole( 'menu', { name: 'Options' } )
.getByRole( 'menuitem' );

// we expect 3 items in the options menu
await expect( optionsMenu ).toHaveCount( 3 );
} );

test( 'Zoom Out cannot be activated when the section root is missing', async ( {
page,
editor,
Expand Down
Loading