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

fix: widgets inside customizer #1158

Merged
merged 1 commit into from
May 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
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
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();

} );
} );
Loading