Skip to content

Commit

Permalink
release: fixes
Browse files Browse the repository at this point in the history
- Fixed the rendering of Visualizer widgets in the Customizer
  • Loading branch information
vytisbulkevicius authored May 27, 2024
2 parents f32f872 + 1fc4b83 commit 62c45a9
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 1 deletion.
2 changes: 1 addition & 1 deletion classes/Visualizer/Module/Admin.php
Original file line number Diff line number Diff line change
Expand Up @@ -333,7 +333,7 @@ public function enqueueMediaScripts() {
global $typenow;
global $current_screen;

if ( post_type_supports( $typenow, 'editor' ) || $current_screen->id === 'widgets' ) {
if ( post_type_supports( $typenow, 'editor' ) || $current_screen->id === 'widgets' || $current_screen->id === 'customize' ) {
wp_enqueue_style( 'visualizer-media', VISUALIZER_ABSURL . 'css/media.css', array( 'media-views' ), Visualizer_Plugin::VERSION );

// Load all the assets for the different libraries we support.
Expand Down
18 changes: 18 additions & 0 deletions tests/e2e/specs/gutenberg-editor.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -148,4 +148,22 @@ test.describe( 'Charts with Gutenberg Editor', () => {
await expect(page.locator('rect').first()).toBeVisible();

} );

test( 'check widgets in the Customizer', async ( { admin, editor, page } ) => {
await createChartWithAdmin( admin, page );

await admin.visitAdminPage( 'customize.php' );

await page.getByRole('heading', { name: 'Widgets' }).click();
await page.getByRole('heading', { name: 'Footer' }).click();
await page.getByRole('button', { name: 'Got it' }).click();
await page.getByLabel('Document tools').getByLabel('Add block').click();
await page.getByPlaceholder('Search', { exact: true }).fill('visualizer');
await page.getByRole('option', { name: ' Visualizer Chart' }).click();
await page.getByText('Display an existing chart').click();
await page.locator('.visualizer-settings__charts-controls').first().click();
await expect(page.getByLabel('Block: Visualizer Chart')).toContainText('Visualizer');
await expect(page.locator('rect').first()).toBeVisible();

} );
} );

0 comments on commit 62c45a9

Please sign in to comment.