Skip to content

Commit 1fc4b83

Browse files
Merge pull request #1158 from Codeinwp/fix/widgets
fix: widgets inside customizer
2 parents f8e0e18 + 9c4105a commit 1fc4b83

File tree

2 files changed

+19
-1
lines changed

2 files changed

+19
-1
lines changed

classes/Visualizer/Module/Admin.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -333,7 +333,7 @@ public function enqueueMediaScripts() {
333333
global $typenow;
334334
global $current_screen;
335335

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

339339
// Load all the assets for the different libraries we support.

tests/e2e/specs/gutenberg-editor.spec.js

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -148,4 +148,22 @@ test.describe( 'Charts with Gutenberg Editor', () => {
148148
await expect(page.locator('rect').first()).toBeVisible();
149149

150150
} );
151+
152+
test( 'check widgets in the Customizer', async ( { admin, editor, page } ) => {
153+
await createChartWithAdmin( admin, page );
154+
155+
await admin.visitAdminPage( 'customize.php' );
156+
157+
await page.getByRole('heading', { name: 'Widgets' }).click();
158+
await page.getByRole('heading', { name: 'Footer' }).click();
159+
await page.getByRole('button', { name: 'Got it' }).click();
160+
await page.getByLabel('Document tools').getByLabel('Add block').click();
161+
await page.getByPlaceholder('Search', { exact: true }).fill('visualizer');
162+
await page.getByRole('option', { name: ' Visualizer Chart' }).click();
163+
await page.getByText('Display an existing chart').click();
164+
await page.locator('.visualizer-settings__charts-controls').first().click();
165+
await expect(page.getByLabel('Block: Visualizer Chart')).toContainText('Visualizer');
166+
await expect(page.locator('rect').first()).toBeVisible();
167+
168+
} );
151169
} );

0 commit comments

Comments
 (0)