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

Add lightbox tests covering theme.json configurations, including edge cases #60150

Closed
wants to merge 17 commits into from
Closed
Show file tree
Hide file tree
Changes from 6 commits
Commits
Show all changes
17 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -369,6 +369,7 @@ const ImageURLInputUI = ( {
onSetLightbox( true );
stopEditLink();
} }
label={ __( 'Expand on click' ) }
artemiomorales marked this conversation as resolved.
Show resolved Hide resolved
>
{ __( 'Expand on click' ) }
</MenuItem>
Expand Down
2 changes: 1 addition & 1 deletion packages/block-library/src/image/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@ function block_core_image_render_lightbox( $block_content, $block ) {
$button =
$img[0]
. '<button
class="lightbox-trigger"
class="wp-lightbox-trigger"
artemiomorales marked this conversation as resolved.
Show resolved Hide resolved
type="button"
aria-haspopup="dialog"
aria-label="' . esc_attr( $aria_label ) . '"
Expand Down
3 changes: 3 additions & 0 deletions packages/e2e-test-utils-playwright/src/editor/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ import { saveSiteEditorEntities } from './site-editor';
import { setIsFixedToolbar } from './set-is-fixed-toolbar';
import { switchToLegacyCanvas } from './switch-to-legacy-canvas';
import { transformBlockTo } from './transform-block-to';
import { updatePost } from './update-post';

type EditorConstructorProps = {
page: Page;
Expand Down Expand Up @@ -89,4 +90,6 @@ export class Editor {
switchToLegacyCanvas.bind( this );
/** @borrows transformBlockTo as this.transformBlockTo */
transformBlockTo: typeof transformBlockTo = transformBlockTo.bind( this );
/** @borrows updatePost as this.updatePost */
updatePost: typeof updatePost = updatePost.bind( this );
}
23 changes: 23 additions & 0 deletions packages/e2e-test-utils-playwright/src/editor/update-post.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
/**
* Internal dependencies
*/
import type { Editor } from './index';

/**
* Publishes the post, resolving once the request is complete (once a notice
artemiomorales marked this conversation as resolved.
Show resolved Hide resolved
* is displayed).
*
* @param this
*/
export async function updatePost( this: Editor ) {
const updateButton = this.page.getByRole( 'button', {
name: 'Update',
} );
await updateButton.click();

await this.page
.getByRole( 'button', {
name: 'Update',
} )
.waitFor();
artemiomorales marked this conversation as resolved.
Show resolved Hide resolved
}