This is an automated email from the ASF dual-hosted git repository.

rusackas pushed a commit to branch feat/glyph-single-file
in repository https://gitbox.apache.org/repos/asf/superset.git


The following commit(s) were added to refs/heads/feat/glyph-single-file by this 
push:
     new cbe97e17e37 test(glyph): Playwright smoke test for Customize tab on 
Pie chart
cbe97e17e37 is described below

commit cbe97e17e37cb3f9269d1de9199e1c271a80f3e4
Author: Evan Rusackas <[email protected]>
AuthorDate: Mon May 25 18:54:18 2026 -0700

    test(glyph): Playwright smoke test for Customize tab on Pie chart
    
    Verifies the GlyphOptionsPanel renderer kicks in end-to-end: creates a
    Pie chart via the API, opens its Explore page, switches to the Customize
    tab, and asserts a known glyph arg (Show legend) renders. This is the
    shortest path to catching a regression in the glyph -> control-panel
    hybrid rendering path.
    
    Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
---
 .../tests/chart/glyph-customize-tab.spec.ts        | 91 ++++++++++++++++++++++
 1 file changed, 91 insertions(+)

diff --git 
a/superset-frontend/playwright/tests/chart/glyph-customize-tab.spec.ts 
b/superset-frontend/playwright/tests/chart/glyph-customize-tab.spec.ts
new file mode 100644
index 00000000000..de89171fbd0
--- /dev/null
+++ b/superset-frontend/playwright/tests/chart/glyph-customize-tab.spec.ts
@@ -0,0 +1,91 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+/**
+ * Smoke test: Glyph-defined chart's Customize tab renders via 
GlyphOptionsPanel.
+ *
+ * Glyph charts (those built with defineChart) replace the legacy 
controlPanel.ts
+ * file with declarative arg definitions. Their Customize tab is rendered by
+ * GlyphOptionsPanel (a native React renderer) instead of the legacy
+ * ControlSetRow pipeline. This test verifies that path actually works 
end-to-end:
+ * open the Pie chart explore page, switch to Customize, and confirm a known
+ * glyph control (Show legend) is rendered.
+ */
+
+import { testWithAssets, expect } from '../../helpers/fixtures';
+import { ExplorePage } from '../../pages/ExplorePage';
+import { apiPostChart } from '../../helpers/api/chart';
+import { getDatasetByName } from '../../helpers/api/dataset';
+
+const test = testWithAssets;
+
+test('Pie chart Customize tab renders glyph controls', async ({
+  page,
+  testAssets,
+}) => {
+  // 1. Create a real Pie chart via API so we have something to load.
+  const dataset = await getDatasetByName(page, 'members_channels_2');
+  if (!dataset) {
+    throw new Error(
+      'members_channels_2 dataset not found — run Superset with 
--load-examples',
+    );
+  }
+
+  const name = `glyph_pie_${Date.now()}_${test.info().parallelIndex}`;
+  const response = await apiPostChart(page, {
+    slice_name: name,
+    datasource_id: dataset.id,
+    datasource_type: 'table',
+    viz_type: 'pie',
+    params: JSON.stringify({
+      viz_type: 'pie',
+      groupby: ['channel'],
+      metric: {
+        aggregate: 'COUNT',
+        column: null,
+        expressionType: 'SIMPLE',
+        label: 'count',
+      },
+      adhoc_filters: [],
+      row_limit: 100,
+      show_legend: true,
+    }),
+  });
+  if (!response.ok()) {
+    throw new Error(`Failed to create Pie chart: ${response.status()}`);
+  }
+  const body = await response.json();
+  const id = body.result?.id ?? body.id;
+  testAssets.trackChart(id);
+
+  // 2. Open the Explore page for this chart.
+  await page.goto(`/explore/?slice_id=${id}`);
+
+  const explore = new ExplorePage(page);
+  await explore.waitForPageLoad();
+
+  // 3. Switch to the Customize tab. This is what triggers GlyphOptionsPanel
+  //    to render — without it we'd be looking at the Data tab.
+  await page.getByRole('tab', { name: 'Customize' }).click();
+
+  // 4. The Customize tab should show at least one Chart Options collapse 
header.
+  //    Both the section label and a known glyph arg (Show legend) belong to 
Pie,
+  //    so we assert on the arg label to prove the native glyph renderer ran.
+  await expect(page.getByText('Show legend').first()).toBeVisible();
+});

Reply via email to